gtsam
Loading...
Searching...
No Matches
Chebyshev2.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2
3 * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
32
33#pragma once
34
35#include <gtsam/base/Manifold.h>
36#include <gtsam/basis/Basis.h>
37
38namespace gtsam {
39
45class GTSAM_EXPORT Chebyshev2 : public Basis<Chebyshev2> {
46 public:
47 using Base = Basis<Chebyshev2>;
48 using Parameters = Eigen::Matrix<double, /*Nx1*/ -1, 1>;
49 using DiffMatrix = Eigen::Matrix<double, /*NxN*/ -1, -1>;
50
58 static double Point(size_t N, int j);
59
69 static double Point(size_t N, int j, double a, double b);
70
72 static Vector Points(size_t N);
73
75 static Vector Points(size_t N, double a, double b);
76
85 static Weights CalculateWeights(size_t N, double x, double a = -1, double b = 1);
86
91 static Weights DerivativeWeights(size_t N, double x, double a = -1, double b = 1);
92
97 static DiffMatrix DifferentiationMatrix(size_t N);
98
100 static DiffMatrix DifferentiationMatrix(size_t N, double a, double b);
101
114 static Matrix IntegrationMatrix(size_t N);
115
117 static Matrix IntegrationMatrix(size_t N, double a, double b);
118
126 static Weights IntegrationWeights(size_t N);
127
129 static Weights IntegrationWeights(size_t N, double a, double b);
130
138 static Weights DoubleIntegrationWeights(size_t N);
139
141 static Weights DoubleIntegrationWeights(size_t N, double a, double b);
142
144 static Vector vector(std::function<double(double)> f,
145 size_t N, double a = -1, double b = 1);
146
148 template <size_t M>
149 static Matrix matrix(std::function<Eigen::Matrix<double, M, 1>(double)> f,
150 size_t N, double a = -1, double b = 1) {
151 Matrix Xmat(M, N);
152 const Vector points = Points(N, a, b);
153 for (size_t j = 0; j < N; j++) Xmat.col(j) = f(points(j));
154 return Xmat;
155 }
156}; // \ Chebyshev2
157
158} // namespace gtsam
Base class and basic functions for Manifold types.
Compute an interpolating basis.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
CRTP Base class for function bases.
Definition Basis.h:90
Chebyshev Interpolation on Chebyshev points of the second kind Note that N here, the number of points...
Definition Chebyshev2.h:45
static double Point(size_t N, int j)
Specific Chebyshev point, within [-1,1] interval.
Definition Chebyshev2.cpp:26
static Weights IntegrationWeights(size_t N)
Calculate Clenshaw-Curtis weights for integrating a degree N-1 interpolant represented by values at N...
Definition Chebyshev2.cpp:278
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.
Definition Chebyshev2.cpp:325
static Vector Points(size_t N)
All Chebyshev points.
Definition Chebyshev2.cpp:38
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 bary...
Definition Chebyshev2.cpp:120
static Weights DerivativeWeights(size_t N, double x, double a=-1, double b=1)
Evaluate derivative of barycentric weights.
Definition Chebyshev2.cpp:152
static Weights DoubleIntegrationWeights(size_t N)
Calculate double Clenshaw-Curtis integration weights.
Definition Chebyshev2.cpp:312
static Matrix IntegrationMatrix(size_t N)
Exact integration matrix from N derivative nodes to N+1 state nodes.
Definition Chebyshev2.cpp:228
static DiffMatrix DifferentiationMatrix(size_t N)
Compute D = differentiation matrix, Trefethen00book p.53 When given a parameter vector f of function ...
Definition Chebyshev2.cpp:203
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.
Definition Chebyshev2.h:149