Commit b33b907d authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

[Test] add test-case for cubic-hermite compute_derivate

parent 129b0aa2
Pipeline #9458 failed with stage
in 4 minutes and 14 seconds
......@@ -1071,6 +1071,22 @@ void CubicHermitePairsPositionDerivativeTest(bool& error) {
ComparePoints(t1, res1, errmsg3, error);
res1 = cubic_hermite_spline_2Pairs.derivate(1., 1);
ComparePoints(t2, res1, errmsg3, error);
pointX_t p_derivate, p_compute_derivate;
for(size_t order = 1 ; order < 5 ; ++order){
std::stringstream ss;
ss <<"in Cubic Hermite 2 points, "
"compute_derivate do not lead to the same results as derivate for order = ";
ss << order << std::endl;
curve_ptr_t derivate_ptr(cubic_hermite_spline_2Pairs.compute_derivate_ptr(order));
double t = 0.;
while(t <= 1.){
p_derivate = cubic_hermite_spline_2Pairs.derivate(t, order);
p_compute_derivate = derivate_ptr->operator()(t);
ComparePoints(p_derivate, p_compute_derivate, ss.str(), error);
t += 0.1;
}
}
} catch (...) {
error = true;
std::cout << "Error in CubicHermitePairsPositionDerivativeTest" << std::endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment