Go to the documentation of this file.
24 assert(
j >= 0 &&
size_t(
j) <
N);
25 const double dtheta =
M_PI / (
N > 1 ? (
N - 1) : 1);
28 return a + (
b -
a) * (1. +
cos(-
M_PI + dtheta *
j)) / 2;
39 for (
size_t j = 0;
j <
N;
j++) {
53 weights(0) = 0.5 / distances(0);
56 double d = weights(0),
s = -1;
57 for (
size_t j = 1;
j <
N - 1;
j++,
s = -
s) {
58 weights(
j) =
s / distances(
j);
63 weights(
N - 1) = 0.5 *
s / distances(
N - 1);
81 for (
size_t j = 0;
j <
N;
j++) {
88 double cj = (
j == 0 ||
j ==
N - 1) ? 2. : 1.;
89 for (
size_t k = 0; k <
N; k++) {
90 if (
j == 0 && k == 0) {
92 weightDerivatives(k) = -(cj * (
N - 1) * (
N - 1) + 1) / 6.0;
93 }
else if (
j ==
N - 1 && k ==
N - 1) {
95 weightDerivatives(k) = (cj * (
N - 1) * (
N - 1) + 1) / 6.0;
99 weightDerivatives(k) = -0.5 * xj / (1 - xj2);
103 double ck = (k == 0 || k ==
N - 1) ? 2. : 1.;
104 t = ((
j + k) % 2) == 0 ? 1 : -1;
105 weightDerivatives(k) = (cj / ck) *
t / (xj - xk);
108 return 2 * weightDerivatives / (
b -
a);
122 for (
size_t j = 0;
j <
N;
j++) {
123 if (
j == 0 ||
j ==
N - 1) {
129 t = (
j % 2 == 0) ? 1 : -1;
131 double c =
t / distances(
j);
133 k += (
w *
c / distances(
j));
139 for (
size_t j = 0;
j <
N;
j++,
s = -
s) {
142 if (
j == 0 ||
j ==
N - 1) {
148 weightDerivatives(
j) = (
w * -
s / (
g * distances(
j) * distances(
j))) -
149 (
w * -
s * k / (
g2 * distances(
j)));
152 return weightDerivatives;
166 for (
size_t i = 0;
i <
N;
i++) {
168 double ci = (
i == 0 ||
i ==
N - 1) ? 2. : 1.;
169 for (
size_t j = 0;
j <
N;
j++) {
170 if (
i == 0 &&
j == 0) {
172 D(
i,
j) = -(ci * (
N - 1) * (
N - 1) + 1) / 6.0;
173 }
else if (
i ==
N - 1 &&
j ==
N - 1) {
175 D(
i,
j) = (ci * (
N - 1) * (
N - 1) + 1) / 6.0;
177 double xi2 =
xi *
xi;
178 D(
i,
j) = -
xi / (2 * (1 - xi2));
181 double cj = (
j == 0 ||
j ==
N - 1) ? 2. : 1.;
182 t = ((
i +
j) % 2) == 0 ? 1 : -1;
183 D(
i,
j) = (ci / cj) *
t / (
xi - xj);
188 return D / ((
b -
a) / 2.0);
196 weights(0) = 0.5 * (
b -
a) / (
K2 +
K % 2 - 1);
197 weights(
N - 1) = weights(0);
199 size_t last_k =
K / 2 +
K % 2 - 1;
201 for (
size_t i = 1;
i <=
N - 2; ++
i) {
202 double theta =
i *
M_PI /
K;
203 weights(
i) = (
K % 2 == 0) ? 1 -
cos(
K * theta) / (
K2 - 1) : 1;
205 for (
size_t k = 1; k <= last_k; ++k)
206 weights(
i) -= 2 *
cos(2 * k * theta) / (4 * k * k - 1);
207 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 Dec 22 2024 04:11:14