This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Multidimensional minimization in c++
- To: Tom Mortimer-Jones <tmj at tcpc3 dot bham dot ac dot uk>
- Subject: Re: Multidimensional minimization in c++
- From: Brian Gough <bjg at network-theory dot co dot uk>
- Date: Wed, 5 Sep 2001 10:45:05 +0100 (BST)
- Cc: gsl-discuss <gsl-discuss at sources dot redhat dot com>
- References: <3B954DCA.FE355522@tc.bham.ac.uk>
Tom Mortimer-Jones writes:
> Has anyone used the multidimensional minimization routines in gsl within
> a c++ class?
>
> I would like to include minimization within a class, acting on data
> contained within the class, but the gsl_multimin_function_fdf requires
> function (method) addresses which have to be static and static methods
> cannot work on the non static data within my class instances. Has anyone
> found a way to work around this problem or am I doing something wrong?
I don't know if there's any special way to handle this elegantly in
C++ generally but with GSL you can always use the void * params
argument of gsl_multimin_function_fdf to pass the necessary
information (e.g. a pointer to self).
regards
Brian Gough