SG++-Doxygen-Documentation
sgpp::combigrid::LevelManager Class Referenceabstract

This class provides functionality to conveniently add levels to a CombigridEvaluator. More...

#include <LevelManager.hpp>

Inheritance diagram for sgpp::combigrid::LevelManager:
sgpp::combigrid::AveragingLevelManager sgpp::combigrid::RegularLevelManager sgpp::combigrid::WeightedRatioLevelManager

Public Member Functions

void addLevel (MultiIndex const &level)
 Calls addLevel() on the underlying CombigridEvaluator. More...
 
virtual void addLevelsAdaptive (size_t maxNumPoints)
 Adds levels in an adaptive manner, such that the given maximum number of function evaluations (grid points) is not exceeded. More...
 
void addLevelsAdaptiveByNumLevels (size_t numLevels=1)
 Queue based addLevel-type function. More...
 
virtual void addLevelsAdaptiveParallel (size_t maxNumPoints, size_t numThreads)
 Does the same as addLevelsAdaptive(), but with parallel function evaluations. More...
 
void addLevelsFromSerializedStructure (std::string serializedStructure)
 Equivalent to deserializing serializedStructure and then calling addLevelsFromStructure(). More...
 
void addLevelsFromSerializedStructureParallel (std::string serializedStructure, size_t numThreads)
 Does the same as addLevelsFromSerializedStructure(), but with parallel precomputation of function values using numThreads threads. More...
 
void addLevelsFromStructure (std::shared_ptr< TreeStorage< uint8_t >> storage)
 Adds all levels for which an entry is contained in storage. More...
 
void addLevelsFromStructureParallel (std::shared_ptr< TreeStorage< uint8_t >> storage, size_t numThreads=4)
 Does the same as addLevelsFromStructure(), but with parallel precomputation of function values using numThreads threads. More...
 
void addRegularLevels (size_t q)
 
void addRegularLevelsByNumPoints (size_t maxNumPoints)
 Adds a set of level multi-indices. More...
 
void addRegularLevelsByNumPointsParallel (size_t maxNumPoints, size_t numThreads)
 Does the same as addRegularLevelsByNumPoints(), but with parallel precomputation of function values. More...
 
void addRegularLevelsParallel (size_t q, size_t numThreads)
 Does the same as addRegularLevels(), but with parallel precomputation of function values. More...
 
virtual std::shared_ptr< LevelManagerclone ()=0
 
sgpp::base::DataMatrix convertLevelStructureToMatrix (std::shared_ptr< sgpp::combigrid::TreeStorage< uint8_t >> const &levelstructure, size_t numDims)
 writes a given level structure to a matrix More...
 
void disableStatsCollection ()
 Disables the collection of information on subspaces during refinement. More...
 
void enableStatsCollection ()
 Enables the collection of information on subspaces during refinement. More...
 
std::vector< base::DataVectorgetAllGridPoints ()
 
base::DataMatrix getGridPointMatrix ()
 
std::shared_ptr< LevelInfosgetInfoOnAddedLevels ()
 Returns information on all the subspaces that is sorted with respect to the iterations when they have been added to the combigrid during refinement. More...
 
std::shared_ptr< TreeStorage< uint8_t > > getLevelStructure () const
 
std::vector< MultiIndexgetRegularLevels (size_t q)
 
std::string getSerializedLevelStructure () const
 
size_t getUpperPointBound () const
 
 LevelManager (std::shared_ptr< AbstractLevelEvaluator > levelEvaluator, bool collectStats=true)
 Constructor. More...
 
 LevelManager ()
 Default constructor. More...
 
size_t maxNumPointsForRegular (size_t q)
 
virtual size_t numDims () const
 
size_t numGridPoints ()
 
void printLevelStructure (std::shared_ptr< sgpp::combigrid::TreeStorage< uint8_t >> const &levelstructure)
 prints a given level structure More...
 
