SG++
sgpp::base::OperationQuadratureMC Class Reference

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

#include <OperationQuadratureMC.hpp>

Inheritance diagram for sgpp::base::OperationQuadratureMC:
sgpp::base::OperationQuadrature

Public Member Functions

double doQuadrature (sgpp::base::DataVector &alpha) override
 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...
 
 OperationQuadratureMC (sgpp::base::Grid &grid, int mcPaths)
 Constructor of OperationQuadratureMC, specifying a grid object and the number of samples to use. More...
 
 ~OperationQuadratureMC () override
 
- Public Member Functions inherited from sgpp::base::OperationQuadrature
 OperationQuadrature ()
 Constructor. More...
 
virtual ~OperationQuadrature ()
 Destructor. More...
 

Protected Attributes

sgpp::base::Gridgrid
 
size_t mcPaths
 

Detailed Description

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

Constructor & Destructor Documentation

sgpp::base::OperationQuadratureMC::OperationQuadratureMC ( sgpp::base::Grid grid,
int  mcPaths 
)

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

Parameters
gridReference to the grid object
mcPathsNumber of Monte Carlo samples
sgpp::base::OperationQuadratureMC::~OperationQuadratureMC ( )
inlineoverride

Member Function Documentation

double sgpp::base::OperationQuadratureMC::doQuadratureFunc ( FUNC  func,
void *  clientdata 
)

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

Parameters
funcThe function to integrate
clientdataOptional data to pass to FUNC

References sgpp::base::Grid::getBoundingBox(), sgpp::base::Grid::getDimension(), sgpp::base::BoundingBox::getIntervalWidth(), grid, mcPaths, and sgpp::base::BoundingBox::transformPointToBoundingBox().

Referenced by ~OperationQuadratureMC().

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
funcThe function \(f(x)\)
clientdataOptional data to pass to FUNC
alphaCoefficient vector for current grid

References sgpp::op_factory::createOperationEval(), sgpp::base::Grid::getBoundingBox(), sgpp::base::Grid::getDimension(), sgpp::base::BoundingBox::getIntervalWidth(), grid, mcPaths, sgpp::combigrid::pow(), and sgpp::base::BoundingBox::transformPointToBoundingBox().

Referenced by ~OperationQuadratureMC().

Member Data Documentation

size_t sgpp::base::OperationQuadratureMC::mcPaths
protected

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