SG++-Doxygen-Documentation
|
Abstract class for doing an evaluation on a full grid, yielding a value of the template type V. More...
#include <AbstractFullGridEvaluator.hpp>
Public Member Functions | |
AbstractFullGridEvaluator (std::shared_ptr< AbstractCombigridStorage > storage, std::vector< std::shared_ptr< AbstractPointHierarchy >> pointHierarchies) | |
Constructor. More... | |
virtual V | eval (MultiIndex const &level)=0 |
Evaluates the function given through the storage for a certain level-multi-index (see class description). More... | |
virtual std::vector< base::DataVector > | getGridPoints (MultiIndex const &level) |
virtual std::vector< ThreadPool::Task > | getLevelTasks (MultiIndex const &level, ThreadPool::Task callback)=0 |
std::shared_ptr< AbstractCombigridStorage > | getStorage () |
virtual std::shared_ptr< TensorGrid > | getTensorGrid (MultiIndex const &level, std::vector< bool > orderingConfiguration) |
virtual size_t | maxNewPoints (MultiIndex const &level) |
virtual size_t | numPoints (MultiIndex const &level) |
virtual void | setMutex (std::shared_ptr< std::recursive_mutex > mutexPtr) |
Updates the current mutex. More... | |
virtual void | setParameters (std::vector< V > const ¶ms)=0 |
Sets the parameters for the evaluators. More... | |
virtual | ~AbstractFullGridEvaluator () |
Protected Attributes | |
std::shared_ptr< std::recursive_mutex > | mutexPtr |
Pointer to a mutex that is locked when doing critical operations on data. More... | |
std::vector< std::shared_ptr< AbstractPointHierarchy > > | pointHierarchies |
std::shared_ptr< AbstractCombigridStorage > | storage |
Provides access to the function values (stored or computed on demand) More... | |
Abstract class for doing an evaluation on a full grid, yielding a value of the template type V.
For this type, confer the comment in algebraic/FloatArrayVector.hpp This class is used inside CombigridEvaluator to do evaluations on different grids.
|
inline |
Constructor.
storage | Storage that stores and provides the function values for each grid point. |
pointHierarchies | PointHierarchy objects for each dimension providing the points for each level and information about their ordering. |
|
inlinevirtual |
|
pure virtual |
Evaluates the function given through the storage for a certain level-multi-index (see class description).
Implemented in sgpp::combigrid::FullGridGridBasedEvaluator< V >, and sgpp::combigrid::FullGridCallbackEvaluator< V >.
Referenced by python.uq.analysis.asgc.ASGCAnalysis.ASGCAnalysis::estimateDensity(), and sgpp::combigrid::AbstractFullGridEvaluator< V >::setMutex().
|
inlinevirtual |
References sgpp::combigrid::MultiIndexIterator::getMultiIndex(), sgpp::combigrid::MultiIndexIterator::isValid(), and sgpp::combigrid::MultiIndexIterator::moveToNext().
|
pure virtual |
level | the level which one wants to compute |
callback | This callback is called (with already locked mutex) from inside one of the returned tasks when all tasks for the given level are completed and the level can be added. |
Implemented in sgpp::combigrid::FullGridGridBasedEvaluator< V >, and sgpp::combigrid::FullGridCallbackEvaluator< V >.
Referenced by sgpp::combigrid::AbstractFullGridEvaluator< V >::setMutex().
|
inline |
References sgpp::combigrid::AbstractFullGridEvaluator< V >::setParameters(), and sgpp::combigrid::AbstractFullGridEvaluator< V >::storage.
|
inlinevirtual |
References level.
Referenced by sgpp::combigrid::FullGridGridBasedEvaluator< V >::eval(), and sgpp::combigrid::FullGridGridBasedEvaluator< V >::getLevelTasks().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Updates the current mutex.
If the mutex is set to nullptr, no mutex locking is done. Otherwise, the mutex is locked at critical actions.
References python.classifier::callback, sgpp::combigrid::AbstractFullGridEvaluator< V >::eval(), sgpp::combigrid::AbstractFullGridEvaluator< V >::getLevelTasks(), level, sgpp::combigrid::AbstractFullGridEvaluator< V >::mutexPtr, and python.utils.pca_normalize_dataset::V.
|
pure virtual |
Sets the parameters for the evaluators.
Each dimension in which the evaluator does not need a parameter is skipped. So if only the evaluators at dimensions 1 and 3 need a parameter, params.size() should be 2 (or at least 2)
Implemented in sgpp::combigrid::AbstractFullGridEvaluationStrategy< V >.
Referenced by sgpp::combigrid::AbstractFullGridEvaluator< V >::getStorage().
|
protected |
Pointer to a mutex that is locked when doing critical operations on data.
This is set to nullptr if the action is done in a single thread.
Referenced by sgpp::combigrid::FullGridCallbackEvaluator< V >::getLevelTasks(), sgpp::combigrid::FullGridGridBasedEvaluator< V >::getLevelTasks(), and sgpp::combigrid::AbstractFullGridEvaluator< V >::setMutex().
|
protected |
Referenced by sgpp::combigrid::AbstractFullGridEvaluationStrategy< V >::AbstractFullGridEvaluationStrategy(), sgpp::combigrid::FullGridGridBasedEvaluator< V >::addResults(), sgpp::combigrid::FullGridGridBasedEvaluator< V >::eval(), sgpp::combigrid::FullGridCallbackEvaluator< V >::getLevelTasks(), and sgpp::combigrid::FullGridGridBasedEvaluator< V >::getLevelTasks().
|
protected |
Provides access to the function values (stored or computed on demand)
Referenced by sgpp::combigrid::AbstractFullGridEvaluationStrategy< V >::AbstractFullGridEvaluationStrategy(), sgpp::combigrid::FullGridGridBasedEvaluator< V >::addResults(), sgpp::combigrid::FullGridCallbackEvaluator< V >::getLevelTasks(), and sgpp::combigrid::AbstractFullGridEvaluator< V >::getStorage().