summaryrefslogtreecommitdiff
path: root/src/python/gudhi/periodic_cubical_complex.pyx
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2019-12-18 10:57:31 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2019-12-18 10:57:31 +0100
commit32a9c5e4df26e59f5f376e54c05c7bec92012cff (patch)
treeb225d1c125ddcfc3d3c7da228f8be5205a23f92d /src/python/gudhi/periodic_cubical_complex.pyx
parentb63be266effe24646823acc59fe397021bb13a3e (diff)
use ravel instead of flatten (that makes a copy) and no more converting to a list
Diffstat (limited to 'src/python/gudhi/periodic_cubical_complex.pyx')
-rw-r--r--src/python/gudhi/periodic_cubical_complex.pyx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/python/gudhi/periodic_cubical_complex.pyx b/src/python/gudhi/periodic_cubical_complex.pyx
index e623058a..c3d64123 100644
--- a/src/python/gudhi/periodic_cubical_complex.pyx
+++ b/src/python/gudhi/periodic_cubical_complex.pyx
@@ -83,8 +83,8 @@ cdef class PeriodicCubicalComplex:
elif ((dimensions is None) and (top_dimensional_cells is not None)
and (periodic_dimensions is not None) and (perseus_file == '')):
if isinstance(top_dimensional_cells, np.ndarray):
- dimensions = list(top_dimensional_cells.shape)
- top_dimensional_cells = top_dimensional_cells.flatten().tolist()
+ dimensions = top_dimensional_cells.shape
+ top_dimensional_cells = top_dimensional_cells.ravel(order='C')
self.thisptr = new Periodic_cubical_complex_base_interface(dimensions,
top_dimensional_cells,
periodic_dimensions)