hep-mc  0.8
Functions
PLAIN Integrator

Detailed Description

The PLAIN Monte Carlo integration algorithm.

The PLAIN Monte Carlo integration algorithm is the most simple integration that simply generates random numbers \( \vec{x}_i \in [0,1]^d \) in the \( d \)-dimensional hypercube \( [0,1]^d \) and averages the integrand evaluated at these points.

The algorithm is available in two forms:

Functions

template<typename I , typename Checkpoint = default_plain_chkpt<numeric_type_of<I>>, typename Callback = mpi_callback<Checkpoint>>
Checkpoint hep::mpi_plain (MPI_Comm communicator, I &&integrand, std::vector< std::size_t > const &iteration_calls, Checkpoint chkpt=make_plain_chkpt< numeric_type_of< I >>(), Callback callback=mpi_callback< Checkpoint >())
 
template<typename I , typename R >
plain_result< numeric_type_of< I > > hep::plain_iteration (I &&integrand, std::size_t calls, R &generator)
 
template<typename I , typename Checkpoint = default_plain_chkpt<numeric_type_of<I>>, typename Callback = callback<Checkpoint>>
Checkpoint hep::plain (I &&integrand, std::vector< std::size_t > const &iteration_calls, Checkpoint chkpt=make_plain_chkpt< numeric_type_of< I >>(), Callback callback=callback< Checkpoint >())
 

Function Documentation

◆ mpi_plain()

template<typename I , typename Checkpoint = default_plain_chkpt<numeric_type_of<I>>, typename Callback = mpi_callback<Checkpoint>>
Checkpoint hep::mpi_plain ( MPI_Comm  communicator,
I &&  integrand,
std::vector< std::size_t > const &  iteration_calls,
Checkpoint  chkpt = make_plain_chkpt<numeric_type_of<I>>(),
Callback  callback = mpi_callback<Checkpoint>() 
)
inline

MPI version of the plain Monte Carlo integrator.

◆ plain()

template<typename I , typename Checkpoint = default_plain_chkpt<numeric_type_of<I>>, typename Callback = callback<Checkpoint>>
Checkpoint hep::plain ( I &&  integrand,
std::vector< std::size_t > const &  iteration_calls,
Checkpoint  chkpt = make_plain_chkpt<numeric_type_of<I>>(),
Callback  callback = callback<Checkpoint>() 
)
inline

PLAIN Monte Carlo integrator. This function integrates integrand over the unit-hypercube using calls function evaluations with randomly chosen points determined by generator.

Examples:
checkpoints.cpp, checkpoints2.cpp, distributions_example.cpp, and two_dimensional_distribution.cpp.

◆ plain_iteration()

template<typename I , typename R >
plain_result<numeric_type_of<I> > hep::plain_iteration ( I &&  integrand,
std::size_t  calls,
R &  generator 
)
inline

Performs exactly one iteration using the PLAIN Monte Carlo integration algorithm.