SG++-Doxygen-Documentation
sgpp::combigrid::CombigridTensorOperation Class Reference

#include <CombigridTensorOperation.hpp>

Public Member Functions

 CombigridTensorOperation (std::vector< std::shared_ptr< AbstractPointHierarchy >> pointHierarchies, std::vector< std::shared_ptr< AbstractLinearEvaluator< FloatTensorVector >>> evaluatorPrototypes, std::shared_ptr< LevelManager > levelManager, MultiFunction func, bool exploitNesting=true, FullGridSummationStrategyType summationStrategyType=FullGridSummationStrategyType::LINEAR, std::shared_ptr< NormStrategy< FloatTensorVector >> normStrategy=nullptr)
 Constructs a CombigridTensorOperation with the given hierarchies, evaluators, level manager and function to evaluate. More...
 
 CombigridTensorOperation (std::vector< std::shared_ptr< AbstractPointHierarchy >> pointHierarchies, std::vector< std::shared_ptr< AbstractLinearEvaluator< FloatTensorVector >>> evaluatorPrototypes, std::shared_ptr< LevelManager > levelManager, std::shared_ptr< AbstractCombigridStorage > storage, FullGridSummationStrategyType summationStrategyType=FullGridSummationStrategyType::LINEAR, std::shared_ptr< NormStrategy< FloatTensorVector >> normStrategy=nullptr)
 Constructs a CombigridTensorOperation with the given hierarchies, evaluators, level manager and CombigridStorage that contains the function to evaluate. More...
 
 CombigridTensorOperation (std::vector< std::shared_ptr< AbstractPointHierarchy >> pointHierarchies, std::vector< std::shared_ptr< AbstractLinearEvaluator< FloatTensorVector >>> evaluatorPrototypes, std::shared_ptr< LevelManager > levelManager, GridFunction gridFunc, bool exploitNesting, FullGridSummationStrategyType summationStrategyType=FullGridSummationStrategyType::LINEAR, std::shared_ptr< NormStrategy< FloatTensorVector >> normStrategy=nullptr)
 Constructs a CombigridTensorOperation with the given hierarchies, evaluators, level manager and grid function together with the information whether the same point on different levels should be able to have different function values. More...
 
FloatTensorVector evaluate (size_t q, std::vector< FloatTensorVector > const &params=std::vector< FloatTensorVector >())
 Computes the result with regular levels up to 1-norm q (levels start from zero) and with parameter params. More...
 
std::shared_ptr< AbstractMultiStorage< FloatTensorVector > > getDifferences ()
 Returns a storage of the differences (Deltas) that have been computed by the CombigridEvaluator. More...
 
std::shared_ptr< LevelManagergetLevelManager ()
 Via the LevelManager, more options are available than are provided directly by this class. More...
 
std::vector< std::shared_ptr< AbstractPointHierarchy > > getPointHierarchies ()
 
FloatTensorVector getResult ()
 Returns the current computed value. More...
 
std::shared_ptr< AbstractCombigridStoragegetStorage ()
 
size_t getUpperPointBound () const
 
size_t numDims ()
 
size_t numGridPoints ()
 
size_t numStoredFunctionValues ()
 
void setLevelManager (std::shared_ptr< LevelManager > levelManager)
 Can be used to set the level manager, e.g. More...
 
void setParameters (std::vector< FloatTensorVector > const &params)
 Sets the parameters for upcoming computations and clears the data structures (removes old computed data). More...
 

Static Public Member Functions

static std::shared_ptr< CombigridTensorOperationcreateExpChebyshevPolynomialInterpolation (std::shared_ptr< AbstractInfiniteFunctionBasis1D > functionBasis, size_t numDimensions, MultiFunction func)
 Returns a CombigridTensorOperation doing polynomial interpolation on a Chebyshev grid with an exponential growth (nested points). More...
 
static std::shared_ptr< CombigridTensorOperationcreateExpClenshawCurtisPolynomialInterpolation (std::shared_ptr< AbstractInfiniteFunctionBasis1D > functionBasis, size_t numDimensions, MultiFunction func)
 Returns a CombigridTensorOperation doing polynomial interpolation on a Clenshaw-Curtis grid with an exponential growth (nested points). More...
 
static std::shared_ptr< CombigridTensorOperationcreateExpL2LejaPolynomialInterpolation (std::shared_ptr< AbstractInfiniteFunctionBasis1D > functionBasis, size_t numDimensions, MultiFunction func)
 Returns a CombigridTensorOperation doing polynomial interpolation on a L2Leja grid with an exponential growth (nested points). More...
 
