ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::multiroot::fdfsolver Class Reference

Workspace for solving multidimensional root finding problems. More...

#include <multiroots.hpp>

Collaboration diagram for gsl::multiroot::fdfsolver:
Collaboration graph

Public Types

typedef gsl_multiroot_fdfsolver_type type
 Typedef. More...
 

Public Member Functions

 fdfsolver ()
 The default constructor is only really useful for assigning to. More...
 
 fdfsolver (type const *T, size_t const n)
 The default constructor creates a new fdfsolver with n elements. More...
 
 fdfsolver (gsl_multiroot_fdfsolver *v)
 Could construct from a gsl_multiroot_fdfsolver. More...
 
 fdfsolver (fdfsolver const &v)
 The copy constructor. More...
 
fdfsolveroperator= (fdfsolver const &v)
 The assignment operator. More...
 
 ~fdfsolver ()
 The destructor only deletes the pointers if count reaches zero. More...
 
 fdfsolver (fdfsolver &&v)
 Move constructor. More...
 
fdfsolveroperator= (fdfsolver &&v)
 Move operator. More...
 
bool operator== (fdfsolver const &v) const
 Two fdfsolver are identically equal if their elements are identical. More...
 
bool operator!= (fdfsolver const &v) const
 Two fdfsolver are different if their elements are not identical. More...
 
