ParameterMatrix as a separate static method
parent
3bff8ad317
commit
9ee652c04a
|
|
@ -34,6 +34,11 @@ struct GTSAM_EXPORT Chebyshev1Basis : Basis<Chebyshev1Basis> {
|
||||||
|
|
||||||
Parameters parameters_;
|
Parameters parameters_;
|
||||||
|
|
||||||
|
/// Return a zero initialized Parameter matrix.
|
||||||
|
static Parameters ParameterMatrix(size_t N) {
|
||||||
|
return Parameters::Zero(N);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Evaluate Chebyshev Weights on [-1,1] at x up to order N-1 (N values)
|
* @brief Evaluate Chebyshev Weights on [-1,1] at x up to order N-1 (N values)
|
||||||
*
|
*
|
||||||
|
|
@ -80,6 +85,11 @@ struct GTSAM_EXPORT Chebyshev1Basis : Basis<Chebyshev1Basis> {
|
||||||
struct GTSAM_EXPORT Chebyshev2Basis : Basis<Chebyshev2Basis> {
|
struct GTSAM_EXPORT Chebyshev2Basis : Basis<Chebyshev2Basis> {
|
||||||
using Parameters = Eigen::Matrix<double, -1, 1 /*Nx1*/>;
|
using Parameters = Eigen::Matrix<double, -1, 1 /*Nx1*/>;
|
||||||
|
|
||||||
|
/// Return a zero initialized Parameter matrix.
|
||||||
|
static Parameters ParameterMatrix(size_t N) {
|
||||||
|
return Parameters::Zero(N);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Evaluate Chebyshev Weights on [-1,1] at any x up to order N-1 (N values).
|
* Evaluate Chebyshev Weights on [-1,1] at any x up to order N-1 (N values).
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,11 @@ class GTSAM_EXPORT Chebyshev2 : public Basis<Chebyshev2> {
|
||||||
return points;
|
return points;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return a zero initialized Parameter matrix.
|
||||||
|
static Parameters ParameterMatrix(size_t N) {
|
||||||
|
return Parameters::Zero(N + 1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Evaluate Chebyshev Weights on [-1,1] at any x up to order N-1 (N values)
|
* Evaluate Chebyshev Weights on [-1,1] at any x up to order N-1 (N values)
|
||||||
* These weights implement barycentric interpolation at a specific x.
|
* These weights implement barycentric interpolation at a specific x.
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ class FitBasis {
|
||||||
const Sequence& sequence, const SharedNoiseModel& model, size_t N) {
|
const Sequence& sequence, const SharedNoiseModel& model, size_t N) {
|
||||||
NonlinearFactorGraph graph = NonlinearGraph(sequence, model, N);
|
NonlinearFactorGraph graph = NonlinearGraph(sequence, model, N);
|
||||||
Values values;
|
Values values;
|
||||||
values.insert<Parameters>(0, Parameters::Zero(N));
|
values.insert<Parameters>(0, Basis::ParameterMatrix(N));
|
||||||
GaussianFactorGraph::shared_ptr gfg = graph.linearize(values);
|
GaussianFactorGraph::shared_ptr gfg = graph.linearize(values);
|
||||||
return gfg;
|
return gfg;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,11 @@ class FourierBasis : public Basis<FourierBasis> {
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return a zero initialized Parameter matrix.
|
||||||
|
static Parameters ParameterMatrix(size_t N) {
|
||||||
|
return Parameters::Zero(N);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Evaluate Real Fourier Weights of size N in interval [a, b],
|
* @brief Evaluate Real Fourier Weights of size N in interval [a, b],
|
||||||
* e.g. N=5 yields bases: 1, cos(x), sin(x), cos(2*x), sin(2*x)
|
* e.g. N=5 yields bases: 1, cos(x), sin(x), cos(2*x), sin(2*x)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue