aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported
diff options
context:
space:
mode:
authorGravatar Jeff <complexzeros@gmail.com>2014-07-10 12:03:42 -0600
committerGravatar Jeff <complexzeros@gmail.com>2014-07-10 12:03:42 -0600
commitb1169ce40cf615ec2cd8eb116ae905b48a849a3a (patch)
tree0fd9997417252e1e4bbe06d55f3889bcfd273a02 /unsupported
parent08c615f1e425d6749ef45ffcbf574e550ba02fea (diff)
Fixed index that would cause crash with two point, two derivative interpolation. Added static_cast.
Diffstat (limited to 'unsupported')
-rw-r--r--unsupported/Eigen/src/Splines/SplineFitting.h2
-rw-r--r--unsupported/test/splines.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/unsupported/Eigen/src/Splines/SplineFitting.h b/unsupported/Eigen/src/Splines/SplineFitting.h
index 85de38b25..d3c245fa9 100644
--- a/unsupported/Eigen/src/Splines/SplineFitting.h
+++ b/unsupported/Eigen/src/Splines/SplineFitting.h
@@ -128,7 +128,7 @@ namespace Eigen
newKnotIndex = -1;
- ParameterVectorType temporaryParameters(numParameters);
+ ParameterVectorType temporaryParameters(numParameters + 1);
KnotVectorType derivativeKnots(numInternalDerivatives);
for (unsigned int i = 0; i < numAverageKnots - 1; ++i)
{
diff --git a/unsupported/test/splines.cpp b/unsupported/test/splines.cpp
index 0b43eefb8..97665af96 100644
--- a/unsupported/test/splines.cpp
+++ b/unsupported/test/splines.cpp
@@ -252,7 +252,7 @@ void check_global_interpolation_with_derivatives2d()
VectorXd derivativeIndices(numPoints);
for (Eigen::DenseIndex i = 0; i < numPoints; ++i)
- derivativeIndices(i) = i;
+ derivativeIndices(i) = static_cast<double>(i);
const Spline2d spline = SplineFitting<Spline2d>::InterpolateWithDerivatives(
points, derivatives, derivativeIndices, degree);