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

Wrapper of SurplusRefinementFunctor for multi grid scenarios. More...

#include <MultiSurplusRefinementFunctor.hpp>

Inheritance diagram for sgpp::datadriven::MultiSurplusRefinementFunctor:
sgpp::datadriven::MultiGridRefinementFunctor sgpp::base::RefinementFunctor

Public Member Functions

size_t getNumGrids () override
 Returns the number of grids the functor can / does refine. More...
 
size_t getRefinementsNum () const override
 Returns the maximal number of points that should be refined. More...
 
double getRefinementThreshold () const override
 Returns the threshold for refinement. More...
 
 MultiSurplusRefinementFunctor (std::vector< base::Grid * > grids, std::vector< base::DataVector * > alphas, size_t refinements_num=1, bool level_penalize=false, double threshold=0.0)
 Constructor. More...
 
double operator() (base::GridStorage &storage, size_t seq) const override
 This should be returning a refinement value for every grid point. More...
 
void setGridIndex (size_t grid_index) override
 Sets the index (into the vector of grids) of the grid to be refined. More...
 
double start () const override
 Returns the lower bound of refinement criterion (e.g., alpha or error) (lower bound). More...
 
virtual ~MultiSurplusRefinementFunctor ()
 
- Public Member Functions inherited from sgpp::datadriven::MultiGridRefinementFunctor
virtual void preComputeEvaluations ()
 Used if expensive computations (eg. More...
 
virtual ~MultiGridRefinementFunctor ()
 
- Public Member Functions inherited from sgpp::base::RefinementFunctor
virtual double getTotalRefinementValue (GridStorage &storage) const
 Returns the total sum of local (error) indicators used for refinement. More...
 
 RefinementFunctor ()
 Constructor. More...
 
virtual ~RefinementFunctor ()
 Destructor. More...
 

Protected Attributes

std::vector< base::DataVector * > alphas
 
size_t current_grid_index
 
std::vector< base::Grid * > grids
 
bool level_penalize
 
std::vector< base::SurplusRefinementFunctorspFunctors
 One surplus refinement functor per grid. More...
 
std::vector< base::SurplusVolumeRefinementFunctorspvFunctors
 One volume refinement functor per grid. More...
 

Additional Inherited Members

- Public Types inherited from sgpp::base::RefinementFunctor
typedef double value_type
 

Detailed Description

Wrapper of SurplusRefinementFunctor for multi grid scenarios.

Constructor & Destructor Documentation

sgpp::datadriven::MultiSurplusRefinementFunctor::MultiSurplusRefinementFunctor ( std::vector< base::Grid * >  grids,
std::vector< base::DataVector * >  alphas,
size_t  refinements_num = 1,
bool  level_penalize = false,
double  threshold = 0.0 
)

Constructor.

Parameters
gridsVector of grids. current_grid_index specifies the grid to be refined
alphasVector of surpluses related to the grids
refinements_numMaximum number of refinements done
level_penalizeIf a level penalizing is multiplied to the score. Here, it determines whether surplus or volume refinement is used
thresholdThreshold for refinement scores

References alphas, grids, python.statsfileInfo::i, spFunctors, and spvFunctors.

virtual sgpp::datadriven::MultiSurplusRefinementFunctor::~MultiSurplusRefinementFunctor ( )
inlinevirtual

References getNumGrids(), and setGridIndex().

Member Function Documentation

size_t sgpp::datadriven::MultiSurplusRefinementFunctor::getNumGrids ( )
overridevirtual

Returns the number of grids the functor can / does refine.

Implements sgpp::datadriven::MultiGridRefinementFunctor.

References grids.

Referenced by ~MultiSurplusRefinementFunctor().

size_t sgpp::datadriven::MultiSurplusRefinementFunctor::getRefinementsNum ( ) const
overridevirtual

Returns the maximal number of points that should be refined.

The maximal number of points to refine is set in the constructor of the implementing class.

Returns
number of points that should refined. Default value: 1.

Reimplemented from sgpp::base::RefinementFunctor.

References current_grid_index, level_penalize, spFunctors, and spvFunctors.

double sgpp::datadriven::MultiSurplusRefinementFunctor::getRefinementThreshold ( ) const
overridevirtual

Returns the threshold for refinement.

Only the grid points with absolute value of refinement criterion (e.g., alpha or error) greater or equal to this threshold will be refined.

Returns
threshold value for refinement. Default value: 0.

Implements sgpp::base::RefinementFunctor.

References current_grid_index, level_penalize, spFunctors, and spvFunctors.

double sgpp::datadriven::MultiSurplusRefinementFunctor::operator() ( base::GridStorage storage,
size_t  seq 
) const
overridevirtual

This should be returning a refinement value for every grid point.

The point with the highest value will be refined first.

Parameters
storagereference to the grids storage object
seqsequence number in the coefficients array
Returns
refinement value

Implements sgpp::base::RefinementFunctor.

References current_grid_index, level_penalize, spFunctors, and spvFunctors.

void sgpp::datadriven::MultiSurplusRefinementFunctor::setGridIndex ( size_t  grid_index)
overridevirtual

Sets the index (into the vector of grids) of the grid to be refined.

Parameters
grid_indexThe index of the grid to be refined

Implements sgpp::datadriven::MultiGridRefinementFunctor.

References current_grid_index.

Referenced by ~MultiSurplusRefinementFunctor().

double sgpp::datadriven::MultiSurplusRefinementFunctor::start ( ) const
overridevirtual

Returns the lower bound of refinement criterion (e.g., alpha or error) (lower bound).

The refinement value of grid points to be refined have to be larger than this value

Returns
lower bound

Implements sgpp::base::RefinementFunctor.

References current_grid_index, level_penalize, spFunctors, and spvFunctors.

Member Data Documentation

std::vector<base::DataVector*> sgpp::datadriven::MultiSurplusRefinementFunctor::alphas
protected
size_t sgpp::datadriven::MultiSurplusRefinementFunctor::current_grid_index
protected
std::vector<base::Grid*> sgpp::datadriven::MultiSurplusRefinementFunctor::grids
protected
bool sgpp::datadriven::MultiSurplusRefinementFunctor::level_penalize
protected
std::vector<base::SurplusRefinementFunctor> sgpp::datadriven::MultiSurplusRefinementFunctor::spFunctors
protected

One surplus refinement functor per grid.

Referenced by getRefinementsNum(), getRefinementThreshold(), MultiSurplusRefinementFunctor(), operator()(), and start().

std::vector<base::SurplusVolumeRefinementFunctor> sgpp::datadriven::MultiSurplusRefinementFunctor::spvFunctors
protected

One volume refinement functor per grid.

Referenced by getRefinementsNum(), getRefinementThreshold(), MultiSurplusRefinementFunctor(), operator()(), and start().


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