Skip to content
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

Fixed interval computing + tests to validate it #29

Merged
merged 1 commit into from
May 24, 2015

Conversation

fdarricau
Copy link
Contributor

The loop in CubicBSpline::interval would never stop when t is on the end of the time interval.

if (t == knots_[static_cast<size_t>(imax+1)]) //We are exactly at the end of the spline
{
return imax;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you confirm that this only concerns the non-uniform case, this should be move inside the dichotomy block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.
It does not concern the uniform case. All knots-defined splines (Splines one creates with a knot vector) are concerned, even the uniform ones, but I think it indeed should be placed in the dichotomy block, as it is basically here to avoid the endless case at the end of it.

@fdarricau fdarricau force-pushed the master branch 2 times, most recently from 2519003 to 9a5e61b Compare May 24, 2015 14:58
@bchretien bchretien added the bug label May 24, 2015
if (t == knots_[static_cast<size_t>(imax+1)]) //We are exactly at the end of the spline
{
return imax;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the problem only concerns t = t_max, this check should not be in the inner while loop either, since this will be checked at every iteration of the dichotomy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that. I intended to put it out of the loop.
I fix it right now.

bchretien added a commit that referenced this pull request May 24, 2015
Fixed interval computing + tests to validate it
@bchretien bchretien merged commit b39027a into roboptim:master May 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants