mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-24 07:13:16 +08:00
Fixed index that would cause crash with two point, two derivative interpolation. Added static_cast.
This commit is contained in:
parent
08c615f1e4
commit
b1169ce40c
@ -128,7 +128,7 @@ namespace Eigen
|
|||||||
|
|
||||||
newKnotIndex = -1;
|
newKnotIndex = -1;
|
||||||
|
|
||||||
ParameterVectorType temporaryParameters(numParameters);
|
ParameterVectorType temporaryParameters(numParameters + 1);
|
||||||
KnotVectorType derivativeKnots(numInternalDerivatives);
|
KnotVectorType derivativeKnots(numInternalDerivatives);
|
||||||
for (unsigned int i = 0; i < numAverageKnots - 1; ++i)
|
for (unsigned int i = 0; i < numAverageKnots - 1; ++i)
|
||||||
{
|
{
|
||||||
|
@ -252,7 +252,7 @@ void check_global_interpolation_with_derivatives2d()
|
|||||||
VectorXd derivativeIndices(numPoints);
|
VectorXd derivativeIndices(numPoints);
|
||||||
|
|
||||||
for (Eigen::DenseIndex i = 0; i < numPoints; ++i)
|
for (Eigen::DenseIndex i = 0; i < numPoints; ++i)
|
||||||
derivativeIndices(i) = i;
|
derivativeIndices(i) = static_cast<double>(i);
|
||||||
|
|
||||||
const Spline2d spline = SplineFitting<Spline2d>::InterpolateWithDerivatives(
|
const Spline2d spline = SplineFitting<Spline2d>::InterpolateWithDerivatives(
|
||||||
points, derivatives, derivativeIndices, degree);
|
points, derivatives, derivativeIndices, degree);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user