static std::shared_ptr< CombigridTensorOperationcreateExpLejaPolynomialInterpolation (std::shared_ptr< AbstractInfiniteFunctionBasis1D > functionBasis, size_t numDimensions, MultiFunction func)
 Returns a CombigridTensorOperation doing polynomial interpolation on a Leja grid with an exponential growth (nested points). More...
 
static std::shared_ptr< CombigridTensorOperationcreateExpUniformBoundaryBSplineInterpolation (size_t numDimensions, MultiFunction func, size_t degree)
 
static std::shared_ptr< CombigridTensorOperationcreateLinearClenshawCurtisPolynomialInterpolation (std::shared_ptr< AbstractInfiniteFunctionBasis1D > functionBasis, size_t numDimensions, MultiFunction func)
 Returns a CombigridTensorOperation doing polynomial interpolation on a Clenshaw-Curtis grid with a linear growth (not nested points). More...
 
static std::shared_ptr< CombigridTensorOperationcreateLinearL2LejaPolynomialInterpolation (std::shared_ptr< AbstractInfiniteFunctionBasis1D > functionBasis, size_t numDimensions, MultiFunction func, size_t growthFactor=2)
 Returns a CombigridTensorOperation doing polynomial interpolation on a L2Leja grid with linear growth (nested points). More...
 
static std::shared_ptr< CombigridTensorOperationcreateLinearLejaPolynomialInterpolation (std::shared_ptr< AbstractInfiniteFunctionBasis1D > functionBasis, size_t numDimensions, MultiFunction func, size_t growthFactor=2)
 Returns a CombigridTensorOperation doing polynomial interpolation on a Leja grid with linear growth (nested points). More...
 
static std::shared_ptr< CombigridTensorOperationcreateOperationTensorBSplineInterpolation (std::vector< std::shared_ptr< AbstractPointHierarchy >> pointHierarchies, std::shared_ptr< AbstractCombigridStorage > storage, std::shared_ptr< LevelManager > levelManager, FullGridSummationStrategyType summationStrategyType=FullGridSummationStrategyType::LINEAR)
 Transforms the basic structures of an arbitrary operation to a tensor operation. More...
 
static std::shared_ptr< CombigridTensorOperationcreateOperationTensorPolynomialInterpolation (std::vector< std::shared_ptr< AbstractPointHierarchy >> pointHierarchies, std::shared_ptr< AbstractCombigridStorage > storage, std::shared_ptr< AbstractInfiniteFunctionBasis1D > functionBasis, FullGridSummationStrategyType summationStrategyType=FullGridSummationStrategyType::LINEAR)
 Transforms the basic structures of an arbitrary operation to a tensor operation. More...
 
static std::shared_ptr< CombigridTensorOperationcreateOperationTensorPolynomialInterpolation (std::vector< std::shared_ptr< AbstractPointHierarchy >> pointHierarchies, std::shared_ptr< AbstractCombigridStorage > storage, OrthogonalBasisFunctionsCollection &functionBases, FullGridSummationStrategyType summationStrategyType=FullGridSummationStrategyType::LINEAR)
 Transforms the basic structures of an arbitrary operation to a tensor operation. More...
 

Constructor & Destructor Documentation

◆ CombigridTensorOperation() [1/3]

sgpp::combigrid::CombigridTensorOperation::CombigridTensorOperation ( std::vector< std::shared_ptr< AbstractPointHierarchy >>  pointHierarchies,
std::vector< std::shared_ptr< AbstractLinearEvaluator< FloatTensorVector >>>  evaluatorPrototypes,
std::shared_ptr< LevelManager levelManager,
MultiFunction  func,
bool  exploitNesting = true,
FullGridSummationStrategyType  summationStrategyType = FullGridSummationStrategyType::LINEAR,
std::shared_ptr< NormStrategy< FloatTensorVector >>  normStrategy = nullptr 
)

Constructs a CombigridTensorOperation with the given hierarchies, evaluators, level manager and function to evaluate.

References sgpp::combigrid::CombigridTensorOperationImpl::levelManager, and sgpp::combigrid::CombigridTensorOperationImpl::pointHierarchies.

◆ CombigridTensorOperation() [2/3]

sgpp::combigrid::CombigridTensorOperation::CombigridTensorOperation ( std::vector< std::shared_ptr< AbstractPointHierarchy >>  pointHierarchies,
std::vector< std::shared_ptr< AbstractLinearEvaluator< FloatTensorVector >>>  evaluatorPrototypes,
std::shared_ptr< LevelManager levelManager,
std::shared_ptr< AbstractCombigridStorage storage,
FullGridSummationStrategyType  summationStrategyType = FullGridSummationStrategyType::LINEAR,
std::shared_ptr< NormStrategy< FloatTensorVector >>  normStrategy = nullptr 
)

