Fits an interpolating spline to the given data points and derivatives.
312 typedef typename SplineType::ControlPointVectorType ControlPointVectorType;
314 typedef Matrix<Scalar, Dynamic, Dynamic>
MatrixType;
316 const DenseIndex n = points.cols() + derivatives.cols();
332 if (derivativeIndices[0] == 0) {
333 A.template block<1, 2>(1, 0) << -1, 1;
336 b.col(1) =
y * derivatives.col(0);
344 if (derivativeIndices[derivatives.cols() - 1] == points.cols() - 1) {
345 A.template block<1, 2>(
n - 2,
n - 2) << -1, 1;
348 b.col(
b.cols() - 2) =
y * derivatives.col(derivatives.cols() - 1);
356 if (derivativeIndex < derivativeIndices.size() && derivativeIndices[derivativeIndex] ==
i) {
358 SplineType::BasisFunctionDerivatives(parameters[
i], 1,
degree, knots);
360 b.col(
row++) = points.col(
i);
361 b.col(
row++) = derivatives.col(derivativeIndex++);
364 b.col(
row++) = points.col(
i);
367 b.col(0) = points.col(0);
368 b.col(
b.cols() - 1) = points.col(points.cols() - 1);
373 FullPivLU<MatrixType>
lu(
A);
374 ControlPointVectorType controlPoints =
lu.solve(
MatrixType(
b.transpose())).transpose();
376 SplineType spline(knots, controlPoints);
Scalar * b
Definition: benchVecAdd.cpp:17
cout<< "Here is the matrix m:"<< endl<< m<< endl;Eigen::FullPivLU< Matrix5x3 > lu(m)
void KnotAveragingWithDerivatives(const ParameterVectorType ¶meters, const unsigned int degree, const IndexArray &derivativeIndices, KnotVectorType &knots)
Computes knot averages when derivative constraints are present. Note that this is a technical interpr...
Definition: SplineFitting.h:78
Scalar * y
Definition: level1_cplx_impl.h:128