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

Replace USE_COEFFICIENTS with templates #116

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

reds-heig
Copy link

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 with coeff==2:

Dataset size threshold dim coeff with USE_COEFF [s] templated [s]
sphere3 192 2 2 1.4 1.1
dragon 2000 1 2 2.6 2.2
o3 1024 1.8 3 2 2.3 2.0
random16 50 7 2 6.2 5.9
fractal 512 2 2 15 14
o3 4096 1.4 3 2 53.9 50

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 class
  • get_edges isn't anymore a method of ripser class but a friend function
  • get_vertex_birth isn't anymore a method of ripser class but a friend function

I 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 and get_vertex_birth

Additional stuff I could add:

  • Update Changelog
  • Refactor C++ backend with .clang-format of ripser (I found the file)
  • Documentation ??

Best,
Julián

julian added 3 commits March 1, 2021 15:06
Signed-off-by: julian <julian.burellaperez@heig-vd.ch>
Signed-off-by: julian <julian.burellaperez@heig-vd.ch>
Signed-off-by: julian <julian.burellaperez@heig-vd.ch>
@codecov
Copy link

codecov bot commented Mar 1, 2021

Codecov Report

Merging #116 (452fda3) into master (f784e1f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #116   +/-   ##
=======================================
  Coverage   96.75%   96.75%           
=======================================
  Files           3        3           
  Lines         154      154           
  Branches       26       26           
=======================================
  Hits          149      149           
  Misses          4        4           
  Partials        1        1           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f784e1f...0b267eb. Read the comment docs.

Signed-off-by: julian <julian.burellaperez@heig-vd.ch>
@MonkeyBreaker
Copy link
Contributor

One last point, please feel free to validate from your side, I tried to run with different modulus variables and so far I got expected results. But if on your side you have some use cases with modulus>2, validate it on your side, so I can be more confident I didn't break anything :)

Now that USE_COEFFICIENTS is removed, the conditions in check_overflow needs to support the different check depending on modulus value

Signed-off-by: julian <julian.burellaperez@heig-vd.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants