SG++-Doxygen-Documentation
sgpp::base::AlgorithmEvaluationTransposed< BASIS > Class Template Reference

Basic algorithm for getting all affected basis functions. More...

#include <AlgorithmEvaluationTransposed.hpp>

Public Member Functions

 AlgorithmEvaluationTransposed (GridStorage &storage)
 
void operator() (BASIS &basis, const DataVector &point, double alpha, DataVector &result)
 Returns evaluations of all basis functions that are non-zero at a given evaluation point. More...
 
 ~AlgorithmEvaluationTransposed ()
 

Protected Member Functions

void rec (BASIS &basis, DataVector &point, size_t current_dim, double value, GridStorage::grid_iterator &working, index_t *source, double alpha, DataVector &result)
 Recursive traversal of the "tree" of basis functions for evaluation, used in operator(). More...
 

Protected Attributes

GridStoragestorage
 

Detailed Description

template<class BASIS>
class sgpp::base::AlgorithmEvaluationTransposed< BASIS >

Basic algorithm for getting all affected basis functions.

This implicitly assumes a tensor-product approach and local support. No grid points on the border are supported.

Constructor & Destructor Documentation

template<class BASIS >
sgpp::base::AlgorithmEvaluationTransposed< BASIS >::AlgorithmEvaluationTransposed ( GridStorage storage)
inlineexplicit
template<class BASIS >
sgpp::base::AlgorithmEvaluationTransposed< BASIS >::~AlgorithmEvaluationTransposed ( )
inline

Member Function Documentation

template<class BASIS >
void sgpp::base::AlgorithmEvaluationTransposed< BASIS >::operator() ( BASIS &  basis,
const DataVector point,
double  alpha,
DataVector result 
)
inline

Returns evaluations of all basis functions that are non-zero at a given evaluation point.

For a given evaluation point \(x\), it stores tuples (std::pair) of \((i,\phi_i(x))\) in the result vector for all basis functions that are non-zero. If one wants to evaluate \(f_N(x)\), one only has to compute

\[ \sum_{r\in\mathbf{result}} \alpha[r\rightarrow\mathbf{first}] \cdot r\rightarrow\mathbf{second}. \]

Parameters
basisa sparse grid basis
pointevaluation point within the domain
alphathe coefficient of the regarded ansatzfunction
resultvector that will contain the local support of the given ansatzfuction for all evaluations points

References chess::dim, sgpp::base::HashGridStorage::getBoundingBox(), sgpp::base::HashGridStorage::getDimension(), sgpp::base::BoundingBox::isContainingPoint(), sgpp::base::AlgorithmEvaluationTransposed< BASIS >::rec(), sgpp::base::AlgorithmEvaluationTransposed< BASIS >::storage, and sgpp::base::BoundingBox::transformPointToUnitCube().

template<class BASIS >
void sgpp::base::AlgorithmEvaluationTransposed< BASIS >::rec ( BASIS &  basis,
DataVector point,
size_t  current_dim,
double  value,
GridStorage::grid_iterator working,
index_t source,
double  alpha,
DataVector result 
)
inlineprotected

Recursive traversal of the "tree" of basis functions for evaluation, used in operator().

For a given evaluation point \(x\), it stores tuples (std::pair) of \((i,\phi_i(x))\) in the result vector for all basis functions that are non-zero.

Parameters
basisa sparse grid basis
pointevaluation point within the domain
current_dimthe dimension currently looked at (recursion parameter)
valuethe value of the evaluation of the current basis function up to (excluding) dimension current_dim (product of the evaluations of the one-dimensional ones)
workingiterator working on the GridStorage of the basis
sourcearray of indices for each dimension (identifying the indices of the current grid point)
alphathe coefficient of current ansatzfunction
resultvector that will contain the local support of the given ansatzfuction for all evaluations points

References sgpp::base::HashGridIterator::get(), sgpp::base::HashGridStorage::getDimension(), sgpp::base::HashGridIterator::hint(), sgpp::base::HashGridStorage::isInvalidSequenceNumber(), sgpp::base::HashGridIterator::leftChild(), sgpp::base::HashGridIterator::resetToLevelOne(), sgpp::base::HashGridIterator::rightChild(), and sgpp::base::HashGridIterator::seq().

Referenced by sgpp::base::AlgorithmEvaluationTransposed< BASIS >::operator()().

Member Data Documentation


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