File tree 4 files changed +19
-12
lines changed
4 files changed +19
-12
lines changed Original file line number Diff line number Diff line change
1
+ # 0.6.5
2
+ - Bugfix for lower star filtrations with edges that come in at exactly 0 (courtesy of Riccardo Ceccaroni)
3
+
1
4
# 0.6.4
2
5
- Add some includes to ripser.cpp for newer Ubuntu/C++ environments
3
6
Original file line number Diff line number Diff line change 1
- __version__ = "0.6.4 "
1
+ __version__ = "0.6.5 "
Original file line number Diff line number Diff line change @@ -687,16 +687,14 @@ class ripser
687
687
v = dset.find (vertices_of_edge[1 ]);
688
688
689
689
if (u != v) {
690
- if (get_diameter (e) != 0 ) {
691
- // Elder rule; youngest class (max birth time of u and v)
692
- // dies first
693
- value_t birth =
694
- std::max (dset.get_birth (u), dset.get_birth (v));
695
- value_t death = get_diameter (e);
696
- if (death > birth) {
697
- births_and_deaths_by_dim[0 ].push_back (birth);
698
- births_and_deaths_by_dim[0 ].push_back (death);
699
- }
690
+ // Elder rule; youngest class (max birth time of u and v)
691
+ // dies first
692
+ value_t birth =
693
+ std::max (dset.get_birth (u), dset.get_birth (v));
694
+ value_t death = get_diameter (e);
695
+ if (death > birth) {
696
+ births_and_deaths_by_dim[0 ].push_back (birth);
697
+ births_and_deaths_by_dim[0 ].push_back (death);
700
698
}
701
699
dset.link (u, v);
702
700
} else
Original file line number Diff line number Diff line change @@ -19,4 +19,10 @@ def test_single_point(self):
19
19
assert dgm .shape [0 ] == 1
20
20
assert tuple (dgm [0 ]) == (0 ,np .inf )
21
21
22
-
22
+ def test_zero_edge_bug (self ):
23
+ img = np .ones ((5 , 5 ))
24
+ img [1 :- 1 , 1 :- 1 ] = 0
25
+ img [2 , 2 ] = 1
26
+ r1 = - lower_star_img (- img )
27
+ r2 = 1 - lower_star_img (1 - img )
28
+ assert (np .allclose (r1 , r2 ))
You can’t perform that action at this time.
0 commit comments