|
ccgsl
2.7.0
C++wrappersforGnuScientificLibrary
|
Class that extends gsl_multimin_function so that it can be constructed from arbitrary function objects. More...
#include <multimin_function.hpp>


Public Member Functions | |
| function () | |
| The default constructor is only really useful for assigning to. More... | |
| function (double(*const f)(gsl::vector const &), size_t const n) | |
| Construct from a function. More... | |
| function (double(*const f)(gsl::vector const volatile &), size_t const n) | |
| Construct from a function. More... | |
| template<typename T > | |
| function (T &c, double(T::*f)(gsl::vector const &), size_t const n) | |
| Construct from a function object and a suitable member function. More... | |
| template<typename T > | |
| function (T &c, double(T::*f)(gsl::vector const volatile &), size_t const n) | |
| Construct from a function object and a suitable member function. More... | |
| function (function const &v) | |
| The copy constructor. More... | |
| function & | operator= (function const &v) |
| The assignment operator. More... | |
| function (function &&v) | |
| Move constructor. More... | |
| function & | operator= (function &&v) |
| Move operator. More... | |
| ~function () | |
| The destructor unshares any shared resource. More... | |
Static Private Member Functions | |
| static double | fn (gsl_vector const *x, void *params) |
| This is the function that gsl_multimin_function points to if function is constructed from a function object. More... | |
Private Attributes | |
| base_F * | base_f |
| size_t * | count |
| The shared reference count. More... | |
Class that extends gsl_multimin_function so that it can be constructed from arbitrary function objects.
The arbitrary function object could be a object of a class containing a member function whose argument and return values are doubles. The member function may be declared const.
To construct an object of this class from a function object t of class T, use, for example,
where T::operator is a member function whose single argument is a double. To assign, use, for example,
There are multiple forms of the function constructor and make_function(). These should allow you to construct a function object from any reasonable function object and quite a lot of unreasonable ones too. If f is an object of class gsl_multimin_function, it is always possible to pass &f to a gsl function that requires a gsl_multimin_function* argument.
This class is designed for flexibility rather than efficient copying. So if objects are to be copied frequently, consider using shared pointers or the like. Moving is defined for C++11.
The class extends gsl_multimin_function. If constructed from a function object, gsl_multimin_function::params is always the function object and gsl_multimin_function::function calls the member function using params to obtain an object to call the member function from.
Definition at line 64 of file multimin_function.hpp.
|
inline |
The default constructor is only really useful for assigning to.
Definition at line 3059 of file multimin_function.hpp.
References base_f, count, and gsl::rstat::n().
|
inlineexplicit |
Construct from a function.
| f | The function. |
| n | The number of parameters of the function. |
Definition at line 3071 of file multimin_function.hpp.
References base_f, count, fn(), and gsl::rstat::n().
|
inlineexplicit |
Construct from a function.
| f | The function. |
| n | The number of parameters of the function. |
Definition at line 3087 of file multimin_function.hpp.
References base_f, count, fn(), and gsl::rstat::n().
|
inline |
Construct from a function object and a suitable member function.
| c | The function object. |
| f | The member function. |
| n | The number of parameters of the function. |
Definition at line 3272 of file multimin_function.hpp.
References base_f, count, fn(), and gsl::rstat::n().
|
inline |
Construct from a function object and a suitable member function.
| c | The function object. |
| f | The member function. |
| n | The number of parameters of the function. |
Definition at line 3289 of file multimin_function.hpp.
References base_f, count, fn(), and gsl::rstat::n().
|
inline |
The copy constructor.
This shares base_f.
| v | The function to copy. |
Definition at line 4134 of file multimin_function.hpp.
References count, and gsl::rstat::n().
|
inline |
Move constructor.
| v | The function to move. |
Definition at line 4165 of file multimin_function.hpp.
References count, and gsl::rstat::n().
|
inline |
The destructor unshares any shared resource.
Definition at line 4189 of file multimin_function.hpp.
|
inlinestaticprivate |
This is the function that gsl_multimin_function points to if function is constructed from a function object.
| x | A double. |
| params | The parameters, which are always set to be a pointer to the function object. |
Definition at line 4205 of file multimin_function.hpp.
References gsl::sf::mathieu::b().
Referenced by function().
Move operator.
| v | The function to move. |
Definition at line 4177 of file multimin_function.hpp.
References base_f, count, and gsl::rstat::n().
The assignment operator.
This makes a shared copy.
| v | The function to copy |
Definition at line 4145 of file multimin_function.hpp.
References base_f, count, and gsl::rstat::n().
|
private |
Definition at line 3050 of file multimin_function.hpp.
Referenced by function(), operator=(), and ~function().
|
private |
The shared reference count.
Definition at line 3054 of file multimin_function.hpp.
Referenced by function(), operator=(), and ~function().