ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::monte::plain Namespace Reference

Plain Monte Carlo integration. More...

Classes

class  state
 Workspace for plain Monte Carlo integration. More...
 

Functions

int init (gsl::monte::plain::state &state)
 C++ version of gsl_monte_plain_init(). More...
 
template<typename L , typename U >
int integrate (gsl::monte::function const &f, L const &xl, U const &xu, size_t const calls, gsl::rng &r, state &state, double &result, double &abserr)
 C++ version of gsl_monte_plain_integrate(). More...
 

Detailed Description

Plain Monte Carlo integration.

Function Documentation

◆ init()

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

C++ version of gsl_monte_plain_init().

This allows this state to be reused.

Parameters
stateThe workspace
Returns
Error code on failure

Definition at line 246 of file monte_plain.hpp.

References gsl::monte::plain::state::get().

◆ integrate()

template<typename L , typename U >
int gsl::monte::plain::integrate ( gsl::monte::function const &  f,
L const &  xl,
U const &  xu,
size_t const  calls,
gsl::rng r,
state state,
double &  result,
double &  abserr 
)
inline

C++ version of gsl_monte_plain_integrate().

This version can use gsl::vector or std::vector instead of arrays of doubles.

Parameters
fThe function
xlAn array of size dim (lower bounds)
xuAn array of size dim (upper bounds)
callsThe fixed number of function calls to use
rA random number generator
stateThe state
resultStorage for result
abserrEstimated absolute error
Returns
Error code on failure

Definition at line 305 of file monte_plain.hpp.

References gsl::monte::plain::state::get(), and gsl::rng::get().