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

Workspace for one-dimensional minimisation. More...

#include <min.hpp>

Collaboration diagram for gsl::min::fminimizer:
Collaboration graph

Public Types

typedef gsl_min_fminimizer_type type
 Typedef. More...
 

Public Member Functions

 fminimizer ()
 The default constructor is only really useful for assigning to. More...
 
 fminimizer (type const *T)
 The standard constructor creates a new minimizer of type fminimizer::type. More...
 
 fminimizer (gsl_min_fminimizer *v)
 Could construct from a gsl_min_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_min_fminimizer * get () const
 Get the gsl_min_fminimizer. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_min_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 (function_scl &f, double x_minimum, double x_lower, double x_upper)
 C++ version of gsl_min_fminimizer_set(). More...
 
int set_with_values (function_scl &f, double x_minimum, double f_minimum, double x_lower, double f_lower, double x_upper, double f_upper)
 C++ version of gsl_min_fminimizer_set_with_values(). More...
 
int iterate ()
 C++ version of gsl_min_fminimizer_iterate(). More...
 
char const * name () const
 C++ version of gsl_min_fminimizer_name(). More...
 
double x_minimum () const
 C++ version of gsl_min_fminimizer_x_minimum(). More...
 
double x_lower ()
 C++ version of gsl_min_fminimizer_x_lower(). More...
 
double x_upper () const
 C++ version of gsl_min_fminimizer_x_upper(). More...
 
double f_minimum () const
 C++ version of gsl_min_fminimizer_f_minimum(). More...
 
double f_lower () const
 C++ version of gsl_min_fminimizer_f_lower(). More...
 
double f_upper () const
 C++ version of gsl_min_fminimizer_f_upper(). More...
 

Static Public Member Functions

static int set (fminimizer &s, function_scl &f, double x_minimum, double x_lower, double x_upper)
 C++ version of gsl_min_fminimizer_set(). More...
 
static int set_with_values (fminimizer &s, function_scl &f, double x_minimum, double f_minimum, double x_lower, double f_lower, double x_upper, double f_upper)
 C++ version of gsl_min_fminimizer_set_with_values(). More...
 
static int iterate (fminimizer &s)
 C++ version of gsl_min_fminimizer_iterate(). More...
 
static std::string name (fminimizer const &s)
 C++ version of gsl_min_fminimizer_name(). More...
 
static double x_minimum (fminimizer const &s)
 C++ version of gsl_min_fminimizer_x_minimum(). More...
 
static double x_lower (fminimizer const &s)
 C++ version of gsl_min_fminimizer_x_lower(). More...
 
static double x_upper (fminimizer const &s)
 C++ version of gsl_min_fminimizer_x_upper(). More...
 
static double f_minimum (fminimizer const &s)
 C++ version of gsl_min_fminimizer_f_minimum(). More...
 
static double f_lower (fminimizer const &s)
 C++ version of gsl_min_fminimizer_f_lower(). More...
 
static double f_upper (fminimizer const &s)
 C++ version of gsl_min_fminimizer_f_upper(). More...
 
static type const * goldensection ()
 Static type. More...
 
static type const * brent ()
 Static type. More...
 
static type const * quad_golden ()
 Static type. More...
 

Private Attributes

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

Detailed Description

Workspace for one-dimensional minimisation.

Also acts like a namespace for fminimizer functions. The functions can also be called on an fminimizer object.

Definition at line 36 of file min.hpp.

Member Typedef Documentation

◆ type

typedef gsl_min_fminimizer_type gsl::min::fminimizer::type

Typedef.

Definition at line 41 of file min.hpp.

Constructor & Destructor Documentation

◆ fminimizer() [1/5]

gsl::min::fminimizer::fminimizer ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 45 of file min.hpp.

References ccgsl_pointer, and count.

Referenced by operator=().

◆ fminimizer() [2/5]

gsl::min::fminimizer::fminimizer ( type const *  T)
inlineexplicit

The standard constructor creates a new minimizer of type fminimizer::type.

Parameters
TThe type of the fminimizer

Definition at line 55 of file min.hpp.

References ccgsl_pointer, and count.

◆ fminimizer() [3/5]

gsl::min::fminimizer::fminimizer ( gsl_min_fminimizer *  v)
inlineexplicit

Could construct from a gsl_min_fminimizer.

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

Parameters
vThe fminimizer

Definition at line 71 of file min.hpp.

References ccgsl_pointer, and count.

◆ fminimizer() [4/5]

gsl::min::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 82 of file min.hpp.

References ccgsl_pointer, and count.

◆ ~fminimizer()

gsl::min::fminimizer::~fminimizer ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 101 of file min.hpp.

References ccgsl_pointer, and count.

◆ fminimizer() [5/5]

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

Move constructor.

Parameters
vThe fminimizer to move.

Definition at line 113 of file min.hpp.

References count.

Member Function Documentation

◆ brent()

static type const * gsl::min::fminimizer::brent ( )
inlinestatic

Static type.

Returns
the named fminimizer type

