SG++

Quadrature on any sparse grid (that has OperationMultipleEval implemented) using various Monte Carlo Methods (Advanced). More...

#include <OperationQuadratureMCAdvanced.hpp>

## Public Member Functions

Quadrature using advanced MC in $$\Omega=[0,1]^d$$. More...

double doQuadratureFunc (FUNC func, void *clientdata)
Quadrature of an arbitrary function using advanced MC in $$\Omega=[0,1]^d$$. More...

double doQuadratureL2Error (FUNC func, void *clientdata, sgpp::base::DataVector &alpha)
Quadrature of the $$L^2$$-norm of the error, $$||f(x)-u(x)||_{L^2}$$, between a given function and the current sparse grid function using advanced MC in $$\Omega=[0,1]^d$$. More...

size_t getDimensions ()
Method returns the total number of samples which can be generated according to the sample generator settings (dimensions and subdivision into strata) More...

Constructor of OperationQuadratureMCAdvanced, specifying a grid object and the number of samples to use. More...

Constructor of OperationQuadratureMCAdvanced, specifying dimensions and the number of samples to use. More...

void useLatinHypercubeMonteCarlo ()
Initialize SampleGenerator for LatinHypercubeMC. More...

void useNaiveMonteCarlo ()
Initialize SampleGenerator for NaiveMC. More...

void useQuasiMonteCarloWithHaltonSequences ()
Initialize SampleGenerator for HaltonSequenceGenerator. More...

void useStratifiedMonteCarlo (std::vector< size_t > &n)
Initialize SampleGenerator for StratifiedMC. More...

Descructor. More...

Public Member Functions inherited from sgpp::base::OperationQuadrature
Constructor. More...

Destructor. More...

## Protected Attributes

size_t dimensions

sgpp::base::Gridgrid

size_t numberOfSamples

std::uint64_t seed

## Detailed Description

Quadrature on any sparse grid (that has OperationMultipleEval implemented) using various Monte Carlo Methods (Advanced).

## Constructor & Destructor Documentation

 sgpp::quadrature::OperationQuadratureMCAdvanced::OperationQuadratureMCAdvanced ( sgpp::base::Grid & grid, size_t numberOfSamples, std::uint64_t seed = std::mt19937_64::default_seed )

Constructor of OperationQuadratureMCAdvanced, specifying a grid object and the number of samples to use.

Parameters
 grid Reference to the grid object numberOfSamples Number of Monte Carlo samples seed Custom seed (defaults to default seed of mt19937_64)

References dimensions, sgpp::base::Grid::getDimension(), and myGenerator.

 sgpp::quadrature::OperationQuadratureMCAdvanced::OperationQuadratureMCAdvanced ( size_t dimensions, size_t numberOfSamples, std::uint64_t seed = std::mt19937_64::default_seed )

Constructor of OperationQuadratureMCAdvanced, specifying dimensions and the number of samples to use.

Parameters
 dimensions dimensionality of this problem numberOfSamples Number of Monte Carlo samples seed Custom seed (defaults to default seed of mt19937_64)

References myGenerator.

virtual

Descructor.

References myGenerator.

## Member Function Documentation

virtual

Quadrature using advanced MC in $$\Omega=[0,1]^d$$.

Parameters
 alpha Coefficient vector for current grid

Quadrature of an arbitrary function using advanced MC in $$\Omega=[0,1]^d$$.

Parameters
 func The function to integrate clientdata Optional data to pass to FUNC

Quadrature of the $$L^2$$-norm of the error, $$||f(x)-u(x)||_{L^2}$$, between a given function and the current sparse grid function using advanced MC in $$\Omega=[0,1]^d$$.

Parameters
 func The function $$f(x)$$ clientdata Optional data to pass to FUNC alpha Coefficient vector for current grid

Method returns the total number of samples which can be generated according to the sample generator settings (dimensions and subdivision into strata)

Returns
size_t dimension of samples

References dimensions.

Initialize SampleGenerator for LatinHypercubeMC.

References dimensions, myGenerator, numberOfSamples, and seed.

Initialize SampleGenerator for NaiveMC.

References dimensions, myGenerator, and seed.

Initialize SampleGenerator for HaltonSequenceGenerator.

References dimensions, and myGenerator.

Initialize SampleGenerator for StratifiedMC.

Parameters
 n Array of dimension proerties

References myGenerator, and seed.