-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug in cubic B spline and enhance class #22
Fix bug in cubic B spline and enhance class #22
Conversation
- instead of comparing output stream, compare floating point values with a given threshold.
This but was effective only for non uniform splines.
👍 Looks good, thanks! However a test is missing for the new constructor. An example with non-uniform b-splines would probably be the best thing to do, since this was not really tested (and fixed) until now. Copying and adapting the |
- implement simpler dichotomy.
I have added a test that generates basis functions of non-uniform cubic B splines. |
{ | ||
i = Double2SizeType::convert | ||
(std::floor (static_cast<double> (imin) + (t - tmin) | ||
/ (tmax - tmin) * static_cast<double> (imax - imin))); | ||
(std::floor (static_cast<double> (.5*(imin + imax)+.5))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/home/travis/build/roboptim/roboptim-trajectory/src/cubic-b-spline.cc:196:53: error: conversion to ‘double’ from ‘roboptim::trajectory::Trajectory<3u>::size_type {aka long int}’ may alter its value [-Werror=conversion]
This should probably be:
(std::floor (.5 * static_cast<value_type> (imin + imax) + .5));
I fixed the warning. It compiles on my machine. |
Looks good. Just a question regarding d6c48e1 (first commit for the gradient test): was it related to a difference in the output for a different version of Eigen? Or a lack of precision in the output? |
The test failed because of numerical precision. At several places, the last decimal was different. I do not know precisely the reason, eigen version, different os... |
Fix bug in cubic B spline and enhance class
👍 |
Add a constructor with a vector of knots,
fix bug in computation of basis functions. The bug has no effect when knots are equally spaced.