diff options
author | martinroyer <16647869+martinroyer@users.noreply.github.com> | 2020-06-19 14:29:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-19 14:29:55 +0200 |
commit | 4a558f9542283533d1218a35ce43751615ca2ffd (patch) | |
tree | 95e9210fcc017afcda8af4b7bced51447d8e9631 /src/python/gudhi/representations | |
parent | 1abc47f5bf65ee3451a907ecfc9db84c0471ef93 (diff) |
fix for null inertias
Diffstat (limited to 'src/python/gudhi/representations')
-rw-r--r-- | src/python/gudhi/representations/vector_methods.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/python/gudhi/representations/vector_methods.py b/src/python/gudhi/representations/vector_methods.py index 566c24a3..aaf7ffeb 100644 --- a/src/python/gudhi/representations/vector_methods.py +++ b/src/python/gudhi/representations/vector_methods.py @@ -678,7 +678,7 @@ class Atol(BaseEstimator, TransformerMixin): self.inertias = np.array([np.max(dist_centers)/2]) else: dist_centers = pairwise.pairwise_distances(self.centers) - np.fill_diagonal(dist_centers, np.inf) + dist_centers[dist_centers == 0] = np.inf self.inertias = np.min(dist_centers, axis=0)/2 return self |