diff options
Diffstat (limited to 'src/Bitmap_cubical_complex')
-rw-r--r-- | src/Bitmap_cubical_complex/doc/Gudhi_Cubical_Complex_doc.h | 53 | ||||
-rw-r--r-- | src/Bitmap_cubical_complex/utilities/CMakeLists.txt | 20 | ||||
-rw-r--r-- | src/Bitmap_cubical_complex/utilities/README | 24 | ||||
-rw-r--r-- | src/Bitmap_cubical_complex/utilities/cubical_complex_persistence.cpp (renamed from src/Bitmap_cubical_complex/utilities/Bitmap_cubical_complex.cpp) | 0 | ||||
-rw-r--r-- | src/Bitmap_cubical_complex/utilities/periodic_cubical_complex_persistence.cpp (renamed from src/Bitmap_cubical_complex/utilities/Bitmap_cubical_complex_periodic_boundary_conditions.cpp) | 0 |
5 files changed, 25 insertions, 72 deletions
diff --git a/src/Bitmap_cubical_complex/doc/Gudhi_Cubical_Complex_doc.h b/src/Bitmap_cubical_complex/doc/Gudhi_Cubical_Complex_doc.h index daba15a4..ee84e201 100644 --- a/src/Bitmap_cubical_complex/doc/Gudhi_Cubical_Complex_doc.h +++ b/src/Bitmap_cubical_complex/doc/Gudhi_Cubical_Complex_doc.h @@ -63,7 +63,7 @@ namespace cubical_complex { * For further details and theory of cubical complexes, please consult \cite kaczynski2004computational as well as the * following paper \cite peikert2012topological . * - * \section cubicalcomplexdatastructure Data structure. + * \section cubicalcomplexdatastructure Data structure * * The implementation of Cubical complex provides a representation of complexes that occupy a rectangular region in * \f$\mathbb{R}^n\f$. This extra assumption allows for a memory efficient way of storing cubical complexes in a form @@ -85,37 +85,14 @@ namespace cubical_complex { * present in the product that gives the cube \f$C\f$. In a similar way, we can compute boundary and the coboundary of * each cube. Further details can be found in the literature. * - * \section inputformat Input Format. + * \section inputformat Input Format * * In the current implantation, filtration is given at the maximal cubes, and it is then extended by the lower star * filtration to all cubes. There are a number of constructors that can be used to construct cubical complex by users * who want to use the code directly. They can be found in the \a Bitmap_cubical_complex class. * Currently one input from a text file is used. It uses a format used already in Perseus software - * (http://www.sas.upenn.edu/~vnanda/perseus/) by Vidit Nanda. - * Below we are providing a description of the format. The first line contains a number d begin the dimension of the - * bitmap (2 in the example below). Next d lines are the numbers of top dimensional cubes in each dimensions (3 and 3 - * in the example below). Next, in lexicographical order, the filtration of top dimensional cubes is given (1 4 6 8 - * 20 4 7 6 5 in the example below). - * - * - * \image html "exampleBitmap.png" "Example of a input data." - * - * The input file for the following complex is: - * \verbatim -2 -3 -3 -1 -4 -6 -8 -20 -4 -7 -6 -5 -\endverbatim - + * (http://www.sas.upenn.edu/~vnanda/perseus/) by Vidit Nanda. The file format is described here: \ref FileFormatsPerseus. + * * \section PeriodicBoundaryConditions Periodic boundary conditions * Often one would like to impose periodic boundary conditions to the cubical complex. Let \f$ I_1\times ... \times * I_n \f$ be a box that is decomposed with a cubical complex \f$ \mathcal{K} \f$. Imposing periodic boundary @@ -123,26 +100,8 @@ namespace cubical_complex { * considered the same. In particular, if for a bitmap \f$ \mathcal{K} \f$ periodic boundary conditions are imposed * in all directions, then complex \f$ \mathcal{K} \f$ became n-dimensional torus. One can use various constructors * from the file Bitmap_cubical_complex_periodic_boundary_conditions_base.h to construct cubical complex with periodic - * boundary conditions. One can also use Perseus style input files. To indicate periodic boundary conditions in a - * given direction, then number of top dimensional cells in this direction have to be multiplied by -1. For instance: - - *\verbatim -2 --3 -3 -1 -4 -6 -8 -20 -4 -7 -6 -5 -\endverbatim - - * Indicate that we have imposed periodic boundary conditions in the direction x, but not in the direction y. - + * boundary conditions. One can also use Perseus style input files (see \ref FileFormatsPerseus). + * * \section BitmapExamples Examples * End user programs are available in example/Bitmap_cubical_complex and utilities/Bitmap_cubical_complex folders. * diff --git a/src/Bitmap_cubical_complex/utilities/CMakeLists.txt b/src/Bitmap_cubical_complex/utilities/CMakeLists.txt index f0f80059..676a730a 100644 --- a/src/Bitmap_cubical_complex/utilities/CMakeLists.txt +++ b/src/Bitmap_cubical_complex/utilities/CMakeLists.txt @@ -1,29 +1,29 @@ cmake_minimum_required(VERSION 2.6) project(Bitmap_cubical_complex_utilities) -add_executable ( Bitmap_cubical_complex Bitmap_cubical_complex.cpp ) +add_executable ( cubical_complex_persistence cubical_complex_persistence.cpp ) if (TBB_FOUND) - target_link_libraries(Bitmap_cubical_complex ${TBB_LIBRARIES}) + target_link_libraries(cubical_complex_persistence ${TBB_LIBRARIES}) endif() -add_test(NAME Bitmap_cubical_complex_utility_persistence_one_sphere COMMAND $<TARGET_FILE:Bitmap_cubical_complex> +add_test(NAME Bitmap_cubical_complex_utility_persistence_one_sphere COMMAND $<TARGET_FILE:cubical_complex_persistence> "${CMAKE_SOURCE_DIR}/data/bitmap/CubicalOneSphere.txt") -add_test(NAME Bitmap_cubical_complex_utility_persistence_two_sphere COMMAND $<TARGET_FILE:Bitmap_cubical_complex> +add_test(NAME Bitmap_cubical_complex_utility_persistence_two_sphere COMMAND $<TARGET_FILE:cubical_complex_persistence> "${CMAKE_SOURCE_DIR}/data/bitmap/CubicalTwoSphere.txt") -add_executable ( Bitmap_cubical_complex_periodic_boundary_conditions Bitmap_cubical_complex_periodic_boundary_conditions.cpp ) +add_executable ( periodic_cubical_complex_persistence periodic_cubical_complex_persistence.cpp ) if (TBB_FOUND) - target_link_libraries(Bitmap_cubical_complex_periodic_boundary_conditions ${TBB_LIBRARIES}) + target_link_libraries(periodic_cubical_complex_persistence ${TBB_LIBRARIES}) endif() add_test(NAME Bitmap_cubical_complex_utility_periodic_boundary_conditions_2d_torus - COMMAND $<TARGET_FILE:Bitmap_cubical_complex_periodic_boundary_conditions> + COMMAND $<TARGET_FILE:periodic_cubical_complex_persistence> "${CMAKE_SOURCE_DIR}/data/bitmap/2d_torus.txt") add_test(NAME Bitmap_cubical_complex_utility_periodic_boundary_conditions_3d_torus - COMMAND $<TARGET_FILE:Bitmap_cubical_complex_periodic_boundary_conditions> + COMMAND $<TARGET_FILE:periodic_cubical_complex_persistence> "${CMAKE_SOURCE_DIR}/data/bitmap/3d_torus.txt") -install(TARGETS Bitmap_cubical_complex DESTINATION bin) -install(TARGETS Bitmap_cubical_complex_periodic_boundary_conditions DESTINATION bin) +install(TARGETS cubical_complex_persistence DESTINATION bin) +install(TARGETS periodic_cubical_complex_persistence DESTINATION bin) diff --git a/src/Bitmap_cubical_complex/utilities/README b/src/Bitmap_cubical_complex/utilities/README index d9085635..ddff7034 100644 --- a/src/Bitmap_cubical_complex/utilities/README +++ b/src/Bitmap_cubical_complex/utilities/README @@ -1,24 +1,18 @@ # Bitmap_cubical_complex #
-## `Bitmap_cubical_complex` ##
-This program computes persistent homology, by using the Bitmap_cubical_complex class, of cubical complexes provided in text files in Perseus style. The only number in the first line is a dimension D of a bitmap. In the lines I between 2 and D+1 there are numbers of top dimensional cells in the direction I. Let N denote product of the numbers in the lines between 2 and D. In the lines D+2 to D+2+N there are filtrations of top dimensional cells. We assume that the cells are in the lexicographical order.
+## `cubical_complex_persistence` ##
+This program computes persistent homology, by using the Bitmap_cubical_complex class, of cubical complexes provided in text files in Perseus style. See [here](http://gudhi.gforge.inria.fr/doc/latest/fileformats.html#FileFormatsPerseus) for a description of the file format.
-Examples:
+Example:
-* Create a Cubical Complex from the Perseus style file CubicalOneSphere.txt, computes Persistence cohomology from it and writes the results in a persistence file:
-`Bitmap_cubical_complex data/bitmap/CubicalOneSphere.txt`
+* Create a Cubical Complex from the Perseus style file `CubicalTwoSphere.txt`, computes Persistence cohomology from it and writes the results in a persistence file `CubicalTwoSphere.txt_persistence`:
+`cubical_complex_persistence data/bitmap/CubicalTwoSphere.txt`
-* Create a Cubical Complex from the Perseus style file CubicalTwoSphere.txt, computes Persistence cohomology from it and writes the results in a persistence file:
-`Bitmap_cubical_complex data/bitmap/CubicalTwoSphere.txt`
-
-## `Bitmap_cubical_complex_periodic_boundary_conditions` ##
+## `periodic_cubical_complex_persistence` ##
Same as above, but with periodic boundary conditions.
-Examples:
-
-* Create a Periodical Cubical Complex from the Perseus style file 2d_torus.txt, computes Persistence cohomology from it and writes the results in a persistence file:
-`Bitmap_cubical_complex_periodic_boundary_conditions.exe data/bitmap/2d_torus.txt`
+Example:
-* Create a Periodical Cubical Complex from the Perseus style file 3d_torus.txt, computes Persistence cohomology from it and writes the results in a persistence file:
-`Bitmap_cubical_complex_periodic_boundary_conditions.exe data/bitmap/3d_torus.txt`
+* Create a Periodical Cubical Complex from the Perseus style file `3d_torus.txt`, computes Persistence cohomology from it and writes the results in a persistence file `3d_torus.txt_persistence`:
+`periodic_cubical_complex_persistence data/bitmap/3d_torus.txt`
diff --git a/src/Bitmap_cubical_complex/utilities/Bitmap_cubical_complex.cpp b/src/Bitmap_cubical_complex/utilities/cubical_complex_persistence.cpp index 9d1bc08c..9d1bc08c 100644 --- a/src/Bitmap_cubical_complex/utilities/Bitmap_cubical_complex.cpp +++ b/src/Bitmap_cubical_complex/utilities/cubical_complex_persistence.cpp diff --git a/src/Bitmap_cubical_complex/utilities/Bitmap_cubical_complex_periodic_boundary_conditions.cpp b/src/Bitmap_cubical_complex/utilities/periodic_cubical_complex_persistence.cpp index c812cb3a..c812cb3a 100644 --- a/src/Bitmap_cubical_complex/utilities/Bitmap_cubical_complex_periodic_boundary_conditions.cpp +++ b/src/Bitmap_cubical_complex/utilities/periodic_cubical_complex_persistence.cpp |