SG++-Doxygen-Documentation
|
This class enforces the function value range of a sparse grid function to be larger than 0. More...
#include <OperationMakePositive.hpp>
Public Types | |
typedef std::map< size_t, base::HashGridPoint > | gridPointCandidatesMap |
This class enforces the function value range of a sparse grid function to be larger than 0.
It uses a discretization based approach where we add the minimum amount of full grid points to enforce the positivity.
typedef std::map<size_t, base::HashGridPoint> sgpp::datadriven::OperationMakePositive::gridPointCandidatesMap |
|
explicit |
Constructor.
candidateSearchAlgorithm | defines how to generate the full grid candidate set |
interpolationAlgorithm | defines how to compute the coefficients for the new grid points |
generateConsistentGrid | define if the hierarchical ancestors of all new grid points are inserted as well |
verbose | print information or not |
f | scalar function to be interpolated |
|
virtual |
Descrutor.
std::vector< size_t > & sgpp::datadriven::OperationMakePositive::getAddedGridPoints | ( | ) |
std::vector< size_t > & sgpp::datadriven::OperationMakePositive::getAddedGridPointsForPositivity | ( | ) |
OperationMakePositiveCandidateSetAlgorithm & sgpp::datadriven::OperationMakePositive::getCandidateSetAlgorithm | ( | ) |
void sgpp::datadriven::OperationMakePositive::initialize | ( | base::Grid & | grid, |
base::DataVector & | alpha | ||
) |
initializes the operation
grid | Grid |
alpha | coefficients |
References sgpp::datadriven::FullGrid, sgpp::base::HashGridStorage::getDimension(), sgpp::base::HashGridStorage::getMaxLevel(), sgpp::base::Grid::getStorage(), python.utils.sg_projections::gridStorage, sgpp::datadriven::HybridFullIntersections, sgpp::datadriven::InterpolateBoundaries1d, sgpp::datadriven::InterpolateExp, sgpp::datadriven::InterpolateFunction, sgpp::datadriven::Intersections, sgpp::datadriven::IntersectionsJoin, and sgpp::datadriven::SetToZero.
Referenced by makePositive().
void sgpp::datadriven::OperationMakePositive::makeCurrentNodalValuesPositive | ( | base::Grid & | grid, |
base::DataVector & | alpha, | ||
double | tol = -1e-14 |
||
) |
Enforce the function values at each grid point to larger than the specified tolerance.
The ones which are not are set to zero. For this function we need the hierarchization and dechierarchization operations.
grid | grid |
alpha | coefficient vector |
tol | tolerance for negativity |
References alpha, sgpp::op_factory::createOperationEvalNaive(), sgpp::op_factory::createOperationHierarchisation(), sgpp::op_factory::createOperationMultipleEval(), python.statsfileInfo::data, sgpp::datadriven::DEFAULT, sgpp::base::HashGridStorage::getCoordinates(), sgpp::base::HashGridStorage::getDimension(), sgpp::base::HashGridStorage::getPoint(), sgpp::base::HashGridStorage::getSequenceNumber(), sgpp::base::HashGridStorage::getSize(), sgpp::base::DataVector::getSize(), sgpp::base::Grid::getStorage(), sgpp::base::Grid::getType(), grid(), python.utils.sg_projections::gridStorage, python.statsfileInfo::i, sgpp::base::HashGridStorage::insert(), sgpp::base::HashGridStorage::isContaining(), sgpp::base::Linear, numAddedGridPointsForPositivity(), sgpp::base::HashGridStorage::recalcLeafProperty(), sgpp::base::DataVector::resizeZero(), sgpp::base::DataMatrix::setRow(), and sgpp::datadriven::STREAMING.
Referenced by makePositive().
void sgpp::datadriven::OperationMakePositive::makePositive | ( | base::Grid & | grid, |
base::DataVector & | alpha, | ||
bool | forcePositiveNodalValues = false |
||
) |
Make the sparse grid function defined by grid and coefficient vector positive.
grid | Grid where the new grid is stored |
alpha | coefficient vector of new grid |
forcePositiveNodalValues | nodal values are forced to be non-negative or not |
References sgpp::base::Grid::getSize(), sgpp::base::Grid::getType(), initialize(), sgpp::base::Linear, sgpp::base::LinearBoundary, sgpp::base::LinearClenshawCurtis, sgpp::base::LinearClenshawCurtisBoundary, sgpp::base::LinearL0Boundary, sgpp::base::LinearTruncatedBoundary, makeCurrentNodalValuesPositive(), numAddedGridPoints(), and numAddedGridPointsForPositivity().
Referenced by sgpp::datadriven::SparseGridDensityEstimator::initialize().
size_t sgpp::datadriven::OperationMakePositive::numAddedGridPoints | ( | ) |
Referenced by makePositive().
size_t sgpp::datadriven::OperationMakePositive::numAddedGridPointsForPositivity | ( | ) |
Referenced by makeCurrentNodalValuesPositive(), and makePositive().
base::DataVector & sgpp::datadriven::OperationMakePositive::numAddedGridPointsForPositivityPerIteration | ( | ) |