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

◆ OperationQuadratureMC()

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

◆ ~OperationQuadratureMC()

sgpp::base::OperationQuadratureMC::~OperationQuadratureMC ( )
inlineoverride

Member Function Documentation

◆ doQuadrature()

◆ doQuadratureFunc()

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().

◆ doQuadratureL2Error()

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

◆ grid

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

Referenced by python.uq.dists.SGDEdist.SGDEdist::__str__(), python.learner.Learner.Learner::applyData(), python.tools.Matrix::ApplyMatrix(), 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.tools.Matrix::generateb(), python.controller.CheckpointController.CheckpointController::generateFoldValidationJob(), python.uq.learner.SimulationLearner.SimulationLearner::getCollocationNodes(), python.uq.learner.SimulationLearner.SimulationLearner::getGrid(), python.uq.learner.SimulationLearner.SimulationLearner::getLearner(), 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.learner.Classifier.Classifier::refineGrid(), python.learner.Regressor.Regressor::refineGrid(), python.uq.learner.Regressor.Regressor::refineGrid(), python.uq.learner.SimulationLearner.SimulationLearner::refineGrid(), python.controller.CheckpointController.CheckpointController::saveGrid(), 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(), python.learner.Classifier.Classifier::updateResults(), python.learner.Regressor.Regressor::updateResults(), python.uq.learner.Regressor.Regressor::updateResults(), and python.uq.dists.SGDEdist.SGDEdist::var().

◆ mcPaths

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

◆ simple_rand

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

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