Constructs a CombigridTensorOperation with the given hierarchies, evaluators, level manager and CombigridStorage that contains the function to evaluate.

References sgpp::combigrid::CombigridTensorOperationImpl::levelManager, sgpp::combigrid::CombigridTensorOperationImpl::pointHierarchies, and sgpp::combigrid::CombigridTensorOperationImpl::storage.

◆ CombigridTensorOperation() [3/3]

sgpp::combigrid::CombigridTensorOperation::CombigridTensorOperation ( std::vector< std::shared_ptr< AbstractPointHierarchy >>  pointHierarchies,
std::vector< std::shared_ptr< AbstractLinearEvaluator< FloatTensorVector >>>  evaluatorPrototypes,
std::shared_ptr< LevelManager levelManager,
GridFunction  gridFunc,
bool  exploitNesting,
FullGridSummationStrategyType  summationStrategyType = FullGridSummationStrategyType::LINEAR,
std::shared_ptr< NormStrategy< FloatTensorVector >>  normStrategy = nullptr 
)

Constructs a CombigridTensorOperation with the given hierarchies, evaluators, level manager and grid function together with the information whether the same point on different levels should be able to have different function values.

References sgpp::combigrid::CombigridTensorOperationImpl::levelManager, and sgpp::combigrid::CombigridTensorOperationImpl::pointHierarchies.

Member Function Documentation

◆ createExpChebyshevPolynomialInterpolation()

std::shared_ptr< CombigridTensorOperation > sgpp::combigrid::CombigridTensorOperation::createExpChebyshevPolynomialInterpolation ( std::shared_ptr< AbstractInfiniteFunctionBasis1D functionBasis,
size_t  numDimensions,
MultiFunction  func 
)
static

Returns a CombigridTensorOperation doing polynomial interpolation on a Chebyshev grid with an exponential growth (nested points).

Parameters
functionBasisglobal basis to which the result should be transformed
numDimensionsDimensionality of the problem.
funcFunction to be interpolated.

References sgpp::combigrid::CombiHierarchies::expChebyshev(), and sgpp::combigrid::CombiEvaluators::tensorInterpolation().

◆ createExpClenshawCurtisPolynomialInterpolation()

std::shared_ptr< CombigridTensorOperation > sgpp::combigrid::CombigridTensorOperation::createExpClenshawCurtisPolynomialInterpolation ( std::shared_ptr< AbstractInfiniteFunctionBasis1D functionBasis,
size_t  numDimensions,
MultiFunction  func 
)
static

Returns a CombigridTensorOperation doing polynomial interpolation on a Clenshaw-Curtis grid with an exponential growth (nested points).

Parameters
functionBasisglobal basis to which the result should be transformed
numDimensionsDimensionality of the problem.
funcFunction to be interpolated.

References sgpp::combigrid::CombiHierarchies::expClenshawCurtis(), and sgpp::combigrid::CombiEvaluators::tensorInterpolation().

◆ createExpL2LejaPolynomialInterpolation()

std::shared_ptr< CombigridTensorOperation > sgpp::combigrid::CombigridTensorOperation::createExpL2LejaPolynomialInterpolation ( std::shared_ptr< AbstractInfiniteFunctionBasis1D functionBasis,
size_t  numDimensions,
MultiFunction  func 
)
static

Returns a CombigridTensorOperation doing polynomial interpolation on a L2Leja grid with an exponential growth (nested points).

Parameters
functionBasisglobal basis to which the result should be transformed
numDimensionsDimensionality of the problem.
funcFunction to be interpolated.

References sgpp::combigrid::CombiHierarchies::expL2Leja(), and sgpp::combigrid::CombiEvaluators::tensorInterpolation().

◆ createExpLejaPolynomialInterpolation()

std::shared_ptr< CombigridTensorOperation > sgpp::combigrid::CombigridTensorOperation::createExpLejaPolynomialInterpolation ( std::shared_ptr< AbstractInfiniteFunctionBasis1D functionBasis,
size_t  numDimensions,
MultiFunction  func 
)
static

Returns a CombigridTensorOperation doing polynomial interpolation on a Leja grid with an exponential growth (nested points).

Parameters
functionBasisglobal basis to which the result should be transformed
numDimensionsDimensionality of the problem.
funcFunction to be interpolated.

References sgpp::combigrid::CombiHierarchies::expLeja(), and sgpp::combigrid::CombiEvaluators::tensorInterpolation().

◆ createExpUniformBoundaryBSplineInterpolation()

