ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::monte::miser::state Class Reference

Workspace for Monte Carlo integration using the MISER algorithm. More...

#include <monte_miser.hpp>

Collaboration diagram for gsl::monte::miser::state:
Collaboration graph

Public Member Functions

 state ()
 The default constructor is only really useful for assigning to. More...
 
 state (size_t const dim)
 The default constructor creates a new state with n elements. More...
 
 state (gsl_monte_miser_state *v)
 Could construct from a gsl_monte_miser_state. More...
 
 state (state const &v)
 The copy constructor. More...
 
int init ()
 Initialise. More...
 
stateoperator= (state const &v)
 The assignment operator. More...
 
 ~state ()
 The destructor only deletes the pointers if count reaches zero. More...
 
 state (state &&v)
 Move constructor. More...
 
stateoperator= (state &&v)
 Move operator. More...
 
bool operator== (state const &v) const
 Two state are identically equal if their elements are identical. More...
 
bool operator!= (state const &v) const
 Two state are different if their elements are not identical. More...
 
bool operator< (state const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator> (state const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator<= (state const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator>= (state const &v) const
 A container needs to define an ordering for sorting. More...
 
bool empty () const
 Find if the state is empty. More...
 
void swap (state &v)
 Swap two state objects. More...
 
gsl_monte_miser_state * get () const
 Get the gsl_monte_miser_state. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_monte_miser_state. More...
 
size_t use_count () const
 Find how many state objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 
double get_estimate_frac () const
 Get estimate_frac. More...
 
size_t get_min_calls () const
 Get min_calls. More...
 
size_t get_min_calls_per_bisection () const
 Get min_calls_per_bisection. More...
 
double get_alpha () const
 Get alpha. More...
 
double get_dither () const
 Get dither. More...
 
void set_estimate_frac (double const estimate_frac)
 Set estimate_frac. More...
 
void set_min_calls (size_t const min_calls)
 Set min_calls. More...
 
void set_min_calls_per_bisection (size_t const min_calls_per_bisection)
 Set min_calls_per_bisection. More...
 
void set_alpha (double const alpha)
 Set alpha. More...
 
void set_dither (double const dither)
 Set dither. More...
 

Private Attributes

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

Detailed Description

Workspace for Monte Carlo integration using the MISER algorithm.

Definition at line 39 of file monte_miser.hpp.

Constructor & Destructor Documentation

◆ state() [1/5]

gsl::monte::miser::state::state ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 44 of file monte_miser.hpp.

References ccgsl_pointer, and count.

Referenced by operator=().

◆ state() [2/5]

gsl::monte::miser::state::state ( size_t const  dim)
inlineexplicit

The default constructor creates a new state with n elements.

Parameters
dimThe number of function arguments

Definition at line 54 of file monte_miser.hpp.

References ccgsl_pointer, and count.

◆ state() [3/5]

gsl::monte::miser::state::state ( gsl_monte_miser_state *  v)
inlineexplicit

Could construct from a gsl_monte_miser_state.

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

Parameters
vThe state

Definition at line 70 of file monte_miser.hpp.

References ccgsl_pointer, and count.

◆ state() [4/5]

gsl::monte::miser::state::state ( state const &  v)
inline

The copy constructor.

This creates a new reference to the workspace.

Parameters
vThe state to copy.

Definition at line 81 of file monte_miser.hpp.

References ccgsl_pointer, and count.

◆ ~state()

gsl::monte::miser::state::~state ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 105 of file monte_miser.hpp.

References ccgsl_pointer, and count.

◆ state() [5/5]

gsl::monte::miser::state::state ( state &&  v)
inline

Move constructor.

Parameters
vThe state to move.

Definition at line 117 of file monte_miser.hpp.

References count.

Member Function Documentation

◆ empty()

bool gsl::monte::miser::state::empty ( ) const
inline

Find if the state is empty.

Returns
true if has size zero; otherwise false

Definition at line 194 of file monte_miser.hpp.

References ccgsl_pointer.

◆ get()

gsl_monte_miser_state * gsl::monte::miser::state::get ( ) const
inline

Get the gsl_monte_miser_state.

Returns
the gsl_monte_miser_state

Definition at line 220 of file monte_miser.hpp.

References ccgsl_pointer.

Referenced by gsl::monte::miser::init(), and gsl::monte::miser::integrate().

◆ get_alpha()

double gsl::monte::miser::state::get_alpha ( ) const
inline

Get alpha.

Returns
alpha

Definition at line 262 of file monte_miser.hpp.

References ccgsl_pointer.

◆ get_dither()

double gsl::monte::miser::state::get_dither ( ) const
inline

Get dither.

Returns
dither

Definition at line 267 of file monte_miser.hpp.

References ccgsl_pointer.

◆ get_estimate_frac()

double gsl::monte::miser::state::get_estimate_frac ( ) const
inline

Get estimate_frac.

Returns
estimate_frac

Definition at line 246 of file monte_miser.hpp.

References ccgsl_pointer.

◆ get_min_calls()

size_t gsl::monte::miser::state::get_min_calls ( ) const
inline

Get min_calls.

Returns
min_calls

Definition at line 251 of file monte_miser.hpp.

References ccgsl_pointer.

◆ get_min_calls_per_bisection()

size_t gsl::monte::miser::state::get_min_calls_per_bisection ( ) const
inline

Get min_calls_per_bisection.

Returns
min_calls_per_bisection

Definition at line 256 of file monte_miser.hpp.

References ccgsl_pointer.

◆ init()

int gsl::monte::miser::state::init ( )
inline

Initialise.

This allows this state to be reused.

Returns
Error code on failure

Definition at line 87 of file monte_miser.hpp.

References ccgsl_pointer.

◆ operator bool()

gsl::monte::miser::state::operator bool ( ) const
inlineexplicit

Allow conversion to bool.

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

Definition at line 240 of file monte_miser.hpp.

References ccgsl_pointer.

◆ operator!=()

bool gsl::monte::miser::state::operator!= ( state const &  v) const
inline

Two state are different if their elements are not identical.

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

Definition at line 147 of file monte_miser.hpp.

References operator==().

◆ operator<()

bool gsl::monte::miser::state::operator< ( state 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 state is nonnegative.

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

Definition at line 159 of file monte_miser.hpp.

References ccgsl_pointer.

◆ operator<=()

bool gsl::monte::miser::state::operator<= ( state 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 state is nonnegative.

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

Definition at line 179 of file monte_miser.hpp.

References ccgsl_pointer.

◆ operator=() [1/2]

state & gsl::monte::miser::state::operator= ( state &&  v)
inline

Move operator.

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

Definition at line 126 of file monte_miser.hpp.

References state().

◆ operator=() [2/2]

state & gsl::monte::miser::state::operator= ( state const &  v)
inline

The assignment operator.

This copies elementwise.

Parameters
vThe state to copy

Definition at line 93 of file monte_miser.hpp.

References ccgsl_pointer, and count.

◆ operator==()

bool gsl::monte::miser::state::operator== ( state const &  v) const
inline

Two state are identically equal if their elements are identical.

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

Definition at line 139 of file monte_miser.hpp.

References ccgsl_pointer.

Referenced by operator!=().

◆ operator>()

bool gsl::monte::miser::state::operator> ( state 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 state is nonnegative.

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

Definition at line 169 of file monte_miser.hpp.

References ccgsl_pointer.

◆ operator>=()

bool gsl::monte::miser::state::operator>= ( state 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 state is nonnegative.

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

Definition at line 189 of file monte_miser.hpp.

References ccgsl_pointer.

◆ set_alpha()

void gsl::monte::miser::state::set_alpha ( double const  alpha)
inline

Set alpha.

Parameters
alphaNew value for alpha

Definition at line 289 of file monte_miser.hpp.

References ccgsl_pointer.

◆ set_dither()

void gsl::monte::miser::state::set_dither ( double const  dither)
inline

Set dither.

Parameters
ditherNew value for dither

Definition at line 294 of file monte_miser.hpp.

References ccgsl_pointer.

◆ set_estimate_frac()

void gsl::monte::miser::state::set_estimate_frac ( double const  estimate_frac)
inline

Set estimate_frac.

Parameters
estimate_fracNew value for estimate_frac

Definition at line 272 of file monte_miser.hpp.

References ccgsl_pointer.

◆ set_min_calls()

void gsl::monte::miser::state::set_min_calls ( size_t const  min_calls)
inline

Set min_calls.

Parameters
min_callsNew value for min_calls

Definition at line 278 of file monte_miser.hpp.

References ccgsl_pointer.

◆ set_min_calls_per_bisection()

void gsl::monte::miser::state::set_min_calls_per_bisection ( size_t const  min_calls_per_bisection)
inline

Set min_calls_per_bisection.

Parameters
min_calls_per_bisectionNew value for min_calls_per_bisection

Definition at line 283 of file monte_miser.hpp.

References ccgsl_pointer.

◆ swap()

void gsl::monte::miser::state::swap ( state v)
inline

Swap two state objects.

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

Parameters
vThe state to swap with this.

Definition at line 201 of file monte_miser.hpp.

References ccgsl_pointer, and count.

◆ unique()

bool gsl::monte::miser::state::unique ( ) const
inline

Find if this is the only object sharing the gsl_monte_miser_state.

Returns
true or falses according as this is the only state object sharing the gsl_monte_miser_state.

Definition at line 226 of file monte_miser.hpp.

References count.

◆ use_count()

size_t gsl::monte::miser::state::use_count ( ) const
inline

Find how many state objects share this pointer.

Returns
the number of state objects that share this pointer.

Definition at line 231 of file monte_miser.hpp.

References count.

Member Data Documentation

◆ ccgsl_pointer

◆ count

size_t* gsl::monte::miser::state::count
private

The shared reference count.

Definition at line 213 of file monte_miser.hpp.

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


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