Doxygen
1.9.1
|
Cache that holds the values of 1D Lagrange polynomials. More...
#include <tsgCacheLagrange.hpp>
Public Member Functions | |
CacheLagrange (int num_dimensions, const std::vector< int > &max_levels, const OneDimensionalWrapper &rule, const double x[]) | |
Constructor that takes into account a single canonical point x. More... | |
~CacheLagrange ()=default | |
Destructor, clear all used data. | |
T | getLagrange (int dimension, int level, int local) const |
Return the Lagrange cache for given dimension, level and offset local to the level. | |
Static Public Member Functions | |
static void | cacheLevel (int level, double x, const OneDimensionalWrapper &rule, T *cc) |
Computes the values of all Lagrange polynomials for the given level at the given x. | |
Protected Attributes | |
std::vector< std::vector< T > > | cache |
Stores the values of the Lagrange polynomias for each dimension and each level. More... | |
std::vector< int > | offsets |
Stores the offsets for each level within each dimension. | |
Cache that holds the values of 1D Lagrange polynomials.
Global grids have the most complex evaluation procedure, Lagrange polynomials have to be evaluated for each direction and each level, before the weighted sum can be accumulated to compute the values of the basis functions. The CacheLagrange class computes the values of the Lagrange polynomials and caches them for easy access.
|
inline |
Constructor that takes into account a single canonical point x.
The cache is constructed for each dimension and each level up to max_levels, the values of the Lagrange polynomials are computed in two passes resulting in O(n) operations.
|
protected |
Stores the values of the Lagrange polynomias for each dimension and each level.
cache[i] corresponds to the i-th dimension. The i-th vector has the values of the Lagrange polynomials going level by level, so the value of the Lagrange polynomial for dimension i at level l with local offset j will be cache[i][ offsets[l] + j ]