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

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

#include <multiroots.hpp>

Collaboration diagram for gsl::multiroot::fsolver:
Collaboration graph

Public Types

typedef gsl_multiroot_fsolver_type type
 Typedef. More...
 

Public Member Functions

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

Static Public Member Functions

static int set (fsolver &s, function &f, vector const &x)
 C++ version of gsl_multiroot_fsolver_set(). More...
 
static int iterate (fsolver &s)
 C++ version of gsl_multiroot_fsolver_iterate(). More...
 
static std::string name (fsolver const &s)
 C++ version of gsl_multiroot_fsolver_name(). More...
 
static vector root (fsolver const &s)
 C++ version of gsl_multiroot_fsolver_root(). More...
 
static vector dx (fsolver const &s)
 C++ version of gsl_multiroot_fsolver_dx(). More...
 
static vector f (fsolver const &s)
 C++ version of gsl_multiroot_fsolver_f(). More...
 
static type const * dnewton ()
 Static type. More...
 
static type const * broyden ()
 Static type. More...
 
static type const * hybrid ()
 Static type. More...
 
static type const * hybrids ()
 Static type. More...
 

Private Attributes

gsl_multiroot_fsolver * 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 fsolver functions. This also allows for functions to be called on fsolver as an object.

Definition at line 65 of file multiroots.hpp.

Member Typedef Documentation

◆ type

typedef gsl_multiroot_fsolver_type gsl::multiroot::fsolver::type

Typedef.

Definition at line 70 of file multiroots.hpp.

Constructor & Destructor Documentation

◆ fsolver() [1/5]

gsl::multiroot::fsolver::fsolver ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 74 of file multiroots.hpp.

References ccgsl_pointer, and count.

Referenced by operator=().

◆ fsolver() [2/5]

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

The default constructor creates a new fsolver with n elements.

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

Definition at line 85 of file multiroots.hpp.

References ccgsl_pointer, count, and gsl::rstat::n().

◆ fsolver() [3/5]

gsl::multiroot::fsolver::fsolver ( gsl_multiroot_fsolver *  v)
inlineexplicit

Could construct from a gsl_multiroot_fsolver.

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

Parameters
vThe fsolver

Definition at line 101 of file multiroots.hpp.

References ccgsl_pointer, and count.

◆ fsolver() [4/5]

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

The copy constructor.

This creates a new reference to the workspace.

Parameters
vThe fsolver to copy.

Definition at line 112 of file multiroots.hpp.

References ccgsl_pointer, and count.

◆ ~fsolver()

gsl::multiroot::fsolver::~fsolver ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 131 of file multiroots.hpp.

References ccgsl_pointer, and count.

◆ fsolver() [5/5]

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

Move constructor.

Parameters
vThe fsolver to move.

Definition at line 143 of file multiroots.hpp.

References count.

Member Function Documentation

◆ broyden()

static type const * gsl::multiroot::fsolver::broyden ( )
inlinestatic

Static type.

Returns
the named fsolver type

Definition at line 421 of file multiroots.hpp.

◆ dnewton()

static type const * gsl::multiroot::fsolver::dnewton ( )
inlinestatic

Static type.

Returns
the named fsolver type

Definition at line 416 of file multiroots.hpp.

◆ dx() [1/2]

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

C++ version of gsl_multiroot_fsolver_dx().

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

Returns
The last step taken by the solver.

Definition at line 393 of file multiroots.hpp.

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

◆ dx() [2/2]

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

C++ version of gsl_multiroot_fsolver_dx().

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

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

Definition at line 324 of file multiroots.hpp.

References get().

◆ empty()

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

Find if the fsolver is empty.

Returns
true if has size zero; otherwise false

Definition at line 220 of file multiroots.hpp.

References ccgsl_pointer.

◆ f() [1/2]

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

C++ version of gsl_multiroot_fsolver_f().

Note that it is this fsolver 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 405 of file multiroots.hpp.

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

◆ f() [2/2]

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

C++ version of gsl_multiroot_fsolver_f().

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

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

Definition at line 336 of file multiroots.hpp.

References get().

◆ get()

gsl_multiroot_fsolver * gsl::multiroot::fsolver::get ( ) const
inline

Get the gsl_multiroot_fsolver.

Returns
the gsl_multiroot_fsolver

Definition at line 246 of file multiroots.hpp.

References ccgsl_pointer.

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

◆ hybrid()

static type const * gsl::multiroot::fsolver::hybrid ( )
inlinestatic

Static type.

Returns
the named fsolver type

