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


Public Member Functions | |
| function_scl () | |
| The default constructor is only really useful for assigning to. More... | |
| function_scl (gsl_function &v) | |
| Could construct from a gsl_function. More... | |
| template<typename A > | |
| function_scl (double(*const f)(A)) | |
| Construct from a function. More... | |
| template<typename A > | |
| function_scl (double const (*const f)(A)) | |
| Construct from a function. More... | |
| template<typename T , typename R , typename A > | |
| function_scl (T &c, R(T::*f)(A)) | |
| Construct from a function object and a suitable non-const member function. More... | |
| template<typename T , typename R , typename A > | |
| function_scl (T &c, R(T::*f)(A) const) | |
| Construct from a function object and a suitable const member function. More... | |
| template<typename T , typename R , typename A > | |
| function_scl (T &c, R(T::*f)(A) volatile) | |
| Construct from a function object and a suitable volatile member function. More... | |
| template<typename T , typename R , typename A > | |
| function_scl (T &c, R(T::*f)(A) const volatile) | |
| Construct from a function object and a suitable const volatile member function. More... | |
| function_scl (function_scl const &v) | |
| The copy constructor. More... | |
| function_scl & | operator= (function_scl const &v) |
| The assignment operator. More... | |
| function_scl (function_scl &&v) | |
| Move constructor. More... | |
| function_scl & | operator= (function_scl &&v) |
| Move operator. More... | |
| ~function_scl () | |
| The destructor unshares any shared resource. More... | |
Static Public Member Functions | |
| static double | fn (double x, void *params) |
| This is the function that gsl_function points to if function_scl is constructed from a function object. More... | |
Private Attributes | |
| base_F * | f |
| size_t * | count |
| The shared reference count. More... | |
Class that extends gsl_function so that it can be constructed from arbitrary function objects.
The arbitrary function object could be an 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_scl constructor and make_function_scl(). These should allow you to construct a function_scl object from any reasonable function object and quite a lot of unreasonable ones too. If f is an object of class gsl_function_scl, it is always possible to pass &f to a gsl function that requires a gsl_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_function and is called gsl::function_scl to contrast with gsl_function_vec and avoid a name conflict if gsl_function::function were used. If constructed from a function object, gsl_function::params is always the function object and gsl_function::function calls the member function using params to obtain an object to call the member function from.
Here are a couple of examples.
Example 1: A function with no parameters.
Example 2: A function with one parameter
Definition at line 96 of file function_scl.hpp.
|
inline |
The default constructor is only really useful for assigning to.
Definition at line 369 of file function_scl.hpp.
|
inlineexplicit |
Could construct from a gsl_function.
| v | The gsl_function |
Definition at line 379 of file function_scl.hpp.
|
inlineexplicit |
Construct from a function.
There are multiple different versions of this constructor that allow the argument and return value to be cv-qualified and the argument to be supplied by reference.
| f | The function. |
Definition at line 396 of file function_scl.hpp.
|
inlineexplicit |
Construct from a function.
There are multiple different versions of this constructor that allow the argument and return value to be cv-qualified and the argument to be supplied by reference.
| f | The function. |
Definition at line 411 of file function_scl.hpp.
|
inline |
Construct from a function object and a suitable non-const member function.
| c | The function object. |
| f | The member function. |
Definition at line 424 of file function_scl.hpp.
|
inline |
Construct from a function object and a suitable const member function.
| c | The function object. |
| f | The member function. |
Definition at line 437 of file function_scl.hpp.
|
inline |
Construct from a function object and a suitable volatile member function.
| c | The function object. |
| f | The member function. |
Definition at line 450 of file function_scl.hpp.
|
inline |
Construct from a function object and a suitable const volatile member function.
| c | The function object. |
| f | The member function. |
Definition at line 463 of file function_scl.hpp.
|
inline |
The copy constructor.
This shares f.
| v | The function_scl to copy. |
Definition at line 478 of file function_scl.hpp.
References count.
|
inline |
Move constructor.
| v | The function_scl to move. |
Definition at line 507 of file function_scl.hpp.
References count.
|
inline |
The destructor unshares any shared resource.
Definition at line 529 of file function_scl.hpp.
|
inlinestatic |
This is the function that gsl_function points to if function_scl 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 544 of file function_scl.hpp.
References gsl::sf::mathieu::b().
Referenced by function_scl().
|
inline |
Move operator.
| v | The function_scl to move. |
Definition at line 518 of file function_scl.hpp.
|
inline |
The assignment operator.
This makes a shared copy.
| v | The function_scl to copy |
Definition at line 488 of file function_scl.hpp.
|
private |
The shared reference count.
Definition at line 364 of file function_scl.hpp.
Referenced by function_scl(), operator=(), and ~function_scl().
|
private |
Definition at line 360 of file function_scl.hpp.
Referenced by function_scl(), operator=(), and ~function_scl().