aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jeff <complexzeros@gmail.com>2014-06-23 19:04:52 -0600
committerGravatar Jeff <complexzeros@gmail.com>2014-06-23 19:04:52 -0600
commitb59f045c07a41e79df9e27cd56ce06642a7012e7 (patch)
tree99b07c7b9777d1ea0eb040273b3c512db13c1869
parent957c2c291ba0e2d356584d833432a3314094dfee (diff)
Using LU decomposition with complete pivoting for better accuracy.
-rw-r--r--unsupported/Eigen/src/Splines/SplineFitting.h5
-rw-r--r--unsupported/test/splines.cpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/unsupported/Eigen/src/Splines/SplineFitting.h b/unsupported/Eigen/src/Splines/SplineFitting.h
index c30129983..3b8e70a18 100644
--- a/unsupported/Eigen/src/Splines/SplineFitting.h
+++ b/unsupported/Eigen/src/Splines/SplineFitting.h
@@ -17,6 +17,7 @@
#include "SplineFwd.h"
+#include <Eigen/LU>
#include <Eigen/QR>
namespace Eigen
@@ -404,8 +405,8 @@ namespace Eigen
A(n - 1, n - 1) = 1;
// Solve
- HouseholderQR<MatrixType> qr(A);
- ControlPointVectorType controlPoints = qr.solve(MatrixType(b.transpose())).transpose();
+ FullPivLU<MatrixType> lu(A);
+ ControlPointVectorType controlPoints = lu.solve(MatrixType(b.transpose())).transpose();
SplineType spline(knots, controlPoints);
diff --git a/unsupported/test/splines.cpp b/unsupported/test/splines.cpp
index 1f3856143..755a21ece 100644
--- a/unsupported/test/splines.cpp
+++ b/unsupported/test/splines.cpp
@@ -261,7 +261,7 @@ void check_global_interpolation_with_derivatives2d()
{
PointType point = spline(knots(i));
PointType referencePoint = points.col(i);
- VERIFY((point - referencePoint).matrix().norm() < 1e-12);
+ VERIFY((point - referencePoint).matrix().norm() < 1e-10);
PointType derivative = spline.derivatives(knots(i), 1).col(1);
PointType referenceDerivative = derivatives.col(i);
VERIFY((derivative - referenceDerivative).matrix().norm() < 1e-10);