Definition at line 482 of file min.hpp.

◆ empty()

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

Find if the fminimizer is empty.

Returns
true if has size zero; otherwise false

Definition at line 190 of file min.hpp.

References ccgsl_pointer.

◆ f_lower() [1/2]

double gsl::min::fminimizer::f_lower ( ) const
inline

C++ version of gsl_min_fminimizer_f_lower().

Returns
Current value of f at x_lower.

Definition at line 464 of file min.hpp.

References get().

Referenced by set_with_values().

◆ f_lower() [2/2]

static double gsl::min::fminimizer::f_lower ( fminimizer const &  s)
inlinestatic

C++ version of gsl_min_fminimizer_f_lower().

Parameters
sAn fminimizer.
Returns
Current value of f at x_lower.

Definition at line 356 of file min.hpp.

References get().

◆ f_minimum() [1/2]

double gsl::min::fminimizer::f_minimum ( ) const
inline

C++ version of gsl_min_fminimizer_f_minimum().

Returns
Current value of f at x_minimum.

Definition at line 458 of file min.hpp.

References get().

Referenced by set_with_values().

◆ f_minimum() [2/2]

static double gsl::min::fminimizer::f_minimum ( fminimizer const &  s)
inlinestatic

C++ version of gsl_min_fminimizer_f_minimum().

Parameters
sAn fminimizer.
Returns
Current value of f at x_minimum.

Definition at line 348 of file min.hpp.

References get().

◆ f_upper() [1/2]

double gsl::min::fminimizer::f_upper ( ) const
inline

C++ version of gsl_min_fminimizer_f_upper().

Returns
Current value of f at x_upper.

Definition at line 470 of file min.hpp.

References get().

Referenced by set_with_values().

◆ f_upper() [2/2]

static double gsl::min::fminimizer::f_upper ( fminimizer const &  s)
inlinestatic

C++ version of gsl_min_fminimizer_f_upper().

Parameters
sAn fminimizer.
Returns
Current value of f at x_upper.

Definition at line 364 of file min.hpp.

References get().

◆ get()

gsl_min_fminimizer * gsl::min::fminimizer::get ( ) const
inline

Get the gsl_min_fminimizer.

Returns
the gsl_min_fminimizer

Definition at line 216 of file min.hpp.

References ccgsl_pointer.

Referenced by f_lower(), f_minimum(), f_upper(), iterate(), name(), set(), set_with_values(), x_lower(), x_minimum(), and x_upper().

◆ goldensection()

static type const * gsl::min::fminimizer::goldensection ( )
inlinestatic

Static type.

Returns
the named fminimizer type

Definition at line 476 of file min.hpp.

◆ iterate() [1/2]

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

C++ version of gsl_min_fminimizer_iterate().

Returns
Error code on failure.

Definition at line 428 of file min.hpp.

References get().

◆ iterate() [2/2]

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

C++ version of gsl_min_fminimizer_iterate().

Parameters
sAn fminimizer.
Returns
Error code on failure.

Definition at line 309 of file min.hpp.

References get().

◆ name() [1/2]

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

C++ version of gsl_min_fminimizer_name().

Returns
Name of fminimizer.

Definition at line 434 of file min.hpp.

References get().

◆ name() [2/2]

static std::string gsl::min::fminimizer::name ( fminimizer const &  s)
inlinestatic

C++ version of gsl_min_fminimizer_name().

Parameters
sAn fminimizer.
Returns
Name of fminimizer.

Definition at line 316 of file min.hpp.

References get().

◆ operator bool()

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

Allow conversion to bool.

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

Definition at line 236 of file min.hpp.

References ccgsl_pointer.

◆ operator!=()

bool gsl::min::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 143 of file min.hpp.

References operator==().

◆ operator<()

bool gsl::min::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 155 of file min.hpp.

References ccgsl_pointer.

◆ operator<=()

bool gsl::min::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 175 of file min.hpp.

References ccgsl_pointer.

◆ operator=() [1/2]

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

Move operator.

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

Definition at line 122 of file min.hpp.

References fminimizer().

◆ operator=() [2/2]

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

The assignment operator.

This copies elementwise.

Parameters
vThe fminimizer to copy

Definition at line 89 of file min.hpp.

References ccgsl_pointer, and count.

◆ operator==()

bool gsl::min::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 135 of file min.hpp.

References ccgsl_pointer.

Referenced by operator!=().

◆ operator>()

bool gsl::min::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 165 of file min.hpp.

References ccgsl_pointer.

◆ operator>=()

bool gsl::min::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 185 of file min.hpp.

References ccgsl_pointer.

◆ quad_golden()

static type const * gsl::min::fminimizer::quad_golden ( )
inlinestatic

Static type.

Returns
the named fminimizer type

Definition at line 488 of file min.hpp.

◆ set() [1/2]

static int gsl::min::fminimizer::set ( fminimizer s,
function_scl f,
double  x_minimum,
double  x_lower,
double  x_upper 
)
inlinestatic

C++ version of gsl_min_fminimizer_set().

