SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::base::BreadthFirstSearch< FUNC > Class Template Reference

Class for applying a functor of type FUNC on all grid points of a sparse grid in a breadth-first search (BFS) manner. More...

#include <BreadthFirstSearch.hpp>

Public Member Functions

 BreadthFirstSearch (FUNC &functor, GridStorage &storage)
 Constructor.
 
 BreadthFirstSearch (GridStorage &storage)
 Constructor.
 
template<class DataType >
void execute (const DataType &source, DataType &result)
 Execute the BFS.
 
 ~BreadthFirstSearch ()
 Destructor.
 

Protected Types

typedef GridStorage::grid_iterator grid_iterator
 grid iterator
 

Protected Attributes

FUNC functor
 functor to apply in the BFS
 
GridStoragestorage
 storage of the grid
 

Detailed Description

template<class FUNC>
class sgpp::base::BreadthFirstSearch< FUNC >

Class for applying a functor of type FUNC on all grid points of a sparse grid in a breadth-first search (BFS) manner.

Especially useful for hierarchization with basis functions which fulfill a Lagrange property, e.g., fundamental splines. The functor should implement void operator()(const DataVector& source, DataVector& result, const grid_iterator& iterator), where source is the original data (e.g., node values), result is the result of the functor (e.g., surplusses), and iterator is at the current grid point.

Member Typedef Documentation

◆ grid_iterator

template<class FUNC >
typedef GridStorage::grid_iterator sgpp::base::BreadthFirstSearch< FUNC >::grid_iterator
protected

grid iterator

Constructor & Destructor Documentation

◆ BreadthFirstSearch() [1/2]

template<class FUNC >
sgpp::base::BreadthFirstSearch< FUNC >::BreadthFirstSearch ( GridStorage storage)
inlineexplicit

Constructor.

Uses the default constructor for the functor.

Parameters
storagestorage of the grid

◆ BreadthFirstSearch() [2/2]

template<class FUNC >
sgpp::base::BreadthFirstSearch< FUNC >::BreadthFirstSearch ( FUNC functor,
GridStorage storage 
)
inline

Constructor.

Parameters
functorfunctor to apply in the BFS
storagestorage of the grid

◆ ~BreadthFirstSearch()

template<class FUNC >
sgpp::base::BreadthFirstSearch< FUNC >::~BreadthFirstSearch ( )
inline

Destructor.

Member Function Documentation

◆ execute()

template<class FUNC >
template<class DataType >
void sgpp::base::BreadthFirstSearch< FUNC >::execute ( const DataType &  source,
DataType &  result 
)
inline

Execute the BFS.

Parameters
[in]sourceoriginal data (e.g., node values)
[out]resultresult of the BFS (e.g., surplusses)

References sgpp::base::BreadthFirstSearch< FUNC >::functor, sgpp::base::HashGridStorage::getDimension(), sgpp::base::HashGridStorage::getSize(), sgpp::base::HashGridIterator::leftChild(), sgpp::base::HashGridIterator::seq(), sgpp::base::HashGridIterator::set(), sgpp::base::HashGridIterator::stepRight(), sgpp::base::BreadthFirstSearch< FUNC >::storage, and sgpp::base::HashGridIterator::up().

Referenced by sgpp::base::OperationHierarchisationFundamentalNakSplineBoundary::doDehierarchisation(), sgpp::base::OperationHierarchisationFundamentalSpline::doDehierarchisation(), sgpp::base::OperationHierarchisationFundamentalSplineBoundary::doDehierarchisation(), sgpp::base::OperationHierarchisationModFundamentalSpline::doDehierarchisation(), sgpp::base::OperationHierarchisationFundamentalNakSplineBoundary::doDehierarchisation(), sgpp::base::OperationHierarchisationFundamentalSpline::doDehierarchisation(), sgpp::base::OperationHierarchisationFundamentalSplineBoundary::doDehierarchisation(), sgpp::base::OperationHierarchisationModFundamentalSpline::doDehierarchisation(), sgpp::base::OperationHierarchisationFundamentalNakSplineBoundary::doHierarchisation(), sgpp::base::OperationHierarchisationFundamentalSpline::doHierarchisation(), sgpp::base::OperationHierarchisationFundamentalSplineBoundary::doHierarchisation(), sgpp::base::OperationHierarchisationModFundamentalSpline::doHierarchisation(), sgpp::base::OperationHierarchisationFundamentalNakSplineBoundary::doHierarchisation(), sgpp::base::OperationHierarchisationFundamentalSpline::doHierarchisation(), sgpp::base::OperationHierarchisationFundamentalSplineBoundary::doHierarchisation(), and sgpp::base::OperationHierarchisationModFundamentalSpline::doHierarchisation().

Member Data Documentation

◆ functor

template<class FUNC >
FUNC sgpp::base::BreadthFirstSearch< FUNC >::functor
protected

functor to apply in the BFS

Referenced by sgpp::base::BreadthFirstSearch< FUNC >::execute().

◆ storage

template<class FUNC >
GridStorage& sgpp::base::BreadthFirstSearch< FUNC >::storage
protected

storage of the grid

Referenced by sgpp::base::BreadthFirstSearch< FUNC >::execute().


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