40#include <boost/function.hpp>
51 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
54 using Parameters = Eigen::Matrix<double, -1, 1>;
55 using DiffMatrix = Eigen::Matrix<double, -1, -1>;
58 static double Point(
size_t N,
int j) {
59 assert(j >= 0 &&
size_t(j) < N);
60 const double dtheta = M_PI / (N > 1 ? (N - 1) : 1);
63 return cos(-M_PI + dtheta * j);
67 static double Point(
size_t N,
int j,
double a,
double b) {
68 assert(j >= 0 &&
size_t(j) < N);
69 const double dtheta = M_PI / (N - 1);
71 return a + (b - a) * (1. + cos(-M_PI + dtheta * j)) / 2;
77 for (
size_t j = 0; j < N; j++) points(j) = Point(N, j);
82 static Vector
Points(
size_t N,
double a,
double b) {
83 Vector points = Points(N);
84 const double T1 = (a + b) / 2, T2 = (b - a) / 2;
85 points = T1 + (T2 * points).array();
97 static Weights CalculateWeights(
size_t N,
double x,
double a = -1,
104 static Weights DerivativeWeights(
size_t N,
double x,
double a = -1,
111 static DiffMatrix DifferentiationMatrix(
size_t N,
double a = -1,
132 static Weights IntegrationWeights(
size_t N,
double a = -1,
double b = 1);
138 static Matrix
matrix(boost::function<Eigen::Matrix<double, M, 1>(
double)> f,
139 size_t N,
double a = -1,
double b = 1) {
141 for (
size_t j = 0; j < N; j++) {
142 Xmat.col(j) = f(Point(N, j, a, b));
Special class for optional Jacobian arguments.
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:95
Chebyshev Interpolation on Chebyshev points of the second kind Note that N here, the number of points...
Definition: Chebyshev2.h:49
static Matrix matrix(boost::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:138
static double Point(size_t N, int j)
Specific Chebyshev point.
Definition: Chebyshev2.h:58
static double Point(size_t N, int j, double a, double b)
Specific Chebyshev point, within [a,b] interval.
Definition: Chebyshev2.h:67
static Vector Points(size_t N)
All Chebyshev points.
Definition: Chebyshev2.h:75
static Vector Points(size_t N, double a, double b)
All Chebyshev points, within [a,b] interval.
Definition: Chebyshev2.h:82