File tree Expand file tree Collapse file tree 4 files changed +19
-12
lines changed Expand file tree Collapse file tree 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+
14# 0.6.4
25 - Add some includes to ripser.cpp for newer Ubuntu/C++ environments
36
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
687687 v = dset.find (vertices_of_edge[1 ]);
688688
689689 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);
700698 }
701699 dset.link (u, v);
702700 } else
Original file line number Diff line number Diff line change @@ -19,4 +19,10 @@ def test_single_point(self):
1919 assert dgm .shape [0 ] == 1
2020 assert tuple (dgm [0 ]) == (0 ,np .inf )
2121
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