GUDHI / gudhi-devel

The GUDHI library is a generic open source C++ library, with a Python interface, for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.
https://gudhi.inria.fr/
MIT License
259 stars 66 forks source link

Cubical needs more explanations on the fortran ordering #593

Closed mglisse closed 1 year ago

mglisse commented 2 years ago

The C++ and Python documentations of Bitmap_cubical_complex do not clearly say how the dimensions should be interpreted (Fortran ordering). In Python, as long as people avoid the parameter dimensions (relying on the shape of the input array) and don't use cofaces_of_persistence_pairs, I think they don't need to know those details. But in C++, except possibly when constructing from a file or when the array is a square/cube (all dimensions are equal), this information is necessary.

Hind-M commented 2 years ago

IIUC, the construction in C++ is done following the dimensions argument given by the user as [number_of_lines, number_of_columns]. The fortran ordering is only done in python, before calling the C++ code, and only if dimensions is not set. https://github.com/GUDHI/gudhi-devel/blob/a43ca657787745e8b945943987b313106ec67f1f/src/python/gudhi/cubical_complex.pyx#L84-L88 But it should be documented indeed, I added a note in the python doc (cf. commit).