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

Standard sweep operation FUNC should be a class with overwritten operator(). More...

#include <sweep.hpp>

Public Member Functions

 sweep (FUNC &functor, GridStorage &storage)
 Create a new sweep object with a copied functor.
 
 sweep (GridStorage &storage)
 Create a new sweep object with a default constructed functor.
 
void sweep1D (DataMatrix &source, DataMatrix &result, size_t dim_sweep)
 Descends on all dimensions beside dim_sweep.
 
void sweep1D (DataVector &source, DataVector &result, size_t dim_sweep)
 Descends on all dimensions beside dim_sweep.
 
void sweep1D_Boundary (DataMatrix &source, DataMatrix &result, size_t dim_sweep)
 Descends on all dimensions beside dim_sweep.
 
void sweep1D_Boundary (DataVector &source, DataVector &result, size_t dim_sweep)
 Descends on all dimensions beside dim_sweep.
 
 ~sweep ()
 Destructor.
 

Protected Types

typedef GridStorage::grid_iterator grid_iterator
 

Protected Member Functions

void sweep_Boundary_rec (DataMatrix &source, DataMatrix &result, grid_iterator &index, std::vector< size_t > &dim_list, size_t dim_rem, size_t dim_sweep)
 Descends on all dimensions beside dim_sweep.
 
void sweep_Boundary_rec (DataVector &source, DataVector &result, grid_iterator &index, std::vector< size_t > &dim_list, size_t dim_rem, size_t dim_sweep)
 Descends on all dimensions beside dim_sweep.
 
void sweep_rec (DataMatrix &source, DataMatrix &result, grid_iterator &index, std::vector< size_t > &dim_list, size_t dim_rem, size_t dim_sweep)
 Descends on all dimensions beside dim_sweep.
 
void sweep_rec (DataVector &source, DataVector &result, grid_iterator &index, std::vector< size_t > &dim_list, size_t dim_rem, size_t dim_sweep)
 Descends on all dimensions beside dim_sweep.
 

Protected Attributes

const std::vector< size_t > algoDims
 algorithmic dimensions, operator is applied in this dimensions
 
FUNC functor
 Object of FUNC, this is executed by sweep.
 
const size_t numAlgoDims_
 number of algorithmic dimensions
 
GridStoragestorage
 Pointer to the grid's storage object.
 

Detailed Description

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

Standard sweep operation FUNC should be a class with overwritten operator().

For an example see laplace_up_functor in laplace.hpp. It must be default constructable or copyable. STORAGE must provide a grid_iterator supporting left_child, step_right, up, hint and seq.

Member Typedef Documentation

◆ grid_iterator

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

Constructor & Destructor Documentation

◆ sweep() [1/2]

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

Create a new sweep object with a default constructed functor.

Parameters
storagethe storage that contains the grid points

◆ sweep() [2/2]

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

Create a new sweep object with a copied functor.

Parameters
functorthe functor that is executed on the grid
storagethe storage that contains the grid points

◆ ~sweep()

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

Destructor.

Member Function Documentation

◆ sweep1D() [1/2]

template<class FUNC >
void sgpp::base::sweep< FUNC >::sweep1D ( DataMatrix source,
DataMatrix result,
size_t  dim_sweep 
)
inline

Descends on all dimensions beside dim_sweep.

Class functor for dim_sweep Boundaries are not regarded

Parameters
sourcea DataMatrix containing the source coefficients of the grid points
resulta DataMatrix containing the result coefficients of the grid points
dim_sweepthe dimension in which the functor is executed

References sgpp::base::sweep< FUNC >::numAlgoDims_, sgpp::base::sweep< FUNC >::storage, and sgpp::base::sweep< FUNC >::sweep_rec().

◆ sweep1D() [2/2]

template<class FUNC >
void sgpp::base::sweep< FUNC >::sweep1D ( DataVector source,
DataVector result,
size_t  dim_sweep 
)
inline

◆ sweep1D_Boundary() [1/2]

template<class FUNC >
void sgpp::base::sweep< FUNC >::sweep1D_Boundary ( DataMatrix source,
DataMatrix result,
size_t  dim_sweep 
)
inline

Descends on all dimensions beside dim_sweep.

Class functor for dim_sweep Boundaries are regarded

Parameters
sourcea DataMatrix containing the source coefficients of the grid points
resulta DataMatrix containing the result coefficients of the grid points
dim_sweepthe dimension in which the functor is executed

References sgpp::base::HashGridStorage::getDimension(), sgpp::base::HashGridIterator::resetToLevelZero(), sgpp::base::sweep< FUNC >::storage, and sgpp::base::sweep< FUNC >::sweep_Boundary_rec().

◆ sweep1D_Boundary() [2/2]

◆ sweep_Boundary_rec() [1/2]

