mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
IndexArray is now a typename.
Changed interpolate with derivatives test to use VERIFY_IS_APPROX.
This commit is contained in:
@@ -249,7 +249,7 @@ void check_global_interpolation_with_derivatives2d()
|
||||
Eigen::ChordLengths(points, knots);
|
||||
|
||||
ArrayXXd derivatives = ArrayXXd::Random(dimension, numPoints);
|
||||
Eigen::IndexArray derivativeIndices(numPoints);
|
||||
VectorXd derivativeIndices(numPoints);
|
||||
|
||||
for (Eigen::DenseIndex i = 0; i < numPoints; ++i)
|
||||
derivativeIndices(i) = i;
|
||||
@@ -261,18 +261,21 @@ void check_global_interpolation_with_derivatives2d()
|
||||
{
|
||||
PointType point = spline(knots(i));
|
||||
PointType referencePoint = points.col(i);
|
||||
VERIFY((point - referencePoint).matrix().norm() < 1e-10);
|
||||
VERIFY_IS_APPROX(point, referencePoint);
|
||||
PointType derivative = spline.derivatives(knots(i), 1).col(1);
|
||||
PointType referenceDerivative = derivatives.col(i);
|
||||
VERIFY((derivative - referenceDerivative).matrix().norm() < 1e-10);
|
||||
VERIFY_IS_APPROX(derivative, referenceDerivative);
|
||||
}
|
||||
}
|
||||
|
||||
void test_splines()
|
||||
{
|
||||
CALL_SUBTEST( eval_spline3d() );
|
||||
CALL_SUBTEST( eval_spline3d_onbrks() );
|
||||
CALL_SUBTEST( eval_closed_spline2d() );
|
||||
CALL_SUBTEST( check_global_interpolation2d() );
|
||||
CALL_SUBTEST( check_global_interpolation_with_derivatives2d() );
|
||||
for (int i = 0; i < g_repeat; ++i)
|
||||
{
|
||||
CALL_SUBTEST( eval_spline3d() );
|
||||
CALL_SUBTEST( eval_spline3d_onbrks() );
|
||||
CALL_SUBTEST( eval_closed_spline2d() );
|
||||
CALL_SUBTEST( check_global_interpolation2d() );
|
||||
CALL_SUBTEST( check_global_interpolation_with_derivatives2d() );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user