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

Workspace for root finding with a derivative. More...

#include <roots.hpp>

Collaboration diagram for gsl::root::fdfsolver:
Collaboration graph

Public Types

typedef gsl_root_fdfsolver_type type
 Typedef. More...
 

Public Member Functions

 fdfsolver ()
 The default constructor is only really useful for assigning to. More...
 
 fdfsolver (type const *T)
 The default constructor creates a new fdfsolver of one of the type fdfsolver::type. More...
 
 fdfsolver (gsl_root_fdfsolver *v)
 Could construct from a gsl_root_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. More...
 
gsl_root_fdfsolver * get () const
 Get the gsl_root_fdfsolver. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_root_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 &fdf, double root)
 C++ version of gsl_root_fdfsolver_set(). More...
 
int iterate ()
 C++ version of gsl_root_fdfsolver_iterate(). More...
 
char const * name ()
 C++ version of gsl_root_fdfsolver_name(). More...
 
double root ()
 C++ version of gsl_root_fdfsolver_root(). More...
 

Static Public Member Functions

static int set (fdfsolver &s, function_fdf &fdf, double root)
 C++ version of gsl_root_fdfsolver_set(). More...
 
static int iterate (fdfsolver &s)
 C++ version of gsl_root_fdfsolver_iterate(). More...
 
static std::string name (fdfsolver const &s)
 C++ version of gsl_root_fdfsolver_name(). More...
 
static double root (fdfsolver const &s)
 C++ version of gsl_root_fdfsolver_root(). More...
 
static type const * newton ()
 Static type. More...
 
static type const * secant ()
 Static type. More...
 
static type const * steffenson ()
 Static type. More...
 

Private Attributes

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

Detailed Description

Workspace for root finding with a derivative.

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

Definition at line 376 of file roots.hpp.

Member Typedef Documentation

◆ type

typedef gsl_root_fdfsolver_type gsl::root::fdfsolver::type

Typedef.

Definition at line 381 of file roots.hpp.

Constructor & Destructor Documentation

◆ fdfsolver() [1/5]

gsl::root::fdfsolver::fdfsolver ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 385 of file roots.hpp.

References ccgsl_pointer, and count.

Referenced by operator=().

◆ fdfsolver() [2/5]

gsl::root::fdfsolver::fdfsolver ( type const *  T)
inlineexplicit

The default constructor creates a new fdfsolver of one of the type fdfsolver::type.

Parameters
TThe fdfsolver type.

Definition at line 395 of file roots.hpp.

References ccgsl_pointer, and count.

◆ fdfsolver() [3/5]

gsl::root::fdfsolver::fdfsolver ( gsl_root_fdfsolver *  v)
inlineexplicit

Could construct from a gsl_root_fdfsolver.

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

Parameters
vThe fdfsolver

Definition at line 411 of file roots.hpp.

References ccgsl_pointer, and count.

◆ fdfsolver() [4/5]

gsl::root::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 422 of file roots.hpp.

References ccgsl_pointer, and count.

◆ ~fdfsolver()

gsl::root::fdfsolver::~fdfsolver ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 441 of file roots.hpp.

References ccgsl_pointer, and count.

◆ fdfsolver() [5/5]

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

Move constructor.

Parameters
vThe fdfsolver to move.

Definition at line 453 of file roots.hpp.

References count.

Member Function Documentation

◆ empty()

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

Find if the fdfsolver is empty.

Returns
true if has size zero; otherwise false

Definition at line 530 of file roots.hpp.

References ccgsl_pointer.

◆ get()

gsl_root_fdfsolver * gsl::root::fdfsolver::get ( ) const
inline

Get the gsl_root_fdfsolver.

Returns
the gsl_root_fdfsolver

Definition at line 556 of file roots.hpp.

References ccgsl_pointer.

Referenced by iterate(), name(), root(), and set().

◆ iterate() [1/2]

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

C++ version of gsl_root_fdfsolver_iterate().

Returns
Error code on failure.

Definition at line 644 of file roots.hpp.

References get().

◆ iterate() [2/2]

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

C++ version of gsl_root_fdfsolver_iterate().

Parameters
sThe solver.
Returns
Error code on failure.

