ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::multimin::function_fdf Class Reference

Class that extends gsl_multimin_function_fdf so that it can be constructed from arbitrary function objects. More...

#include <multimin_function_fdf.hpp>

Inheritance diagram for gsl::multimin::function_fdf:
Inheritance graph
Collaboration diagram for gsl::multimin::function_fdf:
Collaboration graph

Classes

struct  Concept
 This is an empty abstract base class. More...
 

Public Member Functions

 function_fdf ()
 The default constructor is only really useful for assigning to. More...
 
 function_fdf (gsl_multimin_function_fdf &v)
 Could construct from a gsl_multimin_function_fdf. More...
 
template<typename T >
 function_fdf (T &t)
 Construct from an object that implements gsl::multimin::function_fdf::Concept. More...
 
 function_fdf (function_fdf const &v)
 The copy constructor. More...
 
function_fdfoperator= (function_fdf const &v)
 The assignment operator. More...
 
 function_fdf (function_fdf &&v)
 Move constructor. More...
 
function_fdfoperator= (function_fdf &&v)
 Move operator. More...
 
 ~function_fdf ()
 The destructor unshares any shared resource. More...
 

Public Attributes

base_F * function
 This gives something for params to point to. More...
 
size_t * count
 The shared reference count: used for copying this. More...
 

Friends

template<typename T >
void function_fdf_constructor (function_fdf &fdf, T &t)
 

Detailed Description

Class that extends gsl_multimin_function_fdf so that it can be constructed from arbitrary function objects.

Since gsl::multimin::function_fdf is a subclass of gsl_multimin_function_fdf, a pointer to an object of this class can be used whenever a pointer to a gsl_multimin_function_fdf object is required. Thus, pointers to objects of this class can be used directly with the GNU Scientific Library.

You can construct a gsl::multimin::function_fdf object from arbitrary function objects. If the function object is not already implemented, implementing it as a subclass T of gsl::multimin::function_fdf::Concept will make it easy to construct using gsl::multimin::function_fdf<T>(). If the function object uses a single class T that cannot readily be modified, try something like

public:
FDF( T& t ) : t( t );
double f( gsl::vector const& x ){ ... }
double df( gsl::vector const& x ){ ... }
std::pair<double,double> fdf( gsl::vector const& x ){ ... }
private:
T& t;
};
...
FDF fdf( t );
gsl::multimin_function_fdf ffdf( fdf );
This class handles vector objects as shared handles.
Definition: vector.hpp:74
int df(double const h, gsl_multifit_nlinear_fdtype const fdtype, vector const &x, vector const &wts, gsl::multifit::nlinear::function_fdf &fdf, vector const &f, matrix &J, vector &work)
C++ version of gsl_multifit_nlinear_df().
gsl_multilarge_nlinear_fdf fdf
Typedef for shorthand.
This is an empty abstract base class.

You can use similar constructions if f, df and fdf are defined in different classes.

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.

Definition at line 71 of file multimin_function_fdf.hpp.

Constructor & Destructor Documentation

◆ function_fdf() [1/5]

gsl::multimin::function_fdf::function_fdf ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 200 of file multimin_function_fdf.hpp.

References count, and gsl::multifit::nlinear::df().

◆ function_fdf() [2/5]

gsl::multimin::function_fdf::function_fdf ( gsl_multimin_function_fdf &  v)
inlineexplicit

Could construct from a gsl_multimin_function_fdf.

This constuctor is not actually visible, but gsl::multimin::function_fdf::function_fdf<T>() will construct the object correctly.

Parameters
vThe gsl_multimin_function_fdf.

Definition at line 215 of file multimin_function_fdf.hpp.

References count, gsl::multifit::nlinear::df(), and gsl::rstat::n().

◆ function_fdf() [3/5]

template<typename T >
gsl::multimin::function_fdf::function_fdf ( T &  t)
inline

Construct from an object that implements gsl::multimin::function_fdf::Concept.

Parameters
tAn object that implements gsl::multimin::function_fdf::Concept.

Definition at line 233 of file multimin_function_fdf.hpp.

◆ function_fdf() [4/5]

gsl::multimin::function_fdf::function_fdf ( function_fdf const &  v)
inline

The copy constructor.

This shares f. This constuctor is not actually visible, but gsl::multimin::function_fdf::function_fdf<T>() will construct the object correctly.

Parameters
vThe function_fdf to copy.

Definition at line 245 of file multimin_function_fdf.hpp.

References count, gsl::multifit::nlinear::df(), and gsl::rstat::n().

◆ function_fdf() [5/5]

gsl::multimin::function_fdf::function_fdf ( function_fdf &&  v)
inline

Move constructor.

Parameters
vThe function_fdf to move.

Definition at line 280 of file multimin_function_fdf.hpp.

References count, gsl::multifit::nlinear::df(), and gsl::rstat::n().

◆ ~function_fdf()

gsl::multimin::function_fdf::~function_fdf ( )
inline

The destructor unshares any shared resource.

Definition at line 308 of file multimin_function_fdf.hpp.

References count, and function.

Member Function Documentation

◆ operator=() [1/2]

function_fdf & gsl::multimin::function_fdf::operator= ( function_fdf &&  v)
inline

Move operator.

Parameters
vThe function_fdf to move.
Returns
A reference to f in this.

Definition at line 294 of file multimin_function_fdf.hpp.

References count, gsl::multifit::nlinear::df(), gsl::multimin::function::function(), and gsl::rstat::n().

◆ operator=() [2/2]

function_fdf & gsl::multimin::function_fdf::operator= ( function_fdf const &  v)
inline

The assignment operator.

This makes a shared copy.

Parameters
vThe function_fdf to copy

Definition at line 258 of file multimin_function_fdf.hpp.

References count, gsl::multifit::nlinear::df(), function, and gsl::rstat::n().

Friends And Related Function Documentation

◆ function_fdf_constructor

template<typename T >
void function_fdf_constructor ( function_fdf fdf,
T &  t 
)
friend

Member Data Documentation

◆ count

size_t* gsl::multimin::function_fdf::count

The shared reference count: used for copying this.

Definition at line 195 of file multimin_function_fdf.hpp.

Referenced by function_fdf(), operator=(), and ~function_fdf().

◆ function

base_F* gsl::multimin::function_fdf::function

This gives something for params to point to.

Definition at line 191 of file multimin_function_fdf.hpp.

Referenced by operator=(), and ~function_fdf().


The documentation for this class was generated from the following file: