Replace USE_COEFFICIENTS with templates #116
Open
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.
Hello !
This PR remove USE_COEFFICIENTS define in the C++ code and replace all the related code with templates.
Now, when running Ripser with
modulus==2
the computation should be slightly faster. Following tables shows some datasets run withcoeff==2
:About the changes done inside the C++, I'm currently not happy with my solution of removing because of:
simplex_coboundary_enumerator
isn't anymore a nested class but a friend classget_edges
isn't anymore a method ofripser
class but a friend functionget_vertex_birth
isn't anymore a method ofripser
class but a friend functionI needed to remove
simplex_coboundary_enumerator
from a nested class, because I could not find a solution to partial specialization, but please feel free if you have a better alternative !Same remark for
get_edges
andget_vertex_birth
Additional stuff I could add:
.clang-format
ofripser
(I found the file)Best,
Julián