SG++
sgpp::combigrid::AbstractFullGridEvaluator< V > Class Template Referenceabstract

Abstract class for doing an evaluation on a full grid, yielding a value of the template type V. More...

#include <AbstractFullGridEvaluator.hpp>

Inheritance diagram for sgpp::combigrid::AbstractFullGridEvaluator< V >:
sgpp::combigrid::AbstractFullGridEvaluationStrategy< V > sgpp::combigrid::FullGridCallbackEvaluator< V > sgpp::combigrid::FullGridGridBasedEvaluator< V >

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::DataVectorgetGridPoints (MultiIndex const &level)
 
virtual std::vector< ThreadPool::TaskgetLevelTasks (MultiIndex const &level, ThreadPool::Task callback)=0
 
std::shared_ptr< AbstractCombigridStoragegetStorage ()
 
virtual std::shared_ptr< TensorGridgetTensorGrid (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 &params)=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< AbstractCombigridStoragestorage
 Provides access to the function values (stored or computed on demand) More...
 

Detailed Description

template<typename V>
class sgpp::combigrid::AbstractFullGridEvaluator< V >

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.

Constructor & Destructor Documentation

template<typename V >
sgpp::combigrid::AbstractFullGridEvaluator< V >::AbstractFullGridEvaluator ( std::shared_ptr< AbstractCombigridStorage storage,
std::vector< std::shared_ptr< AbstractPointHierarchy >>  pointHierarchies 
)
inline

Constructor.

Parameters
storageStorage that stores and provides the function values for each grid point.
pointHierarchiesPointHierarchy objects for each dimension providing the points for each level and information about their ordering.
template<typename V >
virtual sgpp::combigrid::AbstractFullGridEvaluator< V >::~AbstractFullGridEvaluator ( )
inlinevirtual

Member Function Documentation

template<typename V >
virtual V sgpp::combigrid::AbstractFullGridEvaluator< V >::eval ( MultiIndex const &  level)
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().

template<typename V >
virtual std::vector<base::DataVector> sgpp::combigrid::AbstractFullGridEvaluator< V >::getGridPoints ( MultiIndex const &  level)
inlinevirtual
template<typename V >
virtual std::vector<ThreadPool::Task> sgpp::combigrid::AbstractFullGridEvaluator< V >::getLevelTasks ( MultiIndex const &  level,
ThreadPool::Task  callback 
)
pure virtual
Returns
a vector of tasks which can be precomputed in parallel to make the (serialized) execution of eval() faster
Parameters
levelthe level which one wants to compute
callbackThis 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().

template<typename V >
std::shared_ptr<AbstractCombigridStorage> sgpp::combigrid::AbstractFullGridEvaluator< V >::getStorage ( )
inline
template<typename V >
virtual std::shared_ptr<TensorGrid> sgpp::combigrid::AbstractFullGridEvaluator< V >::getTensorGrid ( MultiIndex const &  level,
std::vector< bool >  orderingConfiguration 
)
inlinevirtual
Returns
Returns the grid in the current level as a pointer to a TensorGrid object

References level.

Referenced by sgpp::combigrid::FullGridGridBasedEvaluator< V >::eval(), and sgpp::combigrid::FullGridGridBasedEvaluator< V >::getLevelTasks().

template<typename V >
virtual size_t sgpp::combigrid::AbstractFullGridEvaluator< V >::maxNewPoints ( MultiIndex const &  level)
inlinevirtual
Returns
an estimate (upper bound, in the case of nested points normally exact) of the number of new function evaluations (grid points) that have to be performed when evaluating this level.
template<typename V >
virtual size_t sgpp::combigrid::AbstractFullGridEvaluator< V >::numPoints ( MultiIndex const &  level)
inlinevirtual
Returns
the total number of grid points in a given level.
template<typename V >
virtual void sgpp::combigrid::AbstractFullGridEvaluator< V >::setMutex ( std::shared_ptr< std::recursive_mutex >  mutexPtr)
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 sgpp::combigrid::AbstractFullGridEvaluator< V >::eval(), sgpp::combigrid::AbstractFullGridEvaluator< V >::getLevelTasks(), level, and sgpp::combigrid::AbstractFullGridEvaluator< V >::mutexPtr.

template<typename V >
virtual void sgpp::combigrid::AbstractFullGridEvaluator< V >::setParameters ( std::vector< V > const &  params)
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().

Member Data Documentation

template<typename V >
std::shared_ptr<std::recursive_mutex> sgpp::combigrid::AbstractFullGridEvaluator< V >::mutexPtr
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().


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