SG++-Doxygen-Documentation
sgpp::datadriven::OperationMakePositive Class Reference

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::HashGridPointgridPointCandidatesMap
 

Public Member Functions

std::vector< size_t > & getAddedGridPoints ()
 
std::vector< size_t > & getAddedGridPointsForPositivity ()
 
OperationMakePositiveCandidateSetAlgorithmgetCandidateSetAlgorithm ()
 
void initialize (base::Grid &grid, base::DataVector &alpha)
 initializes the operation More...
 
void 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. More...
 
void makePositive (base::Grid &grid, base::DataVector &alpha, bool forcePositiveNodalValues=false)
 Make the sparse grid function defined by grid and coefficient vector positive. More...
 
size_t numAddedGridPoints ()
 
size_t numAddedGridPointsForPositivity ()
 
base::DataVectornumAddedGridPointsForPositivityPerIteration ()
 
 OperationMakePositive (MakePositiveCandidateSearchAlgorithm candidateSearchAlgorithm=MakePositiveCandidateSearchAlgorithm::IntersectionsJoin, MakePositiveInterpolationAlgorithm interpolationAlgorithm=MakePositiveInterpolationAlgorithm::SetToZero, bool generateConsistentGrid=true, bool verbose=false, sgpp::optimization::ScalarFunction *f=nullptr)
 Constructor. More...
 
virtual ~OperationMakePositive ()
 Descrutor. More...
 

Detailed Description

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.

Member Typedef Documentation

◆ gridPointCandidatesMap

Constructor & Destructor Documentation

◆ OperationMakePositive()

sgpp::datadriven::OperationMakePositive::OperationMakePositive ( MakePositiveCandidateSearchAlgorithm  candidateSearchAlgorithm = MakePositiveCandidateSearchAlgorithm::IntersectionsJoin,
MakePositiveInterpolationAlgorithm  interpolationAlgorithm = MakePositiveInterpolationAlgorithm::SetToZero,
bool  generateConsistentGrid = true,
bool  verbose = false,
sgpp::optimization::ScalarFunction f = nullptr 
)
explicit

Constructor.

Parameters
candidateSearchAlgorithmdefines how to generate the full grid candidate set
interpolationAlgorithmdefines how to compute the coefficients for the new grid points
generateConsistentGriddefine if the hierarchical ancestors of all new grid points are inserted as well
verboseprint information or not
fscalar function to be interpolated

◆ ~OperationMakePositive()

sgpp::datadriven::OperationMakePositive::~OperationMakePositive ( )
virtual

Descrutor.

Member Function Documentation

◆ getAddedGridPoints()

std::vector< size_t > & sgpp::datadriven::OperationMakePositive::getAddedGridPoints ( )
Returns
vector containing the indices of the added grid points

◆ getAddedGridPointsForPositivity()

std::vector< size_t > & sgpp::datadriven::OperationMakePositive::getAddedGridPointsForPositivity ( )
Returns
vector containing the indices which have just been added for positivity

◆ getCandidateSetAlgorithm()

OperationMakePositiveCandidateSetAlgorithm & sgpp::datadriven::OperationMakePositive::getCandidateSetAlgorithm ( )
Returns
candidate set algorithm

◆ initialize()

◆ makeCurrentNodalValuesPositive()

◆ 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.

Parameters
gridGrid where the new grid is stored
alphacoefficient vector of new grid
forcePositiveNodalValuesnodal 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().

◆ numAddedGridPoints()

size_t sgpp::datadriven::OperationMakePositive::numAddedGridPoints ( )
Returns
number of newly added grid points

Referenced by makePositive().

◆ numAddedGridPointsForPositivity()

size_t sgpp::datadriven::OperationMakePositive::numAddedGridPointsForPositivity ( )
Returns
number of newly added grid points for guaranteeing positivity

Referenced by makeCurrentNodalValuesPositive(), and makePositive().

◆ numAddedGridPointsForPositivityPerIteration()

base::DataVector & sgpp::datadriven::OperationMakePositive::numAddedGridPointsForPositivityPerIteration ( )
Returns
number of newly added grid points for guaranteeing positivity per iteration

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