gtsam
Loading...
Searching...
No Matches
gtsam::Chebyshev2 Class Reference

Detailed Description

Chebyshev Interpolation on Chebyshev points of the second kind Note that N here, the number of points, is one less than N from 'Approximation Theory and Approximation Practice by L.

N. Trefethen (pg.42)'.

Inheritance diagram for gtsam::Chebyshev2:

Static Public Member Functions

static double Point (size_t N, int j)
 Specific Chebyshev point, within [-1,1] interval.
static double Point (size_t N, int j, double a, double b)
 Specific Chebyshev point, within [a,b] interval.
static Vector Points (size_t N)
 All Chebyshev points.
static Vector Points (size_t N, double a, double b)
 All Chebyshev points, within [a,b] interval.
static Weights CalculateWeights (size_t N, double x, double a=-1, double b=1)
 Evaluate Chebyshev Weights on [-1,1] at any x up to order N-1 (N values) These weights implement barycentric interpolation at a specific x.
static Weights DerivativeWeights (size_t N, double x, double a=-1, double b=1)
 Evaluate derivative of barycentric weights.
static DiffMatrix DifferentiationMatrix (size_t N)
 Compute D = differentiation matrix, Trefethen00book p.53 When given a parameter vector f of function values at the Chebyshev points, D*f are the values of f'.
static DiffMatrix DifferentiationMatrix (size_t N, double a, double b)
 Compute D = differentiation matrix, for interval [a,b].
static Matrix IntegrationMatrix (size_t N)
 Exact integration matrix from N derivative nodes to N+1 state nodes.
static Matrix IntegrationMatrix (size_t N, double a, double b)
 Exact (N+1)×N integration matrix on [a,b].
static Weights IntegrationWeights (size_t N)
 Calculate Clenshaw-Curtis weights for integrating a degree N-1 interpolant represented by values at N CGL nodes over [-1,1].
static Weights IntegrationWeights (size_t N, double a, double b)
 Calculate Clenshaw-Curtis integration weights for interval [a,b].
static Weights DoubleIntegrationWeights (size_t N)
 Calculate double Clenshaw-Curtis integration weights.
static Weights DoubleIntegrationWeights (size_t N, double a, double b)
 Calculate double Clenshaw-Curtis integration weights on [a,b].
static Vector vector (std::function< double(double)> f, size_t N, double a=-1, double b=1)
 Create matrix of values at Chebyshev points given vector-valued function.
template<size_t M>
static Matrix matrix (std::function< Eigen::Matrix< double, M, 1 >(double)> f, size_t N, double a=-1, double b=1)
 Create matrix of values at Chebyshev points given vector-valued function.
Static Public Member Functions inherited from gtsam::Basis< Chebyshev2 >
static Matrix WeightMatrix (size_t N, const Vector &X)
 Calculate weights for all x in vector X.
static Matrix WeightMatrix (size_t N, const Vector &X, double a, double b)
 Calculate weights for all x in vector X, with interval [a,b].

Public Types

using Base = Basis<Chebyshev2>
using Parameters = Eigen::Matrix<double, -1, 1>
using DiffMatrix = Eigen::Matrix<double, -1, -1>

Member Function Documentation

◆ CalculateWeights()

Weights gtsam::Chebyshev2::CalculateWeights ( size_t N,
double x,
double a = -1,
double b = 1 )
static

Evaluate Chebyshev Weights on [-1,1] at any x up to order N-1 (N values) These weights implement barycentric interpolation at a specific x.

More precisely, f(x) ~ [w0;...;wN] * [f0;...;fN], where the fj are the values of the function f at the Chebyshev points. As such, for a given x we obtain a linear map from parameter vectors f to interpolated values f(x). Optional [a,b] interval can be specified as well.

◆ DerivativeWeights()

Weights gtsam::Chebyshev2::DerivativeWeights ( size_t N,
double x,
double a = -1,
double b = 1 )
static

Evaluate derivative of barycentric weights.

This is easy and efficient via the DifferentiationMatrix.

◆ DifferentiationMatrix()

Chebyshev2::DiffMatrix gtsam::Chebyshev2::DifferentiationMatrix ( size_t N)
static

Compute D = differentiation matrix, Trefethen00book p.53 When given a parameter vector f of function values at the Chebyshev points, D*f are the values of f'.

https://people.maths.ox.ac.uk/trefethen/8all.pdf Theorem 8.4

◆ DoubleIntegrationWeights()

Weights gtsam::Chebyshev2::DoubleIntegrationWeights ( size_t N)
static

Calculate double Clenshaw-Curtis integration weights.

This integrates the exact antiderivative once more: W * P, where P is the exact N -> N+1 integration matrix and W integrates the N+1 antiderivative values.

◆ IntegrationMatrix()

Matrix gtsam::Chebyshev2::IntegrationMatrix ( size_t N)
static

Exact integration matrix from N derivative nodes to N+1 state nodes.

Input values y_r define the degree N-1 interpolant

p(t) = sum_r y_r l_r(t)

on the N Chebyshev-Gauss-Lobatto nodes. The returned matrix P has (N+1)×N shape and gives F = P*y, where F_j = integral_a^{x_j} p(t) dt at the N+1 output CGL nodes x_j, with F(a)=0. The final row is exactly the Clenshaw-Curtis quadrature row IntegrationWeights(N).

◆ IntegrationWeights()

Weights gtsam::Chebyshev2::IntegrationWeights ( size_t N)
static

Calculate Clenshaw-Curtis weights for integrating a degree N-1 interpolant represented by values at N CGL nodes over [-1,1].

Trefethen00book, pg 128, clencurt.m. Note that N in clencurt.m is 1 less than our N.

◆ Point() [1/2]

double gtsam::Chebyshev2::Point ( size_t N,
int j )
static

Specific Chebyshev point, within [-1,1] interval.

Parameters
NThe degree of the polynomial
jThe index of the Chebyshev point
Returns
double

◆ Point() [2/2]

double gtsam::Chebyshev2::Point ( size_t N,
int j,
double a,
double b )
static

Specific Chebyshev point, within [a,b] interval.

Parameters
NThe degree of the polynomial
jThe index of the Chebyshev point
aLower bound of interval (default: -1)
bUpper bound of interval (default: 1)
Returns
double

◆ vector()

Vector gtsam::Chebyshev2::vector ( std::function< double(double)> f,
size_t N,
double a = -1,
double b = 1 )
static

Create matrix of values at Chebyshev points given vector-valued function.

Create vector of values at Chebyshev points given scalar-valued function.


The documentation for this class was generated from the following files:
  • /tmp/gtsam-4.3.0-doxygen.rsXPUS/source/gtsam/basis/Chebyshev2.h
  • /tmp/gtsam-4.3.0-doxygen.rsXPUS/source/gtsam/basis/Chebyshev2.cpp