queso-0.57.0
|
Numerical integration using Monte Carlo. More...
#include <MonteCarloQuadrature.h>
Public Member Functions | |
MonteCarloQuadrature (const VectorSubset< V, M > &domain, unsigned int n_samples) | |
virtual | ~MonteCarloQuadrature () |
![]() | |
MultiDQuadratureBase (const VectorSubset< V, M > &domain) | |
virtual | ~MultiDQuadratureBase ()=0 |
Pure virtual destructor, forcing this to be an abstract object. More... | |
const std::vector< typename QUESO::SharedPtr< V >::Type > & | positions () const |
const VectorSubset< V, M > & | getDomain () const |
![]() | |
BaseQuadrature () | |
virtual | ~BaseQuadrature ()=0 |
Pure virtual destructor, forcing this to be an abstract object. More... | |
const std::vector< double > & | weights () const |
Array of the weights used in the numerical integration. More... | |
Additional Inherited Members | |
![]() | |
std::vector< typename QUESO::SharedPtr< V >::Type > | m_positions |
Locations of quadrature points. More... | |
const VectorSubset< V, M > & | m_domain |
Domain over which the quadrature will be performed. More... | |
![]() | |
std::vector< double > | m_weights |
Numerical integration using Monte Carlo.
Monte Carlo integration approximates an integral by randomly sampling the function. Namely, if is the average, then
where is the number of samples. This class, then, uniformly samples over the user-specified domain for the given number of samples. Then, to adhere to the quadrature interface, the positions are accessible in the positions vector and the factor
is cached in the weights vector.
Definition at line 47 of file MonteCarloQuadrature.h.
QUESO::MonteCarloQuadrature< V, M >::MonteCarloQuadrature | ( | const VectorSubset< V, M > & | domain, |
unsigned int | n_samples | ||
) |
Definition at line 33 of file MonteCarloQuadrature.C.
References QUESO::MultiDQuadratureBase< V, M >::m_domain, QUESO::MultiDQuadratureBase< V, M >::m_positions, QUESO::BaseQuadrature::m_weights, QUESO::BaseVectorRealizer< V, M >::realization(), QUESO::BaseVectorRV< V, M >::realizer(), QUESO::VectorSubset< V, M >::vectorSpace(), and QUESO::VectorSet< V, M >::volume().
|
inlinevirtual |
Definition at line 54 of file MonteCarloQuadrature.h.