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

Fix issue when computing PH with maxdim == 0 #40

Merged
merged 5 commits into from
Nov 2, 2021
Merged

Conversation

MonkeyBreaker
Copy link
Collaborator

@MonkeyBreaker MonkeyBreaker commented Nov 2, 2021

This PR fixes issue #39 when computing persistent homology with the maximal dimension set to 0.

The issue was that in function compute_dim_0, we also prepare the columns to reduce for dimensions 1. But, when maxdim=0, we don't care about preparing those columns. Even worse was that get_zero_apparent_cofacet(e, 1) was assuming that we were always computing for maxdim>0.

This is now fixed by preparing the columns for dimension only if maxdim > 0.

julian added 2 commits November 2, 2021 08:11
Signed-off-by: julian <julian.burellaperez@heig-vd.ch>
get_zero_apparent_cofacet was assuming that we were calling the function
with maxdim > 0 inside of method compute_dim_0

Signed-off-by: julian <julian.burellaperez@heig-vd.ch>
@MonkeyBreaker MonkeyBreaker linked an issue Nov 2, 2021 that may be closed by this pull request
@MonkeyBreaker MonkeyBreaker mentioned this pull request Nov 2, 2021
gph/python/test/test_ripser.py Outdated Show resolved Hide resolved
gph/src/ripser.h Show resolved Hide resolved
Now the test also computes with maxdim == 1 and compares barcodes
in dimension 0 for both runs

Signed-off-by: julian <julian.burellaperez@heig-vd.ch>
gph/python/test/test_ripser.py Outdated Show resolved Hide resolved
Signed-off-by: julian <julian.burellaperez@heig-vd.ch>
gph/python/test/test_ripser.py Outdated Show resolved Hide resolved
gph/python/test/test_ripser.py Outdated Show resolved Hide resolved
Signed-off-by: julian <julian.burellaperez@heig-vd.ch>
Copy link
Collaborator

@ulupo ulupo left a comment

Choose a reason for hiding this comment

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

LGTM!

@MonkeyBreaker
Copy link
Collaborator Author

Thank you for all the review Umbe, if all test passes, I will merge the PR.

@ulupo
Copy link
Collaborator

ulupo commented Nov 2, 2021

@MonkeyBreaker sure! I prefer squash and merge for a cleaner history (not sure if this is what you prefer too)

@MonkeyBreaker
Copy link
Collaborator Author

@MonkeyBreaker sure! I prefer squash and merge for a cleaner history (not sure if this is what you prefer too)

I will then squash and merge, I prefer we stay consistent 😃

@MonkeyBreaker MonkeyBreaker merged commit 3bdc8fa into main Nov 2, 2021
@MonkeyBreaker MonkeyBreaker deleted the fix_maxdim_0 branch November 2, 2021 08:47
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.

maxdim=0
2 participants