Definition at line 604 of file roots.hpp.

References get().

◆ name() [1/2]

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

C++ version of gsl_root_fdfsolver_name().

Returns
UNDOCUMENTED

Definition at line 650 of file roots.hpp.

References get().

◆ name() [2/2]

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

C++ version of gsl_root_fdfsolver_name().

Parameters
sThe solver.
Returns
UNDOCUMENTED

Definition at line 611 of file roots.hpp.

References get().

◆ newton()

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

Static type.

Returns
the named fsolver type

Definition at line 662 of file roots.hpp.

◆ operator bool()

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

Allow conversion to bool.

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

Definition at line 576 of file roots.hpp.

References ccgsl_pointer.

◆ operator!=()

bool gsl::root::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 483 of file roots.hpp.

References operator==().

◆ operator<()

bool gsl::root::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 eaxmple, 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 495 of file roots.hpp.

References ccgsl_pointer.

◆ operator<=()

bool gsl::root::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 eaxmple, 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 515 of file roots.hpp.

References ccgsl_pointer.

◆ operator=() [1/2]

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

Move operator.

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

Definition at line 462 of file roots.hpp.

References fdfsolver().

◆ operator=() [2/2]

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

The assignment operator.

This copies elementwise.

Parameters
vThe fdfsolver to copy

Definition at line 429 of file roots.hpp.

References ccgsl_pointer, and count.

◆ operator==()

bool gsl::root::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 475 of file roots.hpp.

References ccgsl_pointer.

Referenced by operator!=().

◆ operator>()

bool gsl::root::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 eaxmple, 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 505 of file roots.hpp.

References ccgsl_pointer.

◆ operator>=()

bool gsl::root::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 eaxmple, 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 525 of file roots.hpp.

References ccgsl_pointer.

◆ root() [1/2]

double gsl::root::fdfsolver::root ( )
inline

C++ version of gsl_root_fdfsolver_root().

Returns
Current estimate of root.

Definition at line 656 of file roots.hpp.

References get().

Referenced by set().

◆ root() [2/2]

static double gsl::root::fdfsolver::root ( fdfsolver const &  s)
inlinestatic

C++ version of gsl_root_fdfsolver_root().

Parameters
sThe solver.
Returns
Current estimate of root.

Definition at line 619 of file roots.hpp.

References get().

◆ secant()

static type const * gsl::root::fdfsolver::secant ( )
inlinestatic

Static type.

Returns
the named fsolver type

Definition at line 667 of file roots.hpp.

◆ set() [1/2]

static int gsl::root::fdfsolver::set ( fdfsolver s,
function_fdf fdf,
double  root 
)
inlinestatic

C++ version of gsl_root_fdfsolver_set().

Parameters
sThe solver.
fdfThe function we want a root of.
rootInitial guess of root.
Returns
Error code on failure.

Definition at line 585 of file roots.hpp.

References get(), and root().

◆ set() [2/2]

int gsl::root::fdfsolver::set ( function_fdf fdf,
double  root 
)
inline

C++ version of gsl_root_fdfsolver_set().

Parameters
fdfThe function we want a root of.
rootInitial guess of root.
Returns
Error code on failure.

Definition at line 627 of file roots.hpp.

References get(), and root().

◆ steffenson()

static type const * gsl::root::fdfsolver::steffenson ( )
inlinestatic

Static type.

Returns
the named fsolver type

Definition at line 672 of file roots.hpp.

◆ swap()

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

Swap two fdfsolver.

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

Parameters
vThe fdfsolver to swap with this.

Definition at line 537 of file roots.hpp.

References ccgsl_pointer, and count.

◆ unique()

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

Find if this is the only object sharing the gsl_root_fdfsolver.

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

Definition at line 562 of file roots.hpp.

References count.

◆ use_count()

size_t gsl::root::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 567 of file roots.hpp.

References count.

Member Data Documentation

◆ ccgsl_pointer

gsl_root_fdfsolver* gsl::root::fdfsolver::ccgsl_pointer
private

The shared pointer.

Definition at line 545 of file roots.hpp.

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

◆ count

size_t* gsl::root::fdfsolver::count
private

The shared reference count.

Definition at line 549 of file roots.hpp.

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


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