◆ createLinearClenshawCurtisPolynomialInterpolation()

std::shared_ptr< CombigridTensorOperation > sgpp::combigrid::CombigridTensorOperation::createLinearClenshawCurtisPolynomialInterpolation ( std::shared_ptr< AbstractInfiniteFunctionBasis1D functionBasis,
size_t  numDimensions,
MultiFunction  func 
)
static

Returns a CombigridTensorOperation doing polynomial interpolation on a Clenshaw-Curtis grid with a linear growth (not nested points).

Parameters
functionBasisglobal basis to which the result should be transformed
numDimensionsDimensionality of the problem.
funcFunction to be interpolated.

References sgpp::combigrid::CombiEvaluators::tensorInterpolation().

◆ createLinearL2LejaPolynomialInterpolation()

std::shared_ptr< CombigridTensorOperation > sgpp::combigrid::CombigridTensorOperation::createLinearL2LejaPolynomialInterpolation ( std::shared_ptr< AbstractInfiniteFunctionBasis1D functionBasis,
size_t  numDimensions,
MultiFunction  func,
size_t  growthFactor = 2 
)
static

Returns a CombigridTensorOperation doing polynomial interpolation on a L2Leja grid with linear growth (nested points).

Parameters
functionBasisglobal basis to which the result should be transformed
numDimensionsDimensionality of the problem.
funcFunction to be interpolated.
growthFactorParameter for the linear growth strategy. For level l, 1 + growthFactor * l points are used.

References sgpp::combigrid::CombiHierarchies::linearL2Leja(), and sgpp::combigrid::CombiEvaluators::tensorInterpolation().

◆ createLinearLejaPolynomialInterpolation()

std::shared_ptr< CombigridTensorOperation > sgpp::combigrid::CombigridTensorOperation::createLinearLejaPolynomialInterpolation ( std::shared_ptr< AbstractInfiniteFunctionBasis1D functionBasis,
size_t  numDimensions,
MultiFunction  func,
size_t  growthFactor = 2 
)
static

Returns a CombigridTensorOperation doing polynomial interpolation on a Leja grid with linear growth (nested points).

Parameters
functionBasisglobal basis to which the result should be transformed
numDimensionsDimensionality of the problem.
funcFunction to be interpolated.
growthFactorParameter for the linear growth strategy. For level l, 1 + growthFactor * l points are used.

References sgpp::combigrid::CombiHierarchies::linearLeja(), and sgpp::combigrid::CombiEvaluators::tensorInterpolation().

◆ createOperationTensorBSplineInterpolation()

std::shared_ptr< CombigridTensorOperation > sgpp::combigrid::CombigridTensorOperation::createOperationTensorBSplineInterpolation ( std::vector< std::shared_ptr< AbstractPointHierarchy >>  pointHierarchies,
std::shared_ptr< AbstractCombigridStorage storage,
std::shared_ptr< LevelManager levelManager,
FullGridSummationStrategyType  summationStrategyType = FullGridSummationStrategyType::LINEAR 
)
static

Transforms the basic structures of an arbitrary operation to a tensor operation.

Parameters
pointHierarchiesunivariate grids
storagefunction value storage
levelManagerprovides level structures that are copied to the new tensor operation
summationStrategyTypestrategy to gather the results of the univariate evaluators on
Returns
tensor operation with the same grid as given by the parameters

References python.statsfileInfo::i, sgpp::combigrid::CombigridTensorOperationImpl::pointHierarchies, and sgpp::combigrid::CombiEvaluators::tensorBSplineInterpolation().

◆ createOperationTensorPolynomialInterpolation() [1/2]

std::shared_ptr< CombigridTensorOperation > sgpp::combigrid::CombigridTensorOperation::createOperationTensorPolynomialInterpolation ( std::vector< std::shared_ptr< AbstractPointHierarchy >>  pointHierarchies,
std::shared_ptr< AbstractCombigridStorage storage,
std::shared_ptr< AbstractInfiniteFunctionBasis1D functionBasis,
FullGridSummationStrategyType  summationStrategyType = FullGridSummationStrategyType::LINEAR 
)
static

Transforms the basic structures of an arbitrary operation to a tensor operation.

Parameters
pointHierarchiesunivariate grids
storagefunction value storage
functionBasisglobal basis function to which the result should be transformed
summationStrategyTypestrategy to gather the results of the univariate evaluators on
Returns
tensor operation with the same grid as given by the parameters

References sgpp::combigrid::CombigridTensorOperationImpl::pointHierarchies, and sgpp::combigrid::CombiEvaluators::tensorInterpolation().