bool operator< (fdfsolver const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator> (fdfsolver const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator<= (fdfsolver const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator>= (fdfsolver const &v) const
 A container needs to define an ordering for sorting. More...
 
bool empty () const
 Find if the fdfsolver is empty. More...
 
void swap (fdfsolver &v)
 Swap two fdfsolver objects. More...
 
gsl_multiroot_fdfsolver * get () const
 Get the gsl_multiroot_fdfsolver. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_multiroot_fdfsolver. More...
 
size_t use_count () const
 Find how many fdfsolver objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 
int set (function_fdf &f, vector const &x)
 C++ version of gsl_multiroot_fdfsolver_set(). More...
 
int iterate ()
 C++ version of gsl_multiroot_fdfsolver_iterate(). More...
 
char const * name ()
 C++ version of gsl_multiroot_fdfsolver_name(). More...
 
vector const root ()
 C++ version of gsl_multiroot_fdfsolver_root(). More...
 
vector const dx ()
 C++ version of gsl_multiroot_fdfsolver_dx(). More...
 
vector const f ()
 C++ version of gsl_multiroot_fdfsolver_f(). More...
 

Static Public Member Functions

static int set (fdfsolver &s, function_fdf &f, vector const &x)
 C++ version of gsl_multiroot_fdfsolver_set(). More...
 
static int iterate (fdfsolver &s)
 C++ version of gsl_multiroot_fdfsolver_iterate(). More...
 
static std::string name (fdfsolver const &s)
 C++ version of gsl_multiroot_fdfsolver_name(). More...
 
static vector root (fdfsolver const &s)
 C++ version of gsl_multiroot_fdfsolver_root(). More...
 
static vector dx (fdfsolver const &s)
 C++ version of gsl_multiroot_fdfsolver_dx(). More...
 
static vector f (fdfsolver const &s)
 C++ version of gsl_multiroot_fdfsolver_f(). More...
 
static type const * hybridsj ()
 Static type. More...
 
static type const * hybridj ()
 Static type. More...
 
static type const * newton ()
 Static type. More...
 
static type const * gnewton ()
 Static type. More...
 

Private Attributes

gsl_multiroot_fdfsolver * ccgsl_pointer
 The shared pointer. More...
 
size_t * count
 The shared reference count. More...
 

Detailed Description

Workspace for solving multidimensional root finding problems.

Also functions as a namespace for fdfsolver functions. This also allows for functions to be called on fdfsolver as an object.

Definition at line 438 of file multiroots.hpp.

Member Typedef Documentation

◆ type

typedef gsl_multiroot_fdfsolver_type gsl::multiroot::fdfsolver::type

Typedef.

Definition at line 443 of file multiroots.hpp.

Constructor & Destructor Documentation

◆ fdfsolver() [1/5]

gsl::multiroot::fdfsolver::fdfsolver ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 447 of file multiroots.hpp.

◆ fdfsolver() [2/5]

gsl::multiroot::fdfsolver::fdfsolver ( type const *  T,
size_t const  n 
)
inlineexplicit

The default constructor creates a new fdfsolver with n elements.

Parameters
TThe fdfsolver type.
nThe number of elements in the fdfsolver.

Definition at line 458 of file multiroots.hpp.

References gsl::rstat::n().

◆ fdfsolver() [3/5]

gsl::multiroot::fdfsolver::fdfsolver ( gsl_multiroot_fdfsolver *  v)
inlineexplicit

Could construct from a gsl_multiroot_fdfsolver.

This is not usually a good idea. In this case we should not use gsl_multiroot_fdfsolver_free() to deallocate the memory.

Parameters
vThe fdfsolver

Definition at line 474 of file multiroots.hpp.

◆ fdfsolver() [4/5]

gsl::multiroot::fdfsolver::fdfsolver ( fdfsolver const &  v)
inline

The copy constructor.

This creates a new reference to the workspace.

Parameters
vThe fdfsolver to copy.

Definition at line 485 of file multiroots.hpp.

References ccgsl_pointer, and count.

◆ ~fdfsolver()

gsl::multiroot::fdfsolver::~fdfsolver ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 504 of file multiroots.hpp.

◆ fdfsolver() [5/5]

gsl::multiroot::fdfsolver::fdfsolver ( fdfsolver &&  v)
inline

Move constructor.

Parameters
vThe fdfsolver to move.

Definition at line 516 of file multiroots.hpp.

Member Function Documentation

◆ dx() [1/2]

vector const gsl::multiroot::fdfsolver::dx ( )
inline

C++ version of gsl_multiroot_fdfsolver_dx().

Note that it is this fdfsolver and not the return value that owns the data in the return value.

Returns
The last step taken by the solver.

Definition at line 766 of file multiroots.hpp.

References gsl::rstat::quantile::get().

◆ dx() [2/2]

static vector gsl::multiroot::fdfsolver::dx ( fdfsolver const &  s)
inlinestatic

C++ version of gsl_multiroot_fdfsolver_dx().

Note that it is s and not the return value that owns the data in the return value.

Parameters
sThe fdfsolver.
Returns
The last step taken by the solver.

Definition at line 697 of file multiroots.hpp.

References get().

◆ empty()

bool gsl::multiroot::fdfsolver::empty ( ) const
inline

Find if the fdfsolver is empty.

Returns
true if has size zero; otherwise false

Definition at line 593 of file multiroots.hpp.

◆ f() [1/2]

vector const gsl::multiroot::fdfsolver::f ( )
inline

C++ version of gsl_multiroot_fdfsolver_f().

Note that it is this fdfsolver and not the return value that owns the data in the return value.

Returns
The function value at the current estimate of the root.

Definition at line 778 of file multiroots.hpp.

References gsl::rstat::quantile::get().

◆ f() [2/2]

static vector gsl::multiroot::fdfsolver::f ( fdfsolver const &  s)
inlinestatic

C++ version of gsl_multiroot_fdfsolver_f().

Note that it is s and not the return value that owns the data in the return value.

Parameters
sThe fdfsolver.
Returns
The function value at the current estimate of the root.

Definition at line 709 of file multiroots.hpp.

References get().

◆ get()

gsl_multiroot_fdfsolver * gsl::multiroot::fdfsolver::get ( ) const
inline

Get the gsl_multiroot_fdfsolver.

Returns
the gsl_multiroot_fdfsolver

Definition at line 619 of file multiroots.hpp.

Referenced by dx(), f(), iterate(), name(), and root().

◆ gnewton()

static type const * gsl::multiroot::fdfsolver::gnewton ( )
inlinestatic

Static type.

Returns
the named fdfsolver type

Definition at line 804 of file multiroots.hpp.

◆ hybridj()

static type const * gsl::multiroot::fdfsolver::hybridj ( )
inlinestatic

Static type.

Returns
the named fdfsolver type

Definition at line 794 of file multiroots.hpp.

◆ hybridsj()

static type const * gsl::multiroot::fdfsolver::hybridsj ( )
inlinestatic

Static type.

Returns
the named fdfsolver type

Definition at line 789 of file multiroots.hpp.

◆ iterate() [1/2]

int gsl::multiroot::fdfsolver::iterate ( )
inline

C++ version of gsl_multiroot_fdfsolver_iterate().

Returns
Error code on failure.

Definition at line 739 of file multiroots.hpp.

References gsl::rstat::quantile::get().

◆ iterate() [2/2]

static int gsl::multiroot::fdfsolver::iterate ( fdfsolver s)
inlinestatic

C++ version of gsl_multiroot_fdfsolver_iterate().

Parameters
sThe fdfsolver.
Returns
Error code on failure.

Definition at line 667 of file multiroots.hpp.

References get().

◆ name() [1/2]

char const * gsl::multiroot::fdfsolver::name ( )
inline

C++ version of gsl_multiroot_fdfsolver_name().

Returns
The name of the solver.

Definition at line 746 of file multiroots.hpp.

References gsl::rstat::quantile::get().

◆ name() [2/2]

static std::string gsl::multiroot::fdfsolver::name ( fdfsolver const &  s)
inlinestatic

C++ version of gsl_multiroot_fdfsolver_name().

Parameters
sThe fdfsolver.
Returns
The name of the solver.

Definition at line 675 of file multiroots.hpp.

References get().

◆ newton()

static type const * gsl::multiroot::fdfsolver::newton ( )
inlinestatic

Static type.

Returns
the named fdfsolver type

Definition at line 799 of file multiroots.hpp.

◆ operator bool()

gsl::multiroot::fdfsolver::operator bool ( ) const
inlineexplicit

Allow conversion to bool.

Returns
true or false according as this contains a pointer to a gsl_multiroot_fdfsolver.

Definition at line 639 of file multiroots.hpp.

◆ operator!=()

bool gsl::multiroot::fdfsolver::operator!= ( fdfsolver const &  v) const
inline

Two fdfsolver are different if their elements are not identical.

Parameters
vThe fdfsolver to be compared with this
Returns
false or true according as this and v have identical elements or not

Definition at line 546 of file multiroots.hpp.

◆ operator<()

bool gsl::multiroot::fdfsolver::operator< ( fdfsolver const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a fdfsolver is nonnegative.

Parameters
vThe fdfsolver to be compared with this
Returns
false or true according as this is less than v lexicographically

Definition at line 558 of file multiroots.hpp.

References ccgsl_pointer.

◆ operator<=()

bool gsl::multiroot::fdfsolver::operator<= ( fdfsolver const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a fdfsolver is nonnegative.

Parameters
vThe fdfsolver to be compared with this
Returns
false or true according as this is less than or equal to v lexicographically

Definition at line 578 of file multiroots.hpp.

References ccgsl_pointer.

◆ operator=() [1/2]

fdfsolver & gsl::multiroot::fdfsolver::operator= ( fdfsolver &&  v)
inline

Move operator.

Parameters
vThe fdfsolver to move.
Returns
A reference to this.

Definition at line 525 of file multiroots.hpp.

References swap().

◆ operator=() [2/2]

fdfsolver & gsl::multiroot::fdfsolver::operator= ( fdfsolver const &  v)
inline

The assignment operator.

This copies elementwise.

Parameters
vThe fdfsolver to copy

Definition at line 492 of file multiroots.hpp.

References ccgsl_pointer, and count.

◆ operator==()

bool gsl::multiroot::fdfsolver::operator== ( fdfsolver const &  v) const
inline

Two fdfsolver are identically equal if their elements are identical.

Parameters
vThe fdfsolver to be compared with this
Returns
true or false according as this and v have identical elements or not

Definition at line 538 of file multiroots.hpp.

References ccgsl_pointer.

◆ operator>()

bool gsl::multiroot::fdfsolver::operator> ( fdfsolver const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a fdfsolver is nonnegative.

Parameters
vThe fdfsolver to be compared with this
Returns
false or true according as this is greater than v lexicographically

Definition at line 568 of file multiroots.hpp.

References ccgsl_pointer.

◆ operator>=()

bool gsl::multiroot::fdfsolver::operator>= ( fdfsolver const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a fdfsolver is nonnegative.

Parameters
vThe fdfsolver to be compared with this
Returns
false or true according as this is no less than v lexicographically

Definition at line 588 of file multiroots.hpp.

References ccgsl_pointer.

◆ root() [1/2]

vector const gsl::multiroot::fdfsolver::root ( )
inline

C++ version of gsl_multiroot_fdfsolver_root().

Note that it is this fdfsolver and not the return value that owns the data in the return value.

Returns
The current estimate of the root.

Definition at line 754 of file multiroots.hpp.

References gsl::rstat::quantile::get().

◆ root() [2/2]

static vector gsl::multiroot::fdfsolver::root ( fdfsolver const &  s)
inlinestatic

C++ version of gsl_multiroot_fdfsolver_root().

Note that it is s and not the return value that owns the data in the return value.

Parameters
sThe fdfsolver.
Returns
The current estimate of the root.

Definition at line 685 of file multiroots.hpp.

References get().

◆ set() [1/2]

static int gsl::multiroot::fdfsolver::set ( fdfsolver s,
function_fdf f,
vector const &  x 
)
inlinestatic

C++ version of gsl_multiroot_fdfsolver_set().

Parameters
sThe fdfsolver.
fThe function.
xThe initial guess of the root.
Returns
Error code on failure.

Definition at line 659 of file multiroots.hpp.

◆ set() [2/2]

int gsl::multiroot::fdfsolver::set ( function_fdf f,
vector const &  x 
)
inline

C++ version of gsl_multiroot_fdfsolver_set().

Parameters
fThe function.
xThe initial guess of the root.
Returns
Error code on failure.

Definition at line 732 of file multiroots.hpp.

◆ swap()

void gsl::multiroot::fdfsolver::swap ( fdfsolver v)
inline

Swap two fdfsolver objects.

This works even if the fdfsolver have different sizes because it swaps pointers.

Parameters
vThe fdfsolver to swap with this.

Definition at line 600 of file multiroots.hpp.

References ccgsl_pointer, and count.

Referenced by operator=().

◆ unique()

bool gsl::multiroot::fdfsolver::unique ( ) const
inline

Find if this is the only object sharing the gsl_multiroot_fdfsolver.

Returns
true or falses according as this is the only workspace object sharing the gsl_multiroot_fdfsolver.

Definition at line 625 of file multiroots.hpp.

◆ use_count()

size_t gsl::multiroot::fdfsolver::use_count ( ) const
inline

Find how many fdfsolver objects share this pointer.

Returns
the number of workspace objects that share this pointer.

Definition at line 630 of file multiroots.hpp.

Member Data Documentation

◆ ccgsl_pointer

gsl_multiroot_fdfsolver* gsl::multiroot::fdfsolver::ccgsl_pointer
private

The shared pointer.

Definition at line 608 of file multiroots.hpp.

Referenced by fdfsolver(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), and swap().

◆ count

size_t* gsl::multiroot::fdfsolver::count
private

The shared reference count.

Definition at line 612 of file multiroots.hpp.

Referenced by fdfsolver(), operator=(), and swap().


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