48 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
51 using Parameters = Eigen::Matrix<double, -1, 1>;
52 using DiffMatrix = Eigen::Matrix<double, -1, -1>;
55 static double Point(
size_t N,
int j) {
56 assert(j >= 0 &&
size_t(j) < N);
57 const double dtheta = M_PI / (N > 1 ? (N - 1) : 1);
60 return cos(-M_PI + dtheta * j);
64 static double Point(
size_t N,
int j,
double a,
double b) {
65 assert(j >= 0 &&
size_t(j) < N);
66 const double dtheta = M_PI / (N - 1);
68 return a + (b - a) * (1. + cos(-M_PI + dtheta * j)) / 2;
74 for (
size_t j = 0; j < N; j++) points(j) = Point(N, j);
79 static Vector
Points(
size_t N,
double a,
double b) {
80 Vector points = Points(N);
81 const double T1 = (a + b) / 2, T2 = (b - a) / 2;
82 points = T1 + (T2 * points).array();
94 static Weights CalculateWeights(
size_t N,
double x,
double a = -1,
101 static Weights DerivativeWeights(
size_t N,
double x,
double a = -1,
108 static DiffMatrix DifferentiationMatrix(
size_t N,
double a = -1,
129 static Weights IntegrationWeights(
size_t N,
double a = -1,
double b = 1);
135 static Matrix
matrix(std::function<Eigen::Matrix<double, M, 1>(
double)> f,
136 size_t N,
double a = -1,
double b = 1) {
138 for (
size_t j = 0; j < N; j++) {
139 Xmat.col(j) = f(Point(N, j, a, b));
Base class and basic functions for Manifold types.
Special class for optional Jacobian arguments.
Compute an interpolating basis.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
CRTP Base class for function bases.
Definition Basis.h:100
Chebyshev Interpolation on Chebyshev points of the second kind Note that N here, the number of points...
Definition Chebyshev2.h:46
static double Point(size_t N, int j)
Specific Chebyshev point.
Definition Chebyshev2.h:55
static double Point(size_t N, int j, double a, double b)
Specific Chebyshev point, within [a,b] interval.
Definition Chebyshev2.h:64
static Vector Points(size_t N)
All Chebyshev points.
Definition Chebyshev2.h:72
static Vector Points(size_t N, double a, double b)
All Chebyshev points, within [a,b] interval.
Definition Chebyshev2.h:79
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:135