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:
- plain, the single process interface and
- mpi_plain which uses the Message Passing Interface (MPI) to distribute the calculation among parallel running processes.
|
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 >()) |
|
◆ 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_iteration()
template<typename I , typename R >
Performs exactly one iteration using the PLAIN Monte Carlo integration algorithm.