SG++-Doxygen-Documentation
sgpp::combigrid::CombigridTreeStorage Class Reference

Implementation of the AbstractCombigridStorage using TreeStorage<TreeStorage<float_t>>. More...

#include <CombigridTreeStorage.hpp>

Inheritance diagram for sgpp::combigrid::CombigridTreeStorage:
sgpp::combigrid::AbstractCombigridStorage

Public Member Functions

 CombigridTreeStorage (std::vector< std::shared_ptr< AbstractPointHierarchy >> const &p_pointHierarchies, MultiFunction p_func)
 
 CombigridTreeStorage (std::vector< std::shared_ptr< AbstractPointHierarchy >> const &p_pointHierarchies, bool exploitNesting=true, MultiFunction p_func=MultiFunction(constantFunction< base::DataVector const &, double >()))
 
virtual void deserialize (std::string const &str)
 Re-loads storage values from a string that has been generated by serialize(). More...
 
double get (MultiIndex const &level, MultiIndex const &index) override
 
virtual std::shared_ptr< AbstractMultiStorageIterator< double > > getGuidedIterator (MultiIndex const &level, MultiIndexIterator &iterator, std::vector< bool > orderingConfiguration)
 
virtual size_t getNumEntries ()
 Returns the number of entries (all level-index pairs) in the storage, which indicates the number of function evaluations that have been done. More...
 
std::shared_ptr< TreeStorage< double > > getStorage (const MultiIndex &level)
 
virtual std::string serialize ()
 
virtual void set (MultiIndex const &level, MultiIndex const &index, double value)
 Sets a value at the given level-index pair, creating a new entry if no value had been previously stored at this level-index pair. More...
 
virtual void setMutex (std::shared_ptr< std::recursive_mutex > mutexPtr)
 Sets a mutex that is locked for critical operations. More...
 
virtual ~CombigridTreeStorage ()
 
- Public Member Functions inherited from sgpp::combigrid::AbstractCombigridStorage
virtual ~AbstractCombigridStorage ()
 

Detailed Description

Implementation of the AbstractCombigridStorage using TreeStorage<TreeStorage<float_t>>.

For further information, refer to AbstractCombigridStorage.

Constructor & Destructor Documentation

◆ CombigridTreeStorage() [1/2]

sgpp::combigrid::CombigridTreeStorage::CombigridTreeStorage ( std::vector< std::shared_ptr< AbstractPointHierarchy >> const &  p_pointHierarchies,
MultiFunction  p_func 
)
Parameters
p_pointHierarchiesPoint hierarchies generating the points at which the function should be evaluated.
p_funcFunction generating the values that are stored in the storage.

◆ CombigridTreeStorage() [2/2]

sgpp::combigrid::CombigridTreeStorage::CombigridTreeStorage ( std::vector< std::shared_ptr< AbstractPointHierarchy >> const &  p_pointHierarchies,
bool  exploitNesting = true,
MultiFunction  p_func = MultiFunction(constantFunction<base::DataVector const &, double>()) 
)
Parameters
p_pointHierarchiesPoint hierarchies generating the points at which the function should be evaluated.
exploitNestingIf this is set to true, identical grid points on different levels can have different values. This is e.g. relevant for PDE solving.
p_funcFunction generating the values that are stored in the storage.

References sgpp::combigrid::CombigridTreeStorageImpl::exploitNesting.

◆ ~CombigridTreeStorage()

sgpp::combigrid::CombigridTreeStorage::~CombigridTreeStorage ( )
virtual

Member Function Documentation

◆ deserialize()

◆ get()

double sgpp::combigrid::CombigridTreeStorage::get ( MultiIndex const &  level,
MultiIndex const &  index 
)
overridevirtual

◆ getGuidedIterator()

std::shared_ptr< AbstractMultiStorageIterator< double > > sgpp::combigrid::CombigridTreeStorage::getGuidedIterator ( MultiIndex const &  level,
MultiIndexIterator iterator,
std::vector< bool >  orderingConfiguration 
)
virtual
Parameters
levelLevel to traverse
iteratorIterator that defines which values should be iterated over
orderingConfigurationDefines for each dimension whether the grid points in that dimension should be traversed in sorted order.
Returns
Returns an iterator that iterates along the multi-indices for a given level. These multi-indices are given by the parameter iterator. When moveToNext() is called on the returned iterator, it also calls moveToNext() on the underlying MultiIndexIterator. If the values are not already stored, they are created during iteration.

Implements sgpp::combigrid::AbstractCombigridStorage.

References level, and sgpp::combigrid::IterationPolicy::setIterator().

◆ getNumEntries()

size_t sgpp::combigrid::CombigridTreeStorage::getNumEntries ( )
virtual

Returns the number of entries (all level-index pairs) in the storage, which indicates the number of function evaluations that have been done.

Currently, this is an O(n) method.

Implements sgpp::combigrid::AbstractCombigridStorage.

◆ getStorage()

std::shared_ptr< TreeStorage< double > > sgpp::combigrid::CombigridTreeStorage::getStorage ( const MultiIndex level)

References level.

◆ serialize()

◆ set()

void sgpp::combigrid::CombigridTreeStorage::set ( MultiIndex const &  level,
MultiIndex const &  index,
double  value 
)
virtual

Sets a value at the given level-index pair, creating a new entry if no value had been previously stored at this level-index pair.

Implements sgpp::combigrid::AbstractCombigridStorage.

References level.

◆ setMutex()

void sgpp::combigrid::CombigridTreeStorage::setMutex ( std::shared_ptr< std::recursive_mutex >  mutexPtr)
virtual

Sets a mutex that is locked for critical operations.

If the mutex is nullptr, nothing is locked.

Implements sgpp::combigrid::AbstractCombigridStorage.

References sgpp::combigrid::CombigridTreeStorageImpl::mutexPtr.


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