Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

[Persistence_representations - Persistence_heat_maps] Simplify distance_from_diagonal_scaling #19

Open
VincentRouvreau opened this issue Mar 7, 2019 · 1 comment

Comments

@VincentRouvreau
Copy link
Contributor

distance_from_diagonal_scaling and squared_distance_from_diagonal_scaling have complicated implementations with pow, sqrt, etc (all missing std::). As far as I can tell, up to a multiplicative constant (which we can probably omit), the first one should be just std::abs(p.second-p.first) and the second one the square of p.second-p.first.

@mglisse
Copy link
Member

mglisse commented Jan 3, 2020

It actually computes the projection on the diagonal (b+d)/2, and then the squared distance to that. It happens to be equal to |d-b|/sqrt(2). When computing the distance to the diagonal, Manhattan, Chebyshev and Euclidean are all proportional.

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

No branches or pull requests

2 participants