Referenced by sgpp::combigrid::PolynomialChaosExpansion::updateConfig(), and sgpp::combigrid::PolynomialStochasticCollocation::updateConfig().

◆ createOperationTensorPolynomialInterpolation() [2/2]

std::shared_ptr< CombigridTensorOperation > sgpp::combigrid::CombigridTensorOperation::createOperationTensorPolynomialInterpolation ( std::vector< std::shared_ptr< AbstractPointHierarchy >>  pointHierarchies,
std::shared_ptr< AbstractCombigridStorage storage,
OrthogonalBasisFunctionsCollection functionBases,
FullGridSummationStrategyType  summationStrategyType = FullGridSummationStrategyType::LINEAR 
)
static

Transforms the basic structures of an arbitrary operation to a tensor operation.

Parameters
pointHierarchiesunivariate grids
storagefunction value storage
functionBasesvector of global basis functions to which the result should be transformed
summationStrategyTypestrategy to gather the results of the univariate evaluators on
Returns
tensor operation with the same grid as given by the parameters

References python.statsfileInfo::i, sgpp::combigrid::CombigridTensorOperationImpl::pointHierarchies, sgpp::combigrid::OrthogonalBasisFunctionsCollection::size(), and sgpp::combigrid::CombiEvaluators::tensorInterpolation().

◆ evaluate()

FloatTensorVector sgpp::combigrid::CombigridTensorOperation::evaluate ( size_t  q,
std::vector< FloatTensorVector > const &  params = std::vector<FloatTensorVector>() 
)

Computes the result with regular levels up to 1-norm q (levels start from zero) and with parameter params.

This is a convenience function. If you need other functionality, use getLevelManager() and operate directly on the LevelManager.

◆ getDifferences()

std::shared_ptr< AbstractMultiStorage< FloatTensorVector > > sgpp::combigrid::CombigridTensorOperation::getDifferences ( )

Returns a storage of the differences (Deltas) that have been computed by the CombigridEvaluator.

◆ getLevelManager()

std::shared_ptr< LevelManager > sgpp::combigrid::CombigridTensorOperation::getLevelManager ( )

Via the LevelManager, more options are available than are provided directly by this class.

◆ getPointHierarchies()

std::vector< std::shared_ptr< AbstractPointHierarchy > > sgpp::combigrid::CombigridTensorOperation::getPointHierarchies ( )
Returns
the point hierarchies containing the grid points in each direction

◆ getResult()

FloatTensorVector sgpp::combigrid::CombigridTensorOperation::getResult ( )

Returns the current computed value.

Referenced by python.uq.uq_setting.UQSetting.UQSetting::getTimeDependentResults().

◆ getStorage()

std::shared_ptr< AbstractCombigridStorage > sgpp::combigrid::CombigridTensorOperation::getStorage ( )
Returns
the storage containing the computed function values at evaluation points.

◆ getUpperPointBound()

size_t sgpp::combigrid::CombigridTensorOperation::getUpperPointBound ( ) const
Returns
An upper bound for the number of points (function evaluations) used for the current computation. This bound is exact if nesting is used or if otherwise each grid point only occurs in exactly one level.

◆ numDims()

size_t sgpp::combigrid::CombigridTensorOperation::numDims ( )
Returns
the number of dimensions

◆ numGridPoints()

size_t sgpp::combigrid::CombigridTensorOperation::numGridPoints ( )
Returns
the total number of different (multi-dimensional) grid points that have been used for the current evaluation. This number is reset when clear() is called on the CombigridEvaluator via evaluate() or setParameters(). This method is currently not optimized and can be slow!

◆ numStoredFunctionValues()

size_t sgpp::combigrid::CombigridTensorOperation::numStoredFunctionValues ( )
Returns
the number of function values that have been computed via this CombigridTensorOperation during its lifetime. For a nested grid, this number matches numGridPoints() if only one computation is performed, i.e. no previous data has been cleared via evaluate() or setParameters(). Its computation is not optimized, but currently faster than numGridPoints().

◆ setLevelManager()

void sgpp::combigrid::CombigridTensorOperation::setLevelManager ( std::shared_ptr< LevelManager levelManager)

Can be used to set the level manager, e.g.

if one of the static constructor functions has been used.

References sgpp::combigrid::CombigridTensorOperationImpl::levelManager.

◆ setParameters()

void sgpp::combigrid::CombigridTensorOperation::setParameters ( std::vector< FloatTensorVector > const &  params)

Sets the parameters for upcoming computations and clears the data structures (removes old computed data).

This is only relevant for methods with parameters.

Parameters
paramsThe parameters at which the function should be evaluated.

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