Definition at line 426 of file multiroots.hpp.

◆ hybrids()

static type const * gsl::multiroot::fsolver::hybrids ( )
inlinestatic

Static type.

Returns
the named fsolver type

Definition at line 431 of file multiroots.hpp.

◆ iterate() [1/2]

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

C++ version of gsl_multiroot_fsolver_iterate().

Returns
Error code on failure.

Definition at line 366 of file multiroots.hpp.

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

◆ iterate() [2/2]

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

C++ version of gsl_multiroot_fsolver_iterate().

Parameters
sThe fsolver.
Returns
Error code on failure.

Definition at line 294 of file multiroots.hpp.

References get().

◆ name() [1/2]

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

C++ version of gsl_multiroot_fsolver_name().

Returns
The name of the solver.

Definition at line 373 of file multiroots.hpp.

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

◆ name() [2/2]

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

C++ version of gsl_multiroot_fsolver_name().

Parameters
sThe fsolver.
Returns
The name of the solver.

Definition at line 302 of file multiroots.hpp.

References get().

◆ operator bool()

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

Allow conversion to bool.

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

Definition at line 266 of file multiroots.hpp.

References ccgsl_pointer.

◆ operator!=()

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

Two fsolver are different if their elements are not identical.

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

Definition at line 173 of file multiroots.hpp.

References operator==().

◆ operator<()

bool gsl::multiroot::fsolver::operator< ( fsolver 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 fsolver is nonnegative.

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

Definition at line 185 of file multiroots.hpp.

References ccgsl_pointer.

◆ operator<=()

bool gsl::multiroot::fsolver::operator<= ( fsolver 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 fsolver is nonnegative.

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

Definition at line 205 of file multiroots.hpp.

References ccgsl_pointer.

◆ operator=() [1/2]

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

Move operator.

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

Definition at line 152 of file multiroots.hpp.

References fsolver().

◆ operator=() [2/2]

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

The assignment operator.

This copies elementwise.

Parameters
vThe fsolver to copy

Definition at line 119 of file multiroots.hpp.

References ccgsl_pointer, and count.

◆ operator==()

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

Two fsolver are identically equal if their elements are identical.

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

Definition at line 165 of file multiroots.hpp.

References ccgsl_pointer.

Referenced by operator!=().

◆ operator>()

bool gsl::multiroot::fsolver::operator> ( fsolver 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 fsolver is nonnegative.

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

Definition at line 195 of file multiroots.hpp.

References ccgsl_pointer.

◆ operator>=()

bool gsl::multiroot::fsolver::operator>= ( fsolver 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 fsolver is nonnegative.

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

Definition at line 215 of file multiroots.hpp.

References ccgsl_pointer.

◆ root() [1/2]

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

C++ version of gsl_multiroot_fsolver_root().

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

Returns
The current estimate of the root.

Definition at line 381 of file multiroots.hpp.

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

◆ root() [2/2]

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

C++ version of gsl_multiroot_fsolver_root().

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

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

Definition at line 312 of file multiroots.hpp.

References get().

◆ set() [1/2]

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

C++ version of gsl_multiroot_fsolver_set().

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

Definition at line 286 of file multiroots.hpp.

◆ set() [2/2]

int gsl::multiroot::fsolver::set ( function f,
vector const &  x 
)
inline

C++ version of gsl_multiroot_fsolver_set().

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

Definition at line 359 of file multiroots.hpp.

◆ swap()

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

Swap two fsolver objects.

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

Parameters
vThe fsolver to swap with this.

Definition at line 227 of file multiroots.hpp.

References ccgsl_pointer, and count.

◆ unique()

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

Find if this is the only object sharing the gsl_multiroot_fsolver.

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

Definition at line 252 of file multiroots.hpp.

References count.

◆ use_count()

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

Find how many fsolver objects share this pointer.

Returns
the number of workspace objects that share this pointer.

Definition at line 257 of file multiroots.hpp.

References count.

Member Data Documentation

◆ ccgsl_pointer

gsl_multiroot_fsolver* gsl::multiroot::fsolver::ccgsl_pointer
private

The shared pointer.

Definition at line 235 of file multiroots.hpp.

Referenced by empty(), fsolver(), get(), operator bool(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), swap(), and ~fsolver().

◆ count

size_t* gsl::multiroot::fsolver::count
private

The shared reference count.

Definition at line 239 of file multiroots.hpp.

Referenced by fsolver(), operator=(), swap(), unique(), use_count(), and ~fsolver().


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