mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-27 07:29:52 +08:00
Using LU decomposition with complete pivoting for better accuracy.
This commit is contained in:
parent
957c2c291b
commit
b59f045c07
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user