BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Template class to use Monte Carlo MISER integration of class member functions.
Wraps an integrator from GNU Scientific Library. Since this class holds a persistent workspace, we need at least one instance per thread. Standard usage for integration inside a class T:
Definition at line 40 of file IntegratorMCMiser.h.
Classes | |
struct | CallBackHolder |
structure holding the object and possible extra parameters More... | |
Public Member Functions | |
IntegratorMCMiser (const T *p_object, miser_integrand< T > p_member_function, size_t dim) | |
to integrate p_member_function, which must belong to p_object More... | |
~IntegratorMCMiser () | |
double | integrate (double *min_array, double *max_array, const void *params, size_t nbr_points) const |
perform the actual integration over the ranges [min_array, max_array] More... | |
Static Private Member Functions | |
static double | StaticCallBack (double *d_array, size_t dim, void *v) |
static function that can be passed to gsl integrator More... | |
Private Attributes | |
const size_t | m_dim |
dimension of the integration More... | |
gsl_monte_miser_state * | m_gsl_workspace |
const miser_integrand< T > | m_member_function |
const T * | m_object |
gsl_rng * | m_random_gen |
IntegratorMCMiser< T >::IntegratorMCMiser | ( | const T * | p_object, |
miser_integrand< T > | p_member_function, | ||
size_t | dim | ||
) |
to integrate p_member_function, which must belong to p_object
Definition at line 91 of file IntegratorMCMiser.h.
References IntegratorMCMiser< T >::m_dim, IntegratorMCMiser< T >::m_gsl_workspace, and IntegratorMCMiser< T >::m_random_gen.
IntegratorMCMiser< T >::~IntegratorMCMiser |
Definition at line 107 of file IntegratorMCMiser.h.
double IntegratorMCMiser< T >::integrate | ( | double * | min_array, |
double * | max_array, | ||
const void * | params, | ||
size_t | nbr_points | ||
) | const |
perform the actual integration over the ranges [min_array, max_array]
Definition at line 114 of file IntegratorMCMiser.h.
|
inlinestaticprivate |
static function that can be passed to gsl integrator
Definition at line 59 of file IntegratorMCMiser.h.
|
private |
dimension of the integration
Definition at line 67 of file IntegratorMCMiser.h.
Referenced by IntegratorMCMiser< T >::IntegratorMCMiser().
|
private |
Definition at line 68 of file IntegratorMCMiser.h.
Referenced by IntegratorMCMiser< T >::IntegratorMCMiser().
|
private |
Definition at line 66 of file IntegratorMCMiser.h.
|
private |
Definition at line 65 of file IntegratorMCMiser.h.
|
private |
Definition at line 69 of file IntegratorMCMiser.h.
Referenced by IntegratorMCMiser< T >::IntegratorMCMiser().