SG++-Doxygen-Documentation

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

#include <OperationQuadratureMC.hpp>

## Public Member Functions

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

double doQuadratureFunc (FUNC func, void *clientdata)
Quadrature of an arbitrary function using simple 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 simple MC in $$\Omega=[0,1]^d$$. More...

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

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

Destructor. More...

## Protected Attributes

sgpp::base::Gridgrid

size_t mcPaths

std::minstd_rand simple_rand

## Detailed Description

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

## Constructor & Destructor Documentation

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

Parameters
 grid Reference to the grid object mcPaths Number of Monte Carlo samples
inlineoverride

## Member Function Documentation

overridevirtual

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

Parameters
 alpha Coefficient vector for current grid

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

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

 double sgpp::base::OperationQuadratureMC::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 simple 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