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

Workspace for fminimizer. More...

#include <multimin.hpp>

Collaboration diagram for gsl::multimin::fminimizer:
Collaboration graph

Public Member Functions

 fminimizer ()
 The default constructor is only really useful for assigning to. More...
 
 fminimizer (type const *T, size_t const n)
 The default constructor creates a new fminimizer with n elements. More...
 
 fminimizer (gsl_multimin_fminimizer *v)
 Could construct from a gsl_multimin_fminimizer. More...
 
 fminimizer (fminimizer const &v)
 The copy constructor. More...
 
fminimizeroperator= (fminimizer const &v)
 The assignment operator. More...
 
 ~fminimizer ()
 The destructor only deletes the pointers if count reaches zero. More...
 
 fminimizer (fminimizer &&v)
 Move constructor. More...
 
fminimizeroperator= (fminimizer &&v)
 Move operator. More...
 
bool operator== (fminimizer const &v) const
 Two fminimizer are identically equal if their elements are identical. More...
 
bool operator!= (fminimizer const &v) const
 Two fminimizer are different if their elements are not identical. More...
 
bool operator< (fminimizer const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator> (fminimizer const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator<= (fminimizer const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator>= (fminimizer const &v) const
 A container needs to define an ordering for sorting. More...
 
bool empty () const
 Find if the fminimizer is empty. More...
 
void swap (fminimizer &v)
 Swap two fminimizer objects. More...
 
gsl_multimin_fminimizer * get () const
 Get the gsl_multimin_fminimizer. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_multimin_fminimizer. More...
 
size_t use_count () const
 Find how many fminimizer objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 
int set (multimin::function &f, vector const &x, vector const &step_size)
 C++ version of gsl_multimin_fminimizer_set(). More...
 
int set (gsl_multimin_function *f, vector const &x, vector const &step_size)
 C++ version of gsl_multimin_fminimizer_set(). More...
 
char const * name ()
 C++ version of gsl_multimin_fminimizer_name(). More...
 
int iterate ()
 C++ version of gsl_multimin_fminimizer_iterate(). More...
 
vector x ()
 C++ version of gsl_multimin_fminimizer_x(). More...
 
double minimum ()
 C++ version of gsl_multimin_fminimizer_minimum(). More...
 
double size ()
 C++ version of gsl_multimin_fminimizer_size(). More...
 

Static Public Member Functions

static int set (fminimizer &s, multimin::function &f, vector const &x, vector const &step_size)
 C++ version of gsl_multimin_fminimizer_set(). More...
 
static int set (fminimizer &s, gsl_multimin_function *f, vector const &x, vector const &step_size)
 C++ version of gsl_multimin_fminimizer_set(). More...
 
static char const * name (fminimizer const &s)
 C++ version of gsl_multimin_fminimizer_name(). More...
 
static int iterate (fminimizer &s)
 C++ version of gsl_multimin_fminimizer_iterate(). More...
 
static vector x (fminimizer const &s)
 C++ version of gsl_multimin_fminimizer_x(). More...
 
static double minimum (fminimizer const &s)
 C++ version of gsl_multimin_fminimizer_minimum(). More...
 
static double size (fminimizer const &s)
 C++ version of gsl_multimin_fminimizer_size(). More...
 
static type const * nmsimplex ()
 Static type. More...
 
static type const * nmsimplex2 ()
 Static type. More...
 
static type const * nmsimplex2rand ()
 Static type. More...
 

Private Types

typedef gsl_multimin_fminimizer_type type
 Typedef. More...
 

Private Attributes

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

Detailed Description

Workspace for fminimizer.

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

Definition at line 54 of file multimin.hpp.

Member Typedef Documentation

◆ type

typedef gsl_multimin_fminimizer_type gsl::multimin::fminimizer::type
private

Typedef.

Definition at line 58 of file multimin.hpp.

Constructor & Destructor Documentation

◆ fminimizer() [1/5]

gsl::multimin::fminimizer::fminimizer ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 63 of file multimin.hpp.

References ccgsl_pointer, and count.

Referenced by operator=().

◆ fminimizer() [2/5]

gsl::multimin::fminimizer::fminimizer ( type const *  T,
size_t const  n 
)
inlineexplicit

The default constructor creates a new fminimizer with n elements.

Parameters
TThe type of the fminimizer
nThe number of elements in the fminimizer (dimension of the function)

Definition at line 74 of file multimin.hpp.

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

◆ fminimizer() [3/5]

gsl::multimin::fminimizer::fminimizer ( gsl_multimin_fminimizer *  v)
inlineexplicit

Could construct from a gsl_multimin_fminimizer.

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

Parameters
vThe fminimizer

Definition at line 90 of file multimin.hpp.

References ccgsl_pointer, and count.

◆ fminimizer() [4/5]

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

The copy constructor.

This creates a new reference to the workspace.

Parameters
vThe fminimizer to copy.

Definition at line 101 of file multimin.hpp.

References ccgsl_pointer, and count.

◆ ~fminimizer()

gsl::multimin::fminimizer::~fminimizer ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 120 of file multimin.hpp.

References ccgsl_pointer, and count.

◆ fminimizer() [5/5]

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

Move constructor.

Parameters
vThe fminimizer to move.

Definition at line 132 of file multimin.hpp.

References count.

Member Function Documentation

◆ empty()

bool gsl::multimin::fminimizer::empty ( ) const
inline

Find if the fminimizer is empty.

Returns
true if has size zero; otherwise false

Definition at line 209 of file multimin.hpp.

References ccgsl_pointer.

◆ get()

gsl_multimin_fminimizer * gsl::multimin::fminimizer::get ( ) const
inline

Get the gsl_multimin_fminimizer.

Returns
the gsl_multimin_fminimizer

Definition at line 235 of file multimin.hpp.

References ccgsl_pointer.

Referenced by iterate(), minimum(), name(), set(), size(), and x().

◆ iterate() [1/2]

int gsl::multimin::fminimizer::iterate ( )
inline

C++ version of gsl_multimin_fminimizer_iterate().

Returns
Error code on failure.

Definition at line 349 of file multimin.hpp.

References get().

◆ iterate() [2/2]

static int gsl::multimin::fminimizer::iterate ( fminimizer s)
inlinestatic

C++ version of gsl_multimin_fminimizer_iterate().

Parameters
sThe fminimizer.
Returns
Error code on failure.

Definition at line 293 of file multimin.hpp.

References get().

◆ minimum() [1/2]

double gsl::multimin::fminimizer::minimum ( )
inline

C++ version of gsl_multimin_fminimizer_minimum().

Returns
The value of f at the value of x that is estimated to minimise f.

Definition at line 364 of file multimin.hpp.

References get().

◆ minimum() [2/2]

static double gsl::multimin::fminimizer::minimum ( fminimizer const &  s)
inlinestatic

C++ version of gsl_multimin_fminimizer_minimum().

Parameters
sThe fminimizer.
Returns
The value of f at the value of x that is estimated to minimise f.

Definition at line 311 of file multimin.hpp.

References get().

◆ name() [1/2]

char const * gsl::multimin::fminimizer::name ( )
inline

C++ version of gsl_multimin_fminimizer_name().

Returns
The name of the fminimizer.

Definition at line 344 of file multimin.hpp.

References get().

◆ name() [2/2]

static char const * gsl::multimin::fminimizer::name ( fminimizer const &  s)
inlinestatic

C++ version of gsl_multimin_fminimizer_name().

Parameters
sThe fminimizer.
Returns
The name of the fminimizer.

Definition at line 285 of file multimin.hpp.

References get().

◆ nmsimplex()

static type const * gsl::multimin::fminimizer::nmsimplex ( )
inlinestatic

Static type.

Returns
the named fminimizer type

Definition at line 379 of file multimin.hpp.

◆ nmsimplex2()

static type const * gsl::multimin::fminimizer::nmsimplex2 ( )
inlinestatic

Static type.

Returns
the named fminimizer type

Definition at line 384 of file multimin.hpp.

◆ nmsimplex2rand()

static type const * gsl::multimin::fminimizer::nmsimplex2rand ( )
inlinestatic

Static type.

Returns
the named fminimizer type

Definition at line 389 of file multimin.hpp.

◆ operator bool()

gsl::multimin::fminimizer::operator bool ( ) const
inlineexplicit

Allow conversion to bool.

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

Definition at line 255 of file multimin.hpp.

References ccgsl_pointer.

◆ operator!=()

bool gsl::multimin::fminimizer::operator!= ( fminimizer const &  v) const
inline

Two fminimizer are different if their elements are not identical.

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

Definition at line 162 of file multimin.hpp.

References operator==().

◆ operator<()

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

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

Definition at line 174 of file multimin.hpp.

References ccgsl_pointer.

◆ operator<=()

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

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

Definition at line 194 of file multimin.hpp.

References ccgsl_pointer.

◆ operator=() [1/2]

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

Move operator.

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

Definition at line 141 of file multimin.hpp.

References fminimizer().

◆ operator=() [2/2]

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

The assignment operator.

This copies elementwise.

Parameters
vThe fminimizer to copy

Definition at line 108 of file multimin.hpp.

References ccgsl_pointer, and count.

◆ operator==()

bool gsl::multimin::fminimizer::operator== ( fminimizer const &  v) const
inline

Two fminimizer are identically equal if their elements are identical.

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

Definition at line 154 of file multimin.hpp.

References ccgsl_pointer.

Referenced by operator!=().

◆ operator>()

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

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

Definition at line 184 of file multimin.hpp.

References ccgsl_pointer.

◆ operator>=()

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

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

Definition at line 204 of file multimin.hpp.

References ccgsl_pointer.

◆ set() [1/4]

static int gsl::multimin::fminimizer::set ( fminimizer s,
gsl_multimin_function *  f,
vector const &  x,
vector const &  step_size 
)
inlinestatic

C++ version of gsl_multimin_fminimizer_set().

Parameters
sThe fminimizer.
fThe function.
xThe initial starting point.
step_sizeThe size of the first trial step.
Returns
Error code on failure.

Definition at line 276 of file multimin.hpp.

References gsl::vector::get(), get(), and x().

◆ set() [2/4]

static int gsl::multimin::fminimizer::set ( fminimizer s,
multimin::function f,
vector const &  x,
vector const &  step_size 
)
inlinestatic

C++ version of gsl_multimin_fminimizer_set().

Parameters
sThe fminimizer.
fThe function.
xThe initial starting point.
step_sizeThe size of the first trial step.
Returns
Error code on failure.

Definition at line 265 of file multimin.hpp.

References gsl::vector::get(), get(), and x().

◆ set() [3/4]

int gsl::multimin::fminimizer::set ( gsl_multimin_function *  f,
vector const &  x,
vector const &  step_size 
)
inline

C++ version of gsl_multimin_fminimizer_set().

Parameters
fThe function.
xThe initial starting point.
step_sizeThe size of the first trial step.
Returns
Error code on failure.

Definition at line 338 of file multimin.hpp.

References gsl::vector::get(), get(), and x().

◆ set() [4/4]

int gsl::multimin::fminimizer::set ( multimin::function f,
vector const &  x,
vector const &  step_size 
)
inline

C++ version of gsl_multimin_fminimizer_set().

Parameters
fThe function.
xThe initial starting point.
step_sizeThe size of the first trial step.
Returns
Error code on failure.

Definition at line 329 of file multimin.hpp.

References gsl::vector::get(), get(), and x().

◆ size() [1/2]

double gsl::multimin::fminimizer::size ( )
inline

C++ version of gsl_multimin_fminimizer_size().

Returns
The estimate of size.

Definition at line 371 of file multimin.hpp.

References get().

◆ size() [2/2]

static double gsl::multimin::fminimizer::size ( fminimizer const &  s)
inlinestatic

C++ version of gsl_multimin_fminimizer_size().

Parameters
sThe fminimizer.
Returns
The estimate of size.

Definition at line 320 of file multimin.hpp.

References get().

◆ swap()

void gsl::multimin::fminimizer::swap ( fminimizer v)
inline

Swap two fminimizer objects.

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

Parameters
vThe fminimizer to swap with this.

Definition at line 216 of file multimin.hpp.

References ccgsl_pointer, and count.

◆ unique()

bool gsl::multimin::fminimizer::unique ( ) const
inline

Find if this is the only object sharing the gsl_multimin_fminimizer.

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

Definition at line 241 of file multimin.hpp.

References count.

◆ use_count()

size_t gsl::multimin::fminimizer::use_count ( ) const
inline

Find how many fminimizer objects share this pointer.

Returns
the number of workspace objects that share this pointer.

Definition at line 246 of file multimin.hpp.

References count.

◆ x() [1/2]

vector gsl::multimin::fminimizer::x ( )
inline

C++ version of gsl_multimin_fminimizer_x().

Returns
The estimate of x that minimises f.

Definition at line 355 of file multimin.hpp.

References get(), and gsl::vector::wrap_gsl_vector_without_ownership().

Referenced by set().

◆ x() [2/2]

static vector gsl::multimin::fminimizer::x ( fminimizer const &  s)
inlinestatic

C++ version of gsl_multimin_fminimizer_x().

Parameters
sThe fminimizer.
Returns
The estimate of x that minimises f.

Definition at line 301 of file multimin.hpp.

References get(), and gsl::vector::wrap_gsl_vector_without_ownership().

Member Data Documentation

◆ ccgsl_pointer

gsl_multimin_fminimizer* gsl::multimin::fminimizer::ccgsl_pointer
private

◆ count

size_t* gsl::multimin::fminimizer::count
private

The shared reference count.

Definition at line 228 of file multimin.hpp.

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


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