Fix issue with dijkstra algorithm#1497
Merged
jdumas merged 4 commits intolibigl:masterfrom May 14, 2020
Merged
Conversation
Contributor
Author
|
Added a test case. |
Collaborator
|
Seems it's missing some explicit template instantiation for the static lib version of libigl. |
Contributor
Author
|
That's seems to have done the trick. |
jdumas
approved these changes
May 14, 2020
Collaborator
|
Awesome, thanks! |
skoch9
pushed a commit
to skoch9/libigl
that referenced
this pull request
Jun 3, 2020
* Use ::max vs ::infinity in dijkstra * Add test case for discrete dijkstra distances * Update dijkstra.cpp * Explicit template instantiation for dijkstra test Co-authored-by: Jérémie Dumas <jdumas@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On my system (
gcc --version: g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0), dijkstra doesn't work in the case below. It doesn't matter what the mesh is, you can test with your favorite one.std::numeric_limits<DerivedD::Scalar>::infinity()returns 0 in this case, which leads to the algorithm not finding the target and returning -1. Infinity probably only works with float values.Before the change
successwould be-1. After the change, it returns the index for the target found andmin_distanceis correctly populated. Should probably add a unit test, but did not have time just now to figure out how to run the corresponding test.Check all that apply (change to
[x])