summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-05-21 08:45:04 +0200
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-05-21 08:45:04 +0200
commit4c64d290e1a0b6a3e702313302c394f74849121f (patch)
tree022b54cf0224789812f1070ba2a33fb21bf3ff7c
parent57eb31fdb537406925661dad84ef6d4b2e02b67b (diff)
parent96c3ce4adb7bd56b1bd8f1f62f1b7850ba640c48 (diff)
Merge remote-tracking branch 'mathieu/master' into fix_cubical_cofaces_of_pp_when_no_pairs
-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 3ace2517..28fbe3af 100644
--- a/src/python/gudhi/cubical_complex.pyx
+++ b/src/python/gudhi/cubical_complex.pyx
@@ -221,14 +221,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:])