Parameters
sAn fminimizer.
fthe function to be minimised.
x_minimumGuess for value of x at which minimum occurs.
x_lowerLower bound of initial search interval.
x_upperUpper bound of initial search interval.
Returns
Error code on failure.

Definition at line 247 of file min.hpp.

References get(), x_lower(), x_minimum(), and x_upper().

◆ set() [2/2]

int gsl::min::fminimizer::set ( function_scl f,
double  x_minimum,
double  x_lower,
double  x_upper 
)
inline

C++ version of gsl_min_fminimizer_set().

Parameters
fthe function to be minimised.
x_minimumGuess for value of x at which minimum occurs.
x_lowerLower bound of initial search interval.
x_upperUpper bound of initial search interval.
Returns
Error code on failure.

Definition at line 375 of file min.hpp.

References get(), x_lower(), x_minimum(), and x_upper().

◆ set_with_values() [1/2]

static int gsl::min::fminimizer::set_with_values ( fminimizer s,
function_scl f,
double  x_minimum,
double  f_minimum,
double  x_lower,
double  f_lower,
double  x_upper,
double  f_upper 
)
inlinestatic

C++ version of gsl_min_fminimizer_set_with_values().

Parameters
sAn fminimizer.
fthe function to be minimised.
x_minimumGuess for value of x at which minimum occurs.
f_minimumValue of f at x_minimum.
x_lowerLower bound of initial search interval.
f_lowerValue of f at x_lower.
x_upperUpper bound of initial search interval.
f_upperValue of f at x_upper.
Returns
Error code on failure.

Definition at line 277 of file min.hpp.

References f_lower(), f_minimum(), f_upper(), get(), x_lower(), x_minimum(), and x_upper().

◆ set_with_values() [2/2]

int gsl::min::fminimizer::set_with_values ( function_scl f,
double  x_minimum,
double  f_minimum,
double  x_lower,
double  f_lower,
double  x_upper,
double  f_upper 
)
inline

C++ version of gsl_min_fminimizer_set_with_values().

Parameters
fthe function to be minimised.
x_minimumGuess for value of x at which minimum occurs.
f_minimumValue of f at x_minimum.
x_lowerLower bound of initial search interval.
f_lowerValue of f at x_lower.
x_upperUpper bound of initial search interval.
f_upperValue of f at x_upper.
Returns
Error code on failure.

Definition at line 401 of file min.hpp.

References f_lower(), f_minimum(), f_upper(), get(), x_lower(), x_minimum(), and x_upper().

◆ swap()

void gsl::min::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 197 of file min.hpp.

References ccgsl_pointer, and count.

◆ unique()

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

Find if this is the only object sharing the gsl_min_fminimizer.

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

Definition at line 222 of file min.hpp.

References count.

◆ use_count()

size_t gsl::min::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 227 of file min.hpp.

References count.

◆ x_lower() [1/2]

double gsl::min::fminimizer::x_lower ( )
inline

C++ version of gsl_min_fminimizer_x_lower().

Returns
Current lower bound of search interval.

Definition at line 446 of file min.hpp.

References get().

Referenced by set(), and set_with_values().

◆ x_lower() [2/2]

static double gsl::min::fminimizer::x_lower ( fminimizer const &  s)
inlinestatic

C++ version of gsl_min_fminimizer_x_lower().

Parameters
sAn fminimizer.
Returns
Current lower bound of search interval.

Definition at line 332 of file min.hpp.

References get().

◆ x_minimum() [1/2]

double gsl::min::fminimizer::x_minimum ( ) const
inline

C++ version of gsl_min_fminimizer_x_minimum().

Returns
Current estimate of x that minimises f.

Definition at line 440 of file min.hpp.

References get().

Referenced by set(), and set_with_values().

◆ x_minimum() [2/2]

static double gsl::min::fminimizer::x_minimum ( fminimizer const &  s)
inlinestatic

C++ version of gsl_min_fminimizer_x_minimum().

Parameters
sAn fminimizer.
Returns
Current estimate of x that minimises f.

Definition at line 324 of file min.hpp.

References get().

◆ x_upper() [1/2]

double gsl::min::fminimizer::x_upper ( ) const
inline

C++ version of gsl_min_fminimizer_x_upper().

Returns
Current upper bound of search interval.

Definition at line 452 of file min.hpp.

References get().

Referenced by set(), and set_with_values().

◆ x_upper() [2/2]

static double gsl::min::fminimizer::x_upper ( fminimizer const &  s)
inlinestatic

C++ version of gsl_min_fminimizer_x_upper().

Parameters
sAn fminimizer.
Returns
Current upper bound of search interval.

Definition at line 340 of file min.hpp.

References get().

Member Data Documentation

◆ ccgsl_pointer

gsl_min_fminimizer* gsl::min::fminimizer::ccgsl_pointer
private

The shared pointer.

Definition at line 205 of file min.hpp.

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

◆ count

size_t* gsl::min::fminimizer::count
private

The shared reference count.

Definition at line 209 of file min.hpp.

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


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