void setLevelEvaluator (std::shared_ptr< AbstractLevelEvaluator > levelEvaluator)
 Sets the level evaluator (normally a CombigridEvaluator). More...
 
virtual ~LevelManager ()
 

Protected Member Functions

void addLevels (std::vector< MultiIndex > const &levels)
 Adds all the given levels. More...
 
bool addLevelToCombiEval (const MultiIndex &level)
 Adds the level to the combigrid evaluator. More...
 
void addStats (const MultiIndex &level)
 update stats for levels that have been added in the current iteration More...
 
virtual void addToQueue (MultiIndex const &level, std::shared_ptr< LevelInfo > levelInfo)
 Puts the given level into the priority queue (uses computePriority() first to compute its priority). More...
 
virtual void afterComputation (MultiIndex const &level)
 This function should be called after all desired precomputations (i.e. More...
 
virtual void beforeComputation (MultiIndex const &level)
 This function should be called between getting a level from the top of the priority queue and starting computations on it. More...
 
virtual double computePriority (MultiIndex const &level)=0
 By implementing this method in a derived class, the adaption can be customized. More...
 
virtual std::vector< MultiIndexgetPredecessors (MultiIndex const &level)
 Helper function returning all predecessor level multi-indices. More...
 
std::vector< MultiIndexgetRegularLevelsByNumPoints (size_t maxNumPoints)
 
virtual std::vector< MultiIndexgetSuccessors (MultiIndex const &level)
 Helper function returning all successor level multi-indices. More...
 
virtual void initAdaption ()
 Initializes the data structures for adaptive level generation. More...
 
void precomputeLevelsParallel (std::vector< MultiIndex > const &levels, size_t numThreads)
 Does precomputations for all given levels in parallel with the specified number of threads. More...
 
virtual void predecessorsCompleted (MultiIndex const &level)
 This function is called after all desired precomputations (i.e. More...
 
virtual void tryAddLevel (MultiIndex const &level)
 Adds a level to levelData if all of its predecessors are already in levelData. More...
 
virtual void tryAddSuccessors (MultiIndex const &level)
 Adds successors of the given level to levelData if all of their other predecessors are also in levelData. More...
 
virtual void updatePriority (MultiIndex const &level, std::shared_ptr< LevelInfo > levelInfo)
 Updates the priority of a given level in the priority queue based on the currently available information. More...
 
void updateStats ()
 update statistics on added levels More...
 

Protected Attributes

bool collectStats
 Defines if statistics on the refinement process are collected or not. More...
 
std::shared_ptr< AbstractLevelEvaluatorcombiEval
 CombigridEvaluator (hidden behind an interface to avoid carrying around its template parameter here). More...
 
std::shared_ptr< LevelInfosinfoOnAddedLevels
 this object stores information on the levels during adaptive refinement More...
 
std::shared_ptr< TreeStorage< std::shared_ptr< LevelInfo > > > levelData
 Stores level information for already visited (!= computed) levels. More...
 
std::shared_ptr< std::recursive_mutex > managerMutex
 Mutex that is shared with all involved objects for evaluation parts that require mutual exclusion. More...
 
size_t numDimensions
 Dimensionality of the problem. More...
 
MultiIndexQueue queue
 Priority queue ranking levels that are not yet evaluated but ready for evaluation by their priority. More...
 

Detailed Description

This class provides functionality to conveniently add levels to a CombigridEvaluator.

It implements most of the functionality, however, the adaptive level generation strategy has to be specified by deriving from this class and overriding the protected method computePriority().

Via any LevelManager subclass, one can add levels adaptively or with a regular structure (bounded 1-norm) to a CombigridEvaluator, and one can even choose to use multiple threads to precompute the function values. Note that the parallelization only concerns the function evaluations and not the other calculations. Thus, if your function can be computed in a very short amount of time (for example (x, y) |-> exp(x) * sin(y)), the parallel evaluation might be slower than the normal evaluation. Of course, if you choose to use parallel evaluation, you have to ensure that your function supports multiple calls in parallel.

The parallel evaluation functionality is designed to use all available computing power. In particular, parallel adaptive level generation may also start computing levels before their predecessors are finished, even though value of the level cannot be estimated as precisely as if the predecessors were finished.

Constructor & Destructor Documentation

◆ LevelManager() [1/2]

sgpp::combigrid::LevelManager::LevelManager ( std::shared_ptr< AbstractLevelEvaluator levelEvaluator,
bool  collectStats = true 
)
explicit

Constructor.

The CombigridEvaluator (or another derived class of AbstractLevelEvaluator) has to be passed.

Parameters
levelEvaluatorcombigrid evaluator
collectStatssets if the collection of statistics should be enabled or not during refinement

References infoOnAddedLevels, levelData, managerMutex, and numDimensions.

◆ LevelManager() [2/2]

sgpp::combigrid::LevelManager::LevelManager ( )

Default constructor.

If this is used, setLevelEvaluator() has to be called before adding any levels.

References infoOnAddedLevels, levelData, managerMutex, and numDimensions.

◆ ~LevelManager()

sgpp::combigrid::LevelManager::~LevelManager ( )
virtual

Member Function Documentation

◆ addLevel()

void sgpp::combigrid::LevelManager::addLevel ( MultiIndex const &  level)
inline

◆ addLevels()

void sgpp::combigrid::LevelManager::addLevels ( std::vector< MultiIndex > const &  levels)
protected

◆ addLevelsAdaptive()

void sgpp::combigrid::LevelManager::addLevelsAdaptive ( size_t  maxNumPoints)
virtual

Adds levels in an adaptive manner, such that the given maximum number of function evaluations (grid points) is not exceeded.

The adaption strategy depends on the particular implementation of the priority function provided by the subclass of LevelManager.

All functions with a point bound here generate levels until that point bound would be exceeded. None of the functions attempts to add levels with few points to reach the point bound as close as possible!

References afterComputation(), beforeComputation(), sgpp::combigrid::BinaryHeap< T, Comparator >::empty(), infoOnAddedLevels, initAdaption(), sgpp::combigrid::QueueEntry::level, sgpp::combigrid::QueueEntry::maxNewPoints, sgpp::combigrid::BinaryHeap< T, Comparator >::pop(), queue, and sgpp::combigrid::BinaryHeap< T, Comparator >::top().

◆ addLevelsAdaptiveByNumLevels()

void sgpp::combigrid::LevelManager::addLevelsAdaptiveByNumLevels ( size_t  numLevels = 1)

◆ addLevelsAdaptiveParallel()

◆ addLevelsFromSerializedStructure()

void sgpp::combigrid::LevelManager::addLevelsFromSerializedStructure ( std::string  serializedStructure)

Equivalent to deserializing serializedStructure and then calling addLevelsFromStructure().

"Inverse" operation to getSerializedLevelStructure().

References addLevelsFromStructure(), and numDimensions.

◆ addLevelsFromSerializedStructureParallel()

void sgpp::combigrid::LevelManager::addLevelsFromSerializedStructureParallel ( std::string  serializedStructure,
size_t  numThreads 
)

Does the same as addLevelsFromSerializedStructure(), but with parallel precomputation of function values using numThreads threads.

References addLevelsFromStructureParallel(), and numDimensions.

◆ addLevelsFromStructure()

void sgpp::combigrid::LevelManager::addLevelsFromStructure ( std::shared_ptr< TreeStorage< uint8_t >>  storage)

Adds all levels for which an entry is contained in storage.

"Inverse" operation to getLevelStructure().

References addLevelToCombiEval(), and infoOnAddedLevels.

Referenced by addLevelsFromSerializedStructure().

◆ addLevelsFromStructureParallel()

void sgpp::combigrid::LevelManager::addLevelsFromStructureParallel ( std::shared_ptr< TreeStorage< uint8_t >>  storage,
size_t  numThreads = 4 
)

Does the same as addLevelsFromStructure(), but with parallel precomputation of function values using numThreads threads.

References addLevels(), infoOnAddedLevels, and precomputeLevelsParallel().

Referenced by addLevelsFromSerializedStructureParallel().

◆ addLevelToCombiEval()

bool sgpp::combigrid::LevelManager::addLevelToCombiEval ( const MultiIndex level)
protected

Adds the level to the combigrid evaluator.

Parameters
levellevel

References addStats(), collectStats, combiEval, and python.uq.operations.sparse_grid::isValid().

Referenced by addLevel(), addLevels(), addLevelsFromStructure(), and predecessorsCompleted().

◆ addRegularLevels()

void sgpp::combigrid::LevelManager::addRegularLevels ( size_t  q)
Parameters
qMaximum 1-norm of the level-multi-index, where the levels start from 0 (not from 1 as in most papers). If you have a norm w with levels starting from 1, simply use q = w - numDim().

References addLevels(), getRegularLevels(), and infoOnAddedLevels.

◆ addRegularLevelsByNumPoints()

void sgpp::combigrid::LevelManager::addRegularLevelsByNumPoints ( size_t  maxNumPoints)

Adds a set of level multi-indices.

The levels are enumerated with increasing 1-norm until the total number of necessary function evaluations would exceed the given limit maxNumPoints. Levels which are already computed are not counted in the number of points, so if many levels have already been computed, the counting starts from their successors. For example, this might add the levels (0, 0), (1, 0), (0, 1), (2, 0), (1, 1) and omit the level (0, 2) because that would mean more function evaluations than specified.

All functions with a point bound here generate levels until that point bound would be exceeded. None of the functions attempts to add levels with few points to reach the point bound as close as possible!

References addLevels(), getRegularLevelsByNumPoints(), and infoOnAddedLevels.

◆ addRegularLevelsByNumPointsParallel()

void sgpp::combigrid::LevelManager::addRegularLevelsByNumPointsParallel ( size_t  maxNumPoints,
size_t  numThreads 
)

Does the same as addRegularLevelsByNumPoints(), but with parallel precomputation of function values.

References addLevels(), getRegularLevelsByNumPoints(), infoOnAddedLevels, and precomputeLevelsParallel().

◆ addRegularLevelsParallel()

void sgpp::combigrid::LevelManager::addRegularLevelsParallel ( size_t  q,
size_t  numThreads 
)

Does the same as addRegularLevels(), but with parallel precomputation of function values.

Parameters
qMaximum 1-norm of the level-multi-index, where the levels start from 0 (not from 1 as in most papers).
numThreadsnumber of threads that should be used for computation If you have a norm w with levels starting from 1, simply use q = w - numDims().

References addLevels(), getRegularLevels(), infoOnAddedLevels, and precomputeLevelsParallel().

◆ addStats()

void sgpp::combigrid::LevelManager::addStats ( const MultiIndex level)
protected

update stats for levels that have been added in the current iteration

Parameters
levellevel to be added to the stats

References combiEval, and infoOnAddedLevels.

Referenced by addLevelToCombiEval().

◆ addToQueue()

void sgpp::combigrid::LevelManager::addToQueue ( MultiIndex const &  level,
std::shared_ptr< LevelInfo levelInfo 
)
protectedvirtual

Puts the given level into the priority queue (uses computePriority() first to compute its priority).

References combiEval, computePriority(), sgpp::combigrid::BinaryHeap< T, Comparator >::push(), and queue.

Referenced by beforeComputation(), and tryAddLevel().

◆ afterComputation()

void sgpp::combigrid::LevelManager::afterComputation ( MultiIndex const &  level)
protectedvirtual

This function should be called after all desired precomputations (i.e.

none in the single-threaded setting) for a level are done. It adjusts the statuses of this level and its successors. Furthermore, it triggers calling addLevel() (via predecessorsCompleted()) if all predecessor levels have already been added. If this is not the case, then the level will be added via predecessorsCompleted() when the last missing predecessor completes.

References levelData, predecessorsCompleted(), and sgpp::combigrid::TERMINATED.

Referenced by addLevelsAdaptive(), and addLevelsAdaptiveByNumLevels().

◆ beforeComputation()

void sgpp::combigrid::LevelManager::beforeComputation ( MultiIndex const &  level)
protectedvirtual

This function should be called between getting a level from the top of the priority queue and starting computations on it.

This function adapts the status of the level and its successors accordingly.

References addToQueue(), getSuccessors(), levelData, sgpp::combigrid::STARTED, and tryAddLevel().

Referenced by addLevelsAdaptive(), addLevelsAdaptiveByNumLevels(), and addLevelsAdaptiveParallel().

◆ clone()

virtual std::shared_ptr<LevelManager> sgpp::combigrid::LevelManager::clone ( )
pure virtual

◆ computePriority()

virtual double sgpp::combigrid::LevelManager::computePriority ( MultiIndex const &  level)
protectedpure virtual

By implementing this method in a derived class, the adaption can be customized.

It should yield a priority for the given level. Levels with higher priority value are added earlier.

Implemented in sgpp::combigrid::WeightedRatioLevelManager, and sgpp::combigrid::AveragingLevelManager.

Referenced by addToQueue(), predecessorsCompleted(), and updatePriority().

◆ convertLevelStructureToMatrix()

sgpp::base::DataMatrix sgpp::combigrid::LevelManager::convertLevelStructureToMatrix ( std::shared_ptr< sgpp::combigrid::TreeStorage< uint8_t >> const &  levelstructure,
size_t  numDims 
)

writes a given level structure to a matrix

Parameters
levelstructurethe level structure
numDimsnumber of dimensions
Returns
matrix containing the level stucture

References sgpp::base::DataMatrix::appendRow(), and python.statsfileInfo::i.

Referenced by addLevel().

◆ disableStatsCollection()

void sgpp::combigrid::LevelManager::disableStatsCollection ( )

Disables the collection of information on subspaces during refinement.

References collectStats.

Referenced by getUpperPointBound().

◆ enableStatsCollection()

void sgpp::combigrid::LevelManager::enableStatsCollection ( )

Enables the collection of information on subspaces during refinement.

References collectStats.

Referenced by getUpperPointBound().

◆ getAllGridPoints()

std::vector<base::DataVector> sgpp::combigrid::LevelManager::getAllGridPoints ( )
inline
Returns
a vector with all grid points where the function has been evaluated (without duplicates).

◆ getGridPointMatrix()

base::DataMatrix sgpp::combigrid::LevelManager::getGridPointMatrix ( )
inline
Returns
a DataMatrix with all grid points where the function has been evaluated in its columns (without duplicates)

◆ getInfoOnAddedLevels()

std::shared_ptr< LevelInfos > sgpp::combigrid::LevelManager::getInfoOnAddedLevels ( )

Returns information on all the subspaces that is sorted with respect to the iterations when they have been added to the combigrid during refinement.

NOTE: collectStats needs to be set in order to obtain useful information.

Returns
the infos on the adaptive refinement steps

References infoOnAddedLevels.

Referenced by getUpperPointBound().

◆ getLevelStructure()

std::shared_ptr< TreeStorage< uint8_t > > sgpp::combigrid::LevelManager::getLevelStructure ( ) const
Returns
a TreeStorage which contains an entry at an index i iff the level i has been added to this CombigridEvaluator.

References combiEval.

Referenced by getSerializedLevelStructure(), and initAdaption().

◆ getPredecessors()

std::vector< MultiIndex > sgpp::combigrid::LevelManager::getPredecessors ( MultiIndex const &  level)
protectedvirtual

Helper function returning all predecessor level multi-indices.

Example: For level = (1, 0, 2), it would return (0, 0, 2) and (1, 0, 1).

References level, and numDimensions.

Referenced by sgpp::combigrid::AveragingLevelManager::computePriority(), sgpp::combigrid::WeightedRatioLevelManager::computePriority(), and tryAddLevel().

◆ getRegularLevels()

std::vector< MultiIndex > sgpp::combigrid::LevelManager::getRegularLevels ( size_t  q)
Parameters
qMaximum 1-norm of the level-multi-index, where the levels start from 0 (not from 1 as in most papers). If you have a norm w with levels starting from 1, simply use q = w - numDims().

References sgpp::combigrid::BoundedSumMultiIndexIterator::isValid(), sgpp::combigrid::BoundedSumMultiIndexIterator::moveToNext(), numDimensions, and sgpp::combigrid::BoundedSumMultiIndexIterator::value().

Referenced by addRegularLevels(), and addRegularLevelsParallel().

◆ getRegularLevelsByNumPoints()

std::vector< MultiIndex > sgpp::combigrid::LevelManager::getRegularLevelsByNumPoints ( size_t  maxNumPoints)
protected
Returns
a set of level multi-indices. The levels are enumerated with increasing 1-norm until the total number of necessary function evaluations would exceed the given limit maxNumPoints. For example, this might return the levels (0, 0), (1, 0), (0, 1), (2, 0), (1, 1) and omit the level (0, 2) because that would mean more function evaluations than specified.

All functions with a point bound here generate levels until that point bound would be exceeded. None of the functions attempts to add levels with few points to reach the point bound as close as possible!

References combiEval, sgpp::combigrid::BoundedSumMultiIndexIterator::isValid(), sgpp::combigrid::BoundedSumMultiIndexIterator::moveToNext(), numDimensions, and sgpp::combigrid::BoundedSumMultiIndexIterator::value().

Referenced by addRegularLevelsByNumPoints(), and addRegularLevelsByNumPointsParallel().

◆ getSerializedLevelStructure()

std::string sgpp::combigrid::LevelManager::getSerializedLevelStructure ( ) const
Returns
the serialized version of getLevelStructure()

References getLevelStructure(), and numDimensions.

◆ getSuccessors()

std::vector< MultiIndex > sgpp::combigrid::LevelManager::getSuccessors ( MultiIndex const &  level)
protectedvirtual

Helper function returning all successor level multi-indices.

Example: For level = (1, 0, 2), it would return (2, 0, 2), (1, 1, 2) and (1, 0, 3).

References chess::dim, level, and numDimensions.

Referenced by beforeComputation(), predecessorsCompleted(), and tryAddSuccessors().

◆ getUpperPointBound()

size_t sgpp::combigrid::LevelManager::getUpperPointBound ( ) const
inline
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.

References disableStatsCollection(), enableStatsCollection(), and getInfoOnAddedLevels().

◆ initAdaption()

void sgpp::combigrid::LevelManager::initAdaption ( )
protectedvirtual

◆ maxNumPointsForRegular()

size_t sgpp::combigrid::LevelManager::maxNumPointsForRegular ( size_t  q)
inline
Returns
the maximum number of grid points that have to be evaluated for a regular grid with maximum multi-index L1 norm of q. For nested grids, this estimate should be exact.

◆ numDims()

size_t sgpp::combigrid::LevelManager::numDims ( ) const
virtual
Returns
the dimensionality of the problem.

References numDimensions.

Referenced by addLevel().

◆ numGridPoints()

size_t sgpp::combigrid::LevelManager::numGridPoints ( )
inline
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. This method is currently not optimized and can be slow!

◆ precomputeLevelsParallel()

void sgpp::combigrid::LevelManager::precomputeLevelsParallel ( std::vector< MultiIndex > const &  levels,
size_t  numThreads 
)
protected

Does precomputations for all given levels in parallel with the specified number of threads.

This can only be used if the level structure is known beforehand, e. g. for regular level structures.

References combiEval, level, managerMutex, and sgpp::combigrid::ThreadPool::terminateWhenIdle.

Referenced by addLevelsFromStructureParallel(), addRegularLevelsByNumPointsParallel(), and addRegularLevelsParallel().

◆ predecessorsCompleted()

void sgpp::combigrid::LevelManager::predecessorsCompleted ( MultiIndex const &  level)
protectedvirtual

This function is called after all desired precomputations (i.e.

none in the single-threaded setting) are done AND all the predecessor levels have been added. It calls addLevel() for the given level, adjusts the status in levelData and calls predecessorsCompleted() on the successors if their precomputations are already done. If the precomputations are not done yet, it adjusts their priority using updatePriority() because there is now more information available.

References addLevelToCombiEval(), combiEval, sgpp::combigrid::COMPLETED, computePriority(), getSuccessors(), levelData, sgpp::combigrid::TERMINATED, and updatePriority().

Referenced by afterComputation().

◆ printLevelStructure()

void sgpp::combigrid::LevelManager::printLevelStructure ( std::shared_ptr< sgpp::combigrid::TreeStorage< uint8_t >> const &  levelstructure)

prints a given level structure

Parameters
levelstructurethe level stucture

References python.statsfileInfo::i.

Referenced by addLevel().

◆ setLevelEvaluator()

void sgpp::combigrid::LevelManager::setLevelEvaluator ( std::shared_ptr< AbstractLevelEvaluator levelEvaluator)

Sets the level evaluator (normally a CombigridEvaluator).

References combiEval, and numDimensions.

◆ tryAddLevel()

void sgpp::combigrid::LevelManager::tryAddLevel ( MultiIndex const &  level)
protectedvirtual

Adds a level to levelData if all of its predecessors are already in levelData.

References addToQueue(), combiEval, sgpp::combigrid::COMPLETED, getPredecessors(), levelData, sgpp::combigrid::STARTED, and sgpp::combigrid::TERMINATED.

Referenced by beforeComputation(), initAdaption(), and tryAddSuccessors().

◆ tryAddSuccessors()

void sgpp::combigrid::LevelManager::tryAddSuccessors ( MultiIndex const &  level)
protectedvirtual

Adds successors of the given level to levelData if all of their other predecessors are also in levelData.

References getSuccessors(), and tryAddLevel().

Referenced by initAdaption().

◆ updatePriority()

void sgpp::combigrid::LevelManager::updatePriority ( MultiIndex const &  level,
std::shared_ptr< LevelInfo levelInfo 
)
protectedvirtual

Updates the priority of a given level in the priority queue based on the currently available information.

References computePriority(), and queue.

Referenced by predecessorsCompleted().

◆ updateStats()

void sgpp::combigrid::LevelManager::updateStats ( )
protected

update statistics on added levels

Member Data Documentation

◆ collectStats

bool sgpp::combigrid::LevelManager::collectStats
protected

Defines if statistics on the refinement process are collected or not.

Referenced by addLevelToCombiEval(), disableStatsCollection(), and enableStatsCollection().

◆ combiEval

std::shared_ptr<AbstractLevelEvaluator> sgpp::combigrid::LevelManager::combiEval
protected

◆ infoOnAddedLevels

◆ levelData

std::shared_ptr<TreeStorage<std::shared_ptr<LevelInfo> > > sgpp::combigrid::LevelManager::levelData
protected

◆ managerMutex

std::shared_ptr<std::recursive_mutex> sgpp::combigrid::LevelManager::managerMutex
protected

Mutex that is shared with all involved objects for evaluation parts that require mutual exclusion.

Referenced by addLevelsAdaptiveParallel(), LevelManager(), and precomputeLevelsParallel().

◆ numDimensions

◆ queue

MultiIndexQueue sgpp::combigrid::LevelManager::queue
protected

Priority queue ranking levels that are not yet evaluated but ready for evaluation by their priority.

Referenced by addLevelsAdaptive(), addLevelsAdaptiveByNumLevels(), addLevelsAdaptiveParallel(), addToQueue(), initAdaption(), and updatePriority().


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