template<class FUNC >
void sgpp::base::sweep< FUNC >::sweep_Boundary_rec ( DataMatrix source,
DataMatrix result,
grid_iterator index,
std::vector< size_t > &  dim_list,
size_t  dim_rem,
size_t  dim_sweep 
)
inlineprotected

Descends on all dimensions beside dim_sweep.

Class functor for dim_sweep. Boundaries are regarded

Parameters
sourcecoefficients of the sparse grid
resultcoefficients of the function computed by sweep
indexcurrent grid position
dim_listlist of dimensions, that should be handled
dim_remnumber of remaining dims
dim_sweepstatic dimension, in this dimension the functor is executed

References sgpp::base::sweep< FUNC >::functor, sgpp::base::HashGridIterator::get(), sgpp::base::HashGridIterator::hint(), sgpp::base::HashGridStorage::isInvalidSequenceNumber(), sgpp::base::HashGridIterator::leftChild(), sgpp::base::HashGridIterator::resetToLeftLevelZero(), sgpp::base::HashGridIterator::resetToLevelOne(), sgpp::base::HashGridIterator::resetToRightLevelZero(), sgpp::base::HashGridIterator::seq(), sgpp::base::HashGridIterator::stepRight(), sgpp::base::sweep< FUNC >::storage, sgpp::base::sweep< FUNC >::sweep_Boundary_rec(), and sgpp::base::HashGridIterator::up().

◆ sweep_Boundary_rec() [2/2]

template<class FUNC >
void sgpp::base::sweep< FUNC >::sweep_Boundary_rec ( DataVector source,
DataVector result,
grid_iterator index,
std::vector< size_t > &  dim_list,
size_t  dim_rem,
size_t  dim_sweep 
)
inlineprotected

◆ sweep_rec() [1/2]

template<class FUNC >
void sgpp::base::sweep< FUNC >::sweep_rec ( DataMatrix source,
DataMatrix result,
grid_iterator index,
std::vector< size_t > &  dim_list,
size_t  dim_rem,
size_t  dim_sweep 
)
inlineprotected

Descends on all dimensions beside dim_sweep.

Class functor for dim_sweep. Boundaries are not regarded

Parameters
sourcecoefficients of the sparse grid
resultcoefficients of the function computed by sweep
indexcurrent grid position
dim_listlist of dimensions, that should be handled
dim_remnumber of remaining dims
dim_sweepstatic dimension, in this dimension the functor is executed

References sgpp::base::sweep< FUNC >::functor, sgpp::base::HashGridIterator::hint(), sgpp::base::HashGridStorage::isInvalidSequenceNumber(), sgpp::base::HashGridIterator::leftChild(), sgpp::base::HashGridIterator::seq(), sgpp::base::HashGridIterator::stepRight(), sgpp::base::sweep< FUNC >::storage, sgpp::base::sweep< FUNC >::sweep_rec(), and sgpp::base::HashGridIterator::up().

◆ sweep_rec() [2/2]

template<class FUNC >
void sgpp::base::sweep< FUNC >::sweep_rec ( DataVector source,
DataVector result,
grid_iterator index,
std::vector< size_t > &  dim_list,
size_t  dim_rem,
size_t  dim_sweep 
)
inlineprotected

Descends on all dimensions beside dim_sweep.

Class functor for dim_sweep. Boundaries are not regarded

Parameters
sourcecoefficients of the sparse grid
resultcoefficients of the function computed by sweep
indexcurrent grid position
dim_listlist of dimensions, that should be handled
dim_remnumber of remaining dims
dim_sweepstatic dimension, in this dimension the functor is executed

References sgpp::base::sweep< FUNC >::functor, sgpp::base::HashGridIterator::hint(), sgpp::base::HashGridStorage::isInvalidSequenceNumber(), sgpp::base::HashGridIterator::leftChild(), sgpp::base::HashGridIterator::seq(), sgpp::base::HashGridIterator::stepRight(), sgpp::base::sweep< FUNC >::storage, sgpp::base::sweep< FUNC >::sweep_rec(), and sgpp::base::HashGridIterator::up().

Referenced by sgpp::base::sweep< FUNC >::sweep1D(), sgpp::base::sweep< FUNC >::sweep1D(), sgpp::base::sweep< FUNC >::sweep_rec(), and sgpp::base::sweep< FUNC >::sweep_rec().

Member Data Documentation

◆ algoDims

template<class FUNC >
const std::vector<size_t> sgpp::base::sweep< FUNC >::algoDims
protected

algorithmic dimensions, operator is applied in this dimensions

◆ functor

◆ numAlgoDims_

template<class FUNC >
const size_t sgpp::base::sweep< FUNC >::numAlgoDims_
protected

number of algorithmic dimensions

Referenced by sgpp::base::sweep< FUNC >::sweep1D().

◆ storage


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