Go to the documentation of this file.
10 #ifndef EIGEN_SPLINE_H
11 #define EIGEN_SPLINE_H
34 template <
typename _Scalar,
int _Dim,
int _Degree>
80 template <
typename OtherVectorType,
typename OtherArrayType>
87 template <
int OtherDegree>
134 template <
int DerivativeOrder>
178 template <
int DerivativeOrder>
224 template <
typename DerivativeType>
233 template <
typename _Scalar,
int _Dim,
int _Degree>
240 if (u <= knots(0))
return degree;
245 template <
typename _Scalar,
int _Dim,
int _Degree>
271 N[r] = saved +
right(r+1)*tmp;
272 saved =
left(
j-r)*tmp;
279 template <
typename _Scalar,
int _Dim,
int _Degree>
283 return m_knots.size() - m_ctrls.cols() - 1;
288 template <
typename _Scalar,
int _Dim,
int _Degree>
294 template <
typename _Scalar,
int _Dim,
int _Degree>
305 return (ctrl_weights * ctrl_pts).rowwise().sum();
310 template <
typename SplineType,
typename DerivativeType>
315 enum { DerivativeOrder = DerivativeType::ColsAtCompileTime };
326 der.resize(Dimension,
n+1);
329 const BasisDerivativeType basis_func_ders = spline.template basisFunctionDerivatives<DerivativeOrder>(u,
n+1);
332 for (
DenseIndex der_order=0; der_order<
n+1; ++der_order)
336 der.col(der_order) = (ctrl_weights * ctrl_pts).rowwise().sum();
340 template <
typename _Scalar,
int _Dim,
int _Degree>
341 typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::DerivativeType
349 template <
typename _Scalar,
int _Dim,
int _Degree>
350 template <
int DerivativeOrder>
359 template <
typename _Scalar,
int _Dim,
int _Degree>
360 typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::BasisVectorType
369 template <
typename _Scalar,
int _Dim,
int _Degree>
370 template <
typename DerivativeType>
407 temp = ndu(r,
j-1)/ndu(
j,r);
409 ndu(r,
j) =
static_cast<Scalar>(saved+
right[r+1] * temp);
410 saved =
left[
j-r] * temp;
413 ndu(
j,
j) =
static_cast<Scalar>(saved);
416 for (
j =
p;
j>=0; --
j)
420 DerivativeType
a(
n+1,
p+1);
429 for (
DenseIndex k=1; k<=static_cast<DenseIndex>(
n); ++k)
437 a(s2,0) =
a(s1,0)/ndu(pk+1,rk);
438 d =
a(s2,0)*ndu(rk,pk);
444 if (r-1 <= pk) j2 = k-1;
447 for (
j=
j1;
j<=j2; ++
j)
449 a(s2,
j) = (
a(s1,
j)-
a(s1,
j-1))/ndu(pk+1,rk+
j);
450 d +=
a(s2,
j)*ndu(rk+
j,pk);
455 a(s2,k) = -
a(s1,k-1)/ndu(pk+1,r);
456 d +=
a(s2,k)*ndu(r,pk);
459 N_(k,r) =
static_cast<Scalar>(
d);
460 j = s1; s1 = s2; s2 =
j;
467 for (
DenseIndex k=1; k<=static_cast<DenseIndex>(
n); ++k)
469 for (
j=
p;
j>=0; --
j) N_(k,
j) *= r;
474 template <
typename _Scalar,
int _Dim,
int _Degree>
479 BasisFunctionDerivativesImpl(u, order,
degree(), knots(), der);
483 template <
typename _Scalar,
int _Dim,
int _Degree>
484 template <
int DerivativeOrder>
489 BasisFunctionDerivativesImpl(u, order,
degree(), knots(), der);
493 template <
typename _Scalar,
int _Dim,
int _Degree>
494 typename SplineTraits<Spline<_Scalar, _Dim, _Degree> >::BasisDerivativeType
502 BasisFunctionDerivativesImpl(u, order,
degree, knots, der);
507 #endif // EIGEN_SPLINE_H
Spline(const OtherVectorType &knots, const OtherArrayType &ctrls)
Creates a spline from a knot vector and control points.
Namespace containing all symbols from the Eigen library.
Expression of a fixed-size or dynamic-size block.
static const double d[K][N]
General-purpose arrays with easy API for coefficient-wise operations.
static BasisDerivativeType BasisFunctionDerivatives(const Scalar u, const DenseIndex order, const DenseIndex degree, const KnotVectorType &knots)
Computes the non-zero spline basis function derivatives up to given order.
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
SplineTraits< Spline >::BasisVectorType BasisVectorType
The data type used to store non-zero basis functions.
SplineTraits< Spline >::BasisDerivativeType BasisDerivativeType
The data type used to store the values of the basis function derivatives.
SplineTraits< Spline >::ControlPointVectorType ControlPointVectorType
The data type representing the spline's control points.
static void BasisFunctionDerivativesImpl(const typename Spline< _Scalar, _Dim, _Degree >::Scalar u, const DenseIndex order, const DenseIndex p, const typename Spline< _Scalar, _Dim, _Degree >::KnotVectorType &U, DerivativeType &N_)
SplineTraits< Spline >::ParameterVectorType ParameterVectorType
The data type used to store parameter vectors.
DenseIndex degree() const
Returns the spline degree.
Spline(const Spline< Scalar, Dimension, OtherDegree > &spline)
Copy constructor for splines.
const ControlPointVectorType & ctrls() const
Returns the ctrls of the underlying spline.
SplineTraits< Spline >::BasisVectorType basisFunctions(Scalar u) const
Computes the non-zero basis functions at the given site.
SplineTraits< Spline >::PointType PointType
The point type the spline is representing.
Expression of the multiple replication of a matrix or vector.
SplineTraits< Spline >::KnotVectorType KnotVectorType
The data type used to store knot vectors.
const KnotVectorType & knots() const
Returns the knots of the underlying spline.
PointType operator()(Scalar u) const
Returns the spline value at a given site .
Spline()
Creates a (constant) zero spline. For Splines with dynamic degree, the resulting degree will be 0.
SplineTraits< Spline >::DerivativeType derivatives(Scalar u, DenseIndex order) const
Evaluation of spline derivatives of up-to given order.
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
DenseIndex span(Scalar u) const
Returns the span within the knot vector in which u is falling.
SplineTraits< Spline >::BasisDerivativeType basisFunctionDerivatives(Scalar u, DenseIndex order) const
Computes the non-zero spline basis function derivatives up to given order.
static DenseIndex Span(typename SplineTraits< Spline >::Scalar u, DenseIndex degree, const typename SplineTraits< Spline >::KnotVectorType &knots)
Computes the span within the provided knot vector in which u is falling.
Expression of a fixed-size or dynamic-size sub-vector.
void derivativesImpl(const SplineType &spline, typename SplineType::Scalar u, DenseIndex order, DerivativeType &der)
The matrix class, also used for vectors and row-vectors.
Double_ distance(const OrientedPlane3_ &p)
const typedef Block< const Derived, 1, internal::traits< Derived >::ColsAtCompileTime, IsRowMajor > ConstRowXpr
static BasisVectorType BasisFunctions(Scalar u, DenseIndex degree, const KnotVectorType &knots)
Returns the spline's non-zero basis functions.
A class representing multi-dimensional spline curves.
ControlPointVectorType m_ctrls
gtsam
Author(s):
autogenerated on Thu Dec 19 2024 04:03:49