SG++-Doxygen-Documentation
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
 
std::minstd_rand simple_rand
 

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 chess::dim, sgpp::base::Grid::getBoundingBox(), sgpp::base::Grid::getDimension(), sgpp::base::BoundingBox::getIntervalWidth(), grid, python.statsfileInfo::i, mcPaths, friedman::p, simple_rand, 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(), chess::dim, sgpp::base::Grid::getBoundingBox(), sgpp::base::Grid::getDimension(), sgpp::base::BoundingBox::getIntervalWidth(), grid, python.statsfileInfo::i, mcPaths, friedman::p, chess::point, sgpp::combigrid::pow(), simple_rand, and sgpp::base::BoundingBox::transformPointToBoundingBox().

Referenced by ~OperationQuadratureMC().

Member Data Documentation

sgpp::base::Grid* sgpp::base::OperationQuadratureMC::grid
protected

Referenced by python.learner.Learner.Learner::applyData(), python.uq.dists.SGDEdist.SGDEdist::cdf(), python.uq.learner.Interpolant.Interpolant::doLearningIteration(), python.learner.Learner.Learner::doLearningIteration(), doQuadrature(), doQuadratureFunc(), doQuadratureL2Error(), python.learner.Classifier.Classifier::evalError(), python.uq.learner.Interpolant.Interpolant::evalError(), python.controller.CheckpointController.CheckpointController::generateFoldValidationJob(), python.uq.learner.SimulationLearner.SimulationLearner::getGrid(), python.uq.learner.Regressor.Regressor::learnData(), python.learner.Learner.Learner::learnData(), python.uq.learner.Regressor.Regressor::learnDataWithFolding(), python.learner.Learner.Learner::learnDataWithFolding(), python.uq.learner.Regressor.Regressor::learnDataWithTest(), python.learner.Learner.Learner::learnDataWithTest(), python.controller.CheckpointController.CheckpointController::loadAll(), python.uq.operations.forcePositivity.operationMakePositive.OperationMakePositive::makePositive(), python.uq.operations.forcePositivity.operationMakePositiveFast.OperationMakePositiveFast::makePositive(), python.uq.dists.SGDEdist.SGDEdist::mean(), python.uq.dists.SGDEdist.SGDEdist::pdf(), python.uq.dists.SGDEdist.SGDEdist::ppf(), python.controller.CheckpointController.CheckpointController::setGrid(), python.uq.learner.Learner.Learner::setGrid(), python.learner.Learner.Learner::setGrid(), python.uq.operations.forcePositivity.localFullGridSearch.LocalFullGrid::split(), python.uq.dists.SGDEdist.SGDEdist::toJson(), and python.uq.dists.SGDEdist.SGDEdist::var().

size_t sgpp::base::OperationQuadratureMC::mcPaths
protected
std::minstd_rand sgpp::base::OperationQuadratureMC::simple_rand
protected

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