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 Merge Tree (and Persistence Diagram) barycenter precision #1048

Merged
merged 22 commits into from
Sep 2, 2024

Conversation

MatPont
Copy link
Contributor

@MatPont MatPont commented Aug 29, 2024

This PR fixes the precision problem of the functions updating the scalars of a barycenter of merge trees (or the special case of persistence diagrams).

The problem was that the new scalar values were computed using double variable, but then returned as a template type variable.
This cast can lead close but different values depending on the computers and this small difference quickly snowballs into bigger and more differences as iterations progress.
C-cast or static_cast can not fix this, so the fix consists in computing the new values directly in the template type instead of double.

@MatPont MatPont marked this pull request as draft August 29, 2024 14:31
@MatPont MatPont marked this pull request as ready for review August 31, 2024 15:08
@julien-tierny
Copy link
Collaborator

looks good, thanks!

@julien-tierny julien-tierny merged commit 9bfe75f into topology-tool-kit:dev Sep 2, 2024
45 checks passed
@MatPont MatPont deleted the pdBaryFix branch September 17, 2024 11:37
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.

2 participants