SG++-Doxygen-Documentation
sgpp::quadrature::OperationQuadratureMCAdvanced Class Reference

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

#include <OperationQuadratureMCAdvanced.hpp>

Inheritance diagram for sgpp::quadrature::OperationQuadratureMCAdvanced:
sgpp::base::OperationQuadrature

Public Member Functions

virtual double doQuadrature (sgpp::base::DataVector &alpha)
 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...
 
 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. More...
 
 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. More...
 
void useLatinHypercubeMonteCarlo ()
 Initialize SampleGenerator for LatinHypercubeMC. More...
 
void useNaiveMonteCarlo ()
 Initialize SampleGenerator for NaiveMC. More...
 
void useQuasiMonteCarloWithHaltonSequences ()
 Initialize SampleGenerator for HaltonSequenceGenerator. More...
 
void useQuasiMonteCarloWithScrambledSobolSequences ()
 Initialize SampleGenerator for ScrambledSobolSequenceGenerator. More...
 
void useQuasiMonteCarloWithSobolSequences ()
 Initialize SampleGenerator for SobolSequenceGenerator. More...
 
void useStratifiedMonteCarlo (std::vector< size_t > &n)
 Initialize SampleGenerator for StratifiedMC. More...
 
virtual ~OperationQuadratureMCAdvanced ()
 Descructor. More...
 
- Public Member Functions inherited from sgpp::base::OperationQuadrature
 OperationQuadrature ()
 Constructor. More...
 
virtual ~OperationQuadrature ()
 Destructor. More...
 

Protected Attributes

size_t dimensions
 
sgpp::base::Gridgrid
 
sgpp::quadrature::SampleGeneratormyGenerator
 
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

◆ OperationQuadratureMCAdvanced() [1/2]

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
gridReference to the grid object
numberOfSamplesNumber of Monte Carlo samples
seedCustom seed (defaults to default seed of mt19937_64)

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

◆ OperationQuadratureMCAdvanced() [2/2]

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
dimensionsdimensionality of this problem
numberOfSamplesNumber of Monte Carlo samples
seedCustom seed (defaults to default seed of mt19937_64)

References myGenerator.

◆ ~OperationQuadratureMCAdvanced()

sgpp::quadrature::OperationQuadratureMCAdvanced::~OperationQuadratureMCAdvanced ( )
virtual

Descructor.

References myGenerator.

Member Function Documentation

◆ doQuadrature()

double sgpp::quadrature::OperationQuadratureMCAdvanced::doQuadrature ( sgpp::base::DataVector alpha)
virtual

◆ doQuadratureFunc()

double sgpp::quadrature::OperationQuadratureMCAdvanced::doQuadratureFunc ( FUNC  func,
void *  clientdata 
)

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

Parameters
funcThe function to integrate
clientdataOptional data to pass to FUNC

References dimensions, sgpp::base::DataVector::getPointer(), sgpp::base::DataMatrix::getRow(), sgpp::quadrature::SampleGenerator::getSamples(), python.statsfileInfo::i, myGenerator, and numberOfSamples.

◆ doQuadratureL2Error()

double sgpp::quadrature::OperationQuadratureMCAdvanced::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\).

Parameters
funcThe function \(f(x)\)
clientdataOptional data to pass to FUNC
alphaCoefficient vector for current grid

References sgpp::op_factory::createOperationEval(), dimensions, sgpp::base::OperationEval::eval(), sgpp::base::DataMatrix::get(), sgpp::quadrature::SampleGenerator::getSamples(), grid, python.statsfileInfo::i, myGenerator, numberOfSamples, friedman::p, chess::point, and sgpp::combigrid::pow().

◆ getDimensions()

size_t sgpp::quadrature::OperationQuadratureMCAdvanced::getDimensions ( )

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.

◆ useLatinHypercubeMonteCarlo()

void sgpp::quadrature::OperationQuadratureMCAdvanced::useLatinHypercubeMonteCarlo ( )

Initialize SampleGenerator for LatinHypercubeMC.

References dimensions, myGenerator, numberOfSamples, and seed.

◆ useNaiveMonteCarlo()

void sgpp::quadrature::OperationQuadratureMCAdvanced::useNaiveMonteCarlo ( )

Initialize SampleGenerator for NaiveMC.

References dimensions, myGenerator, and seed.

◆ useQuasiMonteCarloWithHaltonSequences()

void sgpp::quadrature::OperationQuadratureMCAdvanced::useQuasiMonteCarloWithHaltonSequences ( )

Initialize SampleGenerator for HaltonSequenceGenerator.

References dimensions, and myGenerator.

◆ useQuasiMonteCarloWithScrambledSobolSequences()

void sgpp::quadrature::OperationQuadratureMCAdvanced::useQuasiMonteCarloWithScrambledSobolSequences ( )

Initialize SampleGenerator for ScrambledSobolSequenceGenerator.

◆ useQuasiMonteCarloWithSobolSequences()

void sgpp::quadrature::OperationQuadratureMCAdvanced::useQuasiMonteCarloWithSobolSequences ( )

Initialize SampleGenerator for SobolSequenceGenerator.

◆ useStratifiedMonteCarlo()

void sgpp::quadrature::OperationQuadratureMCAdvanced::useStratifiedMonteCarlo ( std::vector< size_t > &  n)

Initialize SampleGenerator for StratifiedMC.

Parameters
nArray of dimension proerties

References myGenerator, and seed.

Member Data Documentation

◆ dimensions

◆ grid

◆ myGenerator

◆ numberOfSamples

size_t sgpp::quadrature::OperationQuadratureMCAdvanced::numberOfSamples
protected

◆ seed

std::uint64_t sgpp::quadrature::OperationQuadratureMCAdvanced::seed
protected

The documentation for this class was generated from the following files: