Go to the documentation of this file.
25 assert(
j >= 0 &&
size_t(
j) <
N);
26 const double dtheta =
M_PI / (
N > 1 ? (
N - 1) : 1);
29 return a + (
b -
a) * (1. +
cos(-
M_PI + dtheta *
j)) / 2;
40 for (
size_t j = 0;
j <
N;
j++) {
54 weights(0) = 0.5 / distances(0);
57 double d = weights(0),
s = -1;
58 for (
size_t j = 1;
j <
N - 1;
j++,
s = -
s) {
59 weights(
j) =
s / distances(
j);
64 weights(
N - 1) = 0.5 *
s / distances(
N - 1);
82 for (
size_t j = 0;
j <
N;
j++) {
89 double cj = (
j == 0 ||
j ==
N - 1) ? 2. : 1.;
90 for (
size_t k = 0; k <
N; k++) {
91 if (
j == 0 && k == 0) {
93 weightDerivatives(k) = -(cj * (
N - 1) * (
N - 1) + 1) / 6.0;
94 }
else if (
j ==
N - 1 && k ==
N - 1) {
96 weightDerivatives(k) = (cj * (
N - 1) * (
N - 1) + 1) / 6.0;
100 weightDerivatives(k) = -0.5 * xj / (1 - xj2);
104 double ck = (k == 0 || k ==
N - 1) ? 2. : 1.;
105 t = ((
j + k) % 2) == 0 ? 1 : -1;
106 weightDerivatives(k) = (cj / ck) *
t / (xj - xk);
109 return 2 * weightDerivatives / (
b -
a);
123 for (
size_t j = 0;
j <
N;
j++) {
124 if (
j == 0 ||
j ==
N - 1) {
130 t = (
j % 2 == 0) ? 1 : -1;
132 double c =
t / distances(
j);
134 k += (
w *
c / distances(
j));
140 for (
size_t j = 0;
j <
N;
j++,
s = -
s) {
143 if (
j == 0 ||
j ==
N - 1) {
149 weightDerivatives(
j) = (
w * -
s / (
g * distances(
j) * distances(
j))) -
150 (
w * -
s * k / (
g2 * distances(
j)));
153 return weightDerivatives;
167 for (
size_t i = 0;
i <
N;
i++) {
169 double ci = (
i == 0 ||
i ==
N - 1) ? 2. : 1.;
170 for (
size_t j = 0;
j <
N;
j++) {
171 if (
i == 0 &&
j == 0) {
173 D(
i,
j) = -(ci * (
N - 1) * (
N - 1) + 1) / 6.0;
174 }
else if (
i ==
N - 1 &&
j ==
N - 1) {
176 D(
i,
j) = (ci * (
N - 1) * (
N - 1) + 1) / 6.0;
178 double xi2 =
xi *
xi;
179 D(
i,
j) = -
xi / (2 * (1 - xi2));
182 double cj = (
j == 0 ||
j ==
N - 1) ? 2. : 1.;
183 t = ((
i +
j) % 2) == 0 ? 1 : -1;
184 D(
i,
j) = (ci / cj) *
t / (
xi - xj);
189 return D / ((
b -
a) / 2.0);
197 weights(0) = 0.5 * (
b -
a) / (
K2 +
K % 2 - 1);
198 weights(
N - 1) = weights(0);
200 size_t last_k =
K / 2 +
K % 2 - 1;
202 for (
size_t i = 1;
i <=
N - 2; ++
i) {
203 double theta =
i *
M_PI /
K;
204 weights(
i) = (
K % 2 == 0) ? 1 -
cos(
K * theta) / (
K2 - 1) : 1;
206 for (
size_t k = 1; k <= last_k; ++k)
207 weights(
i) -= 2 *
cos(2 * k * theta) / (4 * k * k - 1);
208 weights(
i) *= (
b -
a) /
K;
Pseudo-spectral parameterization for Chebyshev polynomials of the second kind.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const double d[K][N]
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
static const Cal3Bundler K2(625, 1e-3, 1e-3)
Jet< T, N > cos(const Jet< T, N > &f)
static DiffMatrix DifferentiationMatrix(size_t N, double a=-1, double b=1)
Pose3 g2(g1.expmap(h *V1_g1))
static double Point(size_t N, int j, double a=-1, double b=1)
Specific Chebyshev point, within [a,b] interval. Default interval is [-1, 1].
void g(const string &key, int i)
static Weights CalculateWeights(size_t N, double x, double a=-1, double b=1)
static Weights IntegrationWeights(size_t N, double a=-1, double b=1)
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
static Weights DerivativeWeights(size_t N, double x, double a=-1, double b=1)
gtsam
Author(s):
autogenerated on Sun Feb 16 2025 04:01:04