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

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.

## Constructor & Destructor Documentation

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

## Member Function Documentation

Returns
vector containing the indices of the added grid points
Returns
vector containing the indices which have just been added for positivity
Returns
candidate set algorithm
 void sgpp::datadriven::OperationMakePositive::initialize ( base::Grid & grid, base::DataVector & alpha )

initializes the operation

Parameters
 grid Grid alpha coefficients

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.

Parameters
 grid grid alpha coefficient vector tol tolerance for negativity

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.

Parameters
 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
Returns
number of newly added grid points

Referenced by makePositive().

Returns
number of newly added grid points for guaranteeing positivity

Referenced by makeCurrentNodalValuesPositive(), and makePositive().

Returns
number of newly added grid points for guaranteeing positivity per iteration

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