summaryrefslogtreecommitdiff
path: root/src/python/gudhi/cubical_complex.pyx
diff options
context:
space:
mode:
authorMathieuCarriere <mathieu.carriere3@gmail.com>2020-05-20 14:13:49 -0400
committerMathieuCarriere <mathieu.carriere3@gmail.com>2020-05-20 14:13:49 -0400
commit0583c72cd729fb2d4a3e704949051e98b24726b3 (patch)
tree7b7bf6c89a2b6000335d7588efccc6e824dd2cb4 /src/python/gudhi/cubical_complex.pyx
parent5ed252a8758723f85840aee9874a191bd6cb1afc (diff)
fix bug
Diffstat (limited to 'src/python/gudhi/cubical_complex.pyx')
-rw-r--r--src/python/gudhi/cubical_complex.pyx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/python/gudhi/cubical_complex.pyx b/src/python/gudhi/cubical_complex.pyx
index ca979eda..ff0a9ed8 100644
--- a/src/python/gudhi/cubical_complex.pyx
+++ b/src/python/gudhi/cubical_complex.pyx
@@ -209,14 +209,14 @@ cdef class CubicalComplex:
ess_ind = np.argwhere(pr[:,2] == -1)[:,0]
ess = pr[ess_ind]
- max_h = max(ess[:,0])+1
+ max_h = max(ess[:,0])+1 if len(ess) > 0 else 0
for h in range(max_h):
hidxs = np.argwhere(ess[:,0] == h)[:,0]
output[1].append(ess[hidxs][:,1])
reg_ind = np.setdiff1d(np.array(range(len(pr))), ess_ind)
reg = pr[reg_ind]
- max_h = max(reg[:,0])+1
+ max_h = max(reg[:,0])+1 if len(reg) > 0 else 0
for h in range(max_h):
hidxs = np.argwhere(reg[:,0] == h)[:,0]
output[0].append(reg[hidxs][:,1:])