Doxygen 1.9.1
Toolkit for Adaptive Stochastic Modeling and Non-Intrusive ApproximatioN: Tasmanian v8.2 (development)
TasGrid::CacheLagrange< T > Class Template Reference

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.
 
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.
 

Detailed Description

template<typename T>
class TasGrid::CacheLagrange< T >

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.

Constructor & Destructor Documentation

◆ CacheLagrange()

template<typename T >
TasGrid::CacheLagrange< T >::CacheLagrange ( int  num_dimensions,
const std::vector< int > &  max_levels,
const OneDimensionalWrapper rule,
const double  x[] 
)
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.

  • num_dimensions is the number of dimensions to consider
  • max_levels indicates how many levels to consider in each direction, heavily anisotropic grids require only a few levels for the "less important" directions
  • rule is the wrapper of the Global grid that contains information about number of points per level and the actual nodes with the pre-computed Lagrange coefficients
  • holds the coordinates of the canonical point to cache

Member Data Documentation

◆ cache

template<typename T >
std::vector<std::vector<T> > TasGrid::CacheLagrange< T >::cache
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 ]


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