diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-08-05 15:40:01 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-08-05 15:40:01 +0000 |
commit | 8ce416a795b99cb396e650b9a3512c3c23d8a9f6 (patch) | |
tree | 4f80eb23b48e09cbee53342048d845c2e4b203b3 | |
parent | 310818dff6f4a63aa500cf7ade6cc63f983ec9e3 (diff) |
Documentation
Examples renaming
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@1425 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 09bc66a795a4e4f5b2a484c607daa12b1e97b4de
-rw-r--r-- | src/cython/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/cython/doc/source/alpha_complex_ref.rst | 3 | ||||
-rw-r--r-- | src/cython/doc/source/alpha_complex_sum.rst | 21 | ||||
-rw-r--r-- | src/cython/doc/source/alpha_complex_user.rst | 15 | ||||
-rw-r--r-- | src/cython/doc/source/cubical_complex_sum.rst | 11 | ||||
-rw-r--r-- | src/cython/doc/source/cubical_complex_user.rst | 10 | ||||
-rw-r--r-- | src/cython/doc/source/index.rst | 42 | ||||
-rw-r--r-- | src/cython/doc/source/simplex_tree_ref.rst | 10 | ||||
-rw-r--r-- | src/cython/doc/source/simplex_tree_sum.rst | 14 | ||||
-rw-r--r-- | src/cython/doc/source/simplex_tree_user.rst | 8 | ||||
-rw-r--r-- | src/cython/doc/source/witness_complex_ref.rst | 10 | ||||
-rw-r--r-- | src/cython/doc/source/witness_complex_sum.rst | 21 | ||||
-rw-r--r-- | src/cython/doc/source/witness_complex_user.rst | 8 | ||||
-rwxr-xr-x | src/cython/example/alpha_complex_from_file_example.py | 8 | ||||
-rwxr-xr-x | src/cython/example/alpha_complex_from_points_example.py (renamed from src/cython/example/alpha_complex_from_points.py) | 0 | ||||
-rw-r--r-- | src/cython/src/cython/rips_complex.pyx | 18 |
16 files changed, 144 insertions, 58 deletions
diff --git a/src/cython/CMakeLists.txt b/src/cython/CMakeLists.txt index 3989d5a1..19289977 100644 --- a/src/cython/CMakeLists.txt +++ b/src/cython/CMakeLists.txt @@ -72,7 +72,8 @@ if(PYTHON_PATH AND CYTHON_PATH) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND python "${CMAKE_CURRENT_BINARY_DIR}/cythonize_gudhi.py" "build_ext" "--inplace") - add_custom_target(cythonize_gudhi ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/gudhi.so") + add_custom_target(cythonize_gudhi ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/gudhi.so" + COMMENT "Do not forget to add ${CMAKE_CURRENT_BINARY_DIR}/gudhi.so to your PYTHONPATH before using examples") # Unitary tests are available through py.test find_program( PYTEST_PATH py.test ) diff --git a/src/cython/doc/source/alpha_complex_ref.rst b/src/cython/doc/source/alpha_complex_ref.rst index ab81eee0..6a122b09 100644 --- a/src/cython/doc/source/alpha_complex_ref.rst +++ b/src/cython/doc/source/alpha_complex_ref.rst @@ -1,5 +1,6 @@ +============================== Alpha complex reference manual -############################## +============================== .. autoclass:: gudhi.AlphaComplex :members: diff --git a/src/cython/doc/source/alpha_complex_sum.rst b/src/cython/doc/source/alpha_complex_sum.rst new file mode 100644 index 00000000..b608050e --- /dev/null +++ b/src/cython/doc/source/alpha_complex_sum.rst @@ -0,0 +1,21 @@ +===================================== ===================================== ===================================== +:Author: Vincent Rouvreau :Introduced in: GUDHI PYTHON 1.4.0 :Copyright: GPL v3 +===================================== ===================================== ===================================== + ++-------------------------------------------+----------------------------------------------------------------------+ +| .. image:: | Alpha_complex is a simplicial complex constructed from the finite | +| img/alpha_complex_representation.png | cells of a Delaunay Triangulation. | +| | | +| | The filtration value of each simplex is computed as the square of the| +| | circumradius of the simplex if the circumsphere is empty (the simplex| +| | is then said to be Gabriel), and as the minimum of the filtration | +| | values of the codimension 1 cofaces that make it not Gabriel | +| | otherwise. All simplices that have a filtration value strictly | +| | greater than a given alpha squared value are not inserted into the | +| | complex. | +| | | +| | This package requires having CGAL version 4.7 or higher (4.8.1 is | +| | advised for better perfomances). | ++-------------------------------------------+----------------------------------------------------------------------+ +| :doc:`alpha_complex_user` | :doc:`alpha_complex_ref` | ++-------------------------------------------+----------------------------------------------------------------------+ diff --git a/src/cython/doc/source/alpha_complex_user.rst b/src/cython/doc/source/alpha_complex_user.rst index 3b445d13..ba920fe3 100644 --- a/src/cython/doc/source/alpha_complex_user.rst +++ b/src/cython/doc/source/alpha_complex_user.rst @@ -1,8 +1,15 @@ +========================= Alpha complex user manual -######################### +========================= +Definition +---------- -blablabla +.. include:: alpha_complex_sum.rst -.. image:: img/alpha_complex_representation.png - :align: center +Alpha_complex is constructing a Simplex_tree using Delaunay Triangulation from +CGAL (the Computational Geometry Algorithms Library). +The complex is a template class requiring an Epick_d dD Geometry Kernel [16] from CGAL as template parameter. + +Remarks + When Alpha_complex is constructed with an infinite value of alpha, the complex is a Delaunay complex.
\ No newline at end of file diff --git a/src/cython/doc/source/cubical_complex_sum.rst b/src/cython/doc/source/cubical_complex_sum.rst new file mode 100644 index 00000000..60b47f54 --- /dev/null +++ b/src/cython/doc/source/cubical_complex_sum.rst @@ -0,0 +1,11 @@ +===================================== ===================================== ===================================== +:Author: Pawel Dlotko :Introduced in: GUDHI PYTHON 1.4.0 :Copyright: GPL v3 +===================================== ===================================== ===================================== + ++---------------------------------------------+----------------------------------------------------------------------+ +| .. image:: | The cubical complex is an example of a structured complex useful in | +| img/Cubical_complex_representation.png | computational mathematics (specially rigorous numerics) and image | +| | analysis. | ++---------------------------------------------+----------------------------------------------------------------------+ +| :doc:`cubical_complex_user` | :doc:`cubical_complex_ref` | ++---------------------------------------------+----------------------------------------------------------------------+ diff --git a/src/cython/doc/source/cubical_complex_user.rst b/src/cython/doc/source/cubical_complex_user.rst index 7ade4b86..6ae67940 100644 --- a/src/cython/doc/source/cubical_complex_user.rst +++ b/src/cython/doc/source/cubical_complex_user.rst @@ -1,8 +1,8 @@ +========================= Cubical complex user manual -########################### +========================= +Definition +---------- -blablabla - -.. image:: img/Cubical_complex_representation.png - :align: center +.. include:: cubical_complex_sum.rst diff --git a/src/cython/doc/source/index.rst b/src/cython/doc/source/index.rst index d08b465c..2b17464a 100644 --- a/src/cython/doc/source/index.rst +++ b/src/cython/doc/source/index.rst @@ -38,56 +38,22 @@ Data structures Alpha complex ============= -===================================== ===================================== ===================================== -:Author: Vincent Rouvreau :Introduced in: GUDHI PYTHON 1.4.0 :Copyright: GPL v3 -===================================== ===================================== ===================================== - -+-------------------------------------------+----------------------------------------------------------------------+ -| .. image:: | Alpha_complex is a simplicial complex constructed from the finite | -| img/alpha_complex_representation.png | cells of a Delaunay Triangulation. | -| | | -| | The filtration value of each simplex is computed as the square of the| -| | circumradius of the simplex if the circumsphere is empty (the simplex| -| | is then said to be Gabriel), and as the minimum of the filtration | -| | values of the codimension 1 cofaces that make it not Gabriel | -| | otherwise. All simplices that have a filtration value strictly | -| | greater than a given alpha squared value are not inserted into the | -| | complex. | -| | | -| | This package requires having CGAL version 4.7 or higher (4.8.1 is | -| | advised for better perfomances). | -+-------------------------------------------+----------------------------------------------------------------------+ -| :doc:`alpha_complex_user` | :doc:`alpha_complex_ref` | -+-------------------------------------------+----------------------------------------------------------------------+ +.. include:: alpha_complex_sum.rst Cubical complex =============== -===================================== ===================================== ===================================== -:Author: Pawel Dlotko :Introduced in: GUDHI PYTHON 1.4.0 :Copyright: GPL v3 -===================================== ===================================== ===================================== - -+---------------------------------------------+----------------------------------------------------------------------+ -| .. image:: | The cubical complex is an example of a structured complex useful in | -| img/Cubical_complex_representation.png | computational mathematics (specially rigorous numerics) and image | -| | analysis. | -+---------------------------------------------+----------------------------------------------------------------------+ -| :doc:`cubical_complex_user` | :doc:`cubical_complex_ref` | -+---------------------------------------------+----------------------------------------------------------------------+ +.. include:: cubical_complex_sum.rst Simplex tree ============ -===================================== ===================================== ===================================== -:Author: Clément Maria :Introduced in: GUDHI PYTHON 1.4.0 :Copyright: GPL v3 -===================================== ===================================== ===================================== +.. include:: simplex_tree_sum.rst Witness complex =============== -===================================== ===================================== ===================================== -:Author: Siargey Kachanovich :Introduced in: GUDHI PYTHON 1.4.0 :Copyright: GPL v3 -===================================== ===================================== ===================================== +.. include:: witness_complex_sum.rst Toolbox diff --git a/src/cython/doc/source/simplex_tree_ref.rst b/src/cython/doc/source/simplex_tree_ref.rst new file mode 100644 index 00000000..6d196843 --- /dev/null +++ b/src/cython/doc/source/simplex_tree_ref.rst @@ -0,0 +1,10 @@ +============================= +Simplex tree reference manual +============================= + +.. autoclass:: gudhi.SimplexTree + :members: + :undoc-members: + :show-inheritance: + + .. automethod:: gudhi.SimplexTree.__init__ diff --git a/src/cython/doc/source/simplex_tree_sum.rst b/src/cython/doc/source/simplex_tree_sum.rst new file mode 100644 index 00000000..cc02ccc2 --- /dev/null +++ b/src/cython/doc/source/simplex_tree_sum.rst @@ -0,0 +1,14 @@ +===================================== ===================================== ===================================== +:Author: Clément Maria :Introduced in: GUDHI PYTHON 1.4.0 :Copyright: GPL v3 +===================================== ===================================== ===================================== + ++-------------------------------------------+----------------------------------------------------------------------+ +| .. image:: | The simplex tree is an efficient and flexible data structure for | +| img/Simplex_tree_representation.png | representing general (filtered) simplicial complexes. | +| | | +| | The data structure is described in | +| | `this document <http://dx.doi.org/10.1007/s00453-014-9887-3>`_ | ++-------------------------------------------+----------------------------------------------------------------------+ +| :doc:`simplex_tree_user` | :doc:`simplex_tree_ref` | ++-------------------------------------------+----------------------------------------------------------------------+ +
\ No newline at end of file diff --git a/src/cython/doc/source/simplex_tree_user.rst b/src/cython/doc/source/simplex_tree_user.rst new file mode 100644 index 00000000..e1f6e93d --- /dev/null +++ b/src/cython/doc/source/simplex_tree_user.rst @@ -0,0 +1,8 @@ +======================== +Simplex tree user manual +======================== +Definition +---------- + +.. include:: simplex_tree_sum.rst + diff --git a/src/cython/doc/source/witness_complex_ref.rst b/src/cython/doc/source/witness_complex_ref.rst new file mode 100644 index 00000000..79e39739 --- /dev/null +++ b/src/cython/doc/source/witness_complex_ref.rst @@ -0,0 +1,10 @@ +=============================== +Witness complex reference manual +=============================== + +.. autoclass:: gudhi.WitnessComplex + :members: + :undoc-members: + :show-inheritance: + + .. automethod:: gudhi.WitnessComplex.__init__ diff --git a/src/cython/doc/source/witness_complex_sum.rst b/src/cython/doc/source/witness_complex_sum.rst new file mode 100644 index 00000000..a91ff01b --- /dev/null +++ b/src/cython/doc/source/witness_complex_sum.rst @@ -0,0 +1,21 @@ +===================================== ===================================== ===================================== +:Author: Siargey Kachanovich :Introduced in: GUDHI PYTHON 1.4.0 :Copyright: GPL v3 +===================================== ===================================== ===================================== + ++---------------------------------------------+----------------------------------------------------------------------+ +| .. image:: | Alpha_complex is a simplicial complex constructed from the finite | +| img/Witness_complex_representation.png | cells of a Delaunay Triangulation. | +| | | +| | The filtration value of each simplex is computed as the square of the| +| | circumradius of the simplex if the circumsphere is empty (the simplex| +| | is then said to be Gabriel), and as the minimum of the filtration | +| | values of the codimension 1 cofaces that make it not Gabriel | +| | otherwise. All simplices that have a filtration value strictly | +| | greater than a given alpha squared value are not inserted into the | +| | complex. | +| | | +| | This package requires having CGAL version 4.7 or higher (4.8.1 is | +| | advised for better perfomances). | ++---------------------------------------------+----------------------------------------------------------------------+ +| :doc:`witness_complex_user` | :doc:`witness_complex_ref` | ++---------------------------------------------+----------------------------------------------------------------------+ diff --git a/src/cython/doc/source/witness_complex_user.rst b/src/cython/doc/source/witness_complex_user.rst new file mode 100644 index 00000000..3b4c3891 --- /dev/null +++ b/src/cython/doc/source/witness_complex_user.rst @@ -0,0 +1,8 @@ +========================== +Witness complex user manual +========================== +Definition +---------- + +.. include:: witness_complex_sum.rst + diff --git a/src/cython/example/alpha_complex_from_file_example.py b/src/cython/example/alpha_complex_from_file_example.py index beb5d101..81c4c0b7 100755 --- a/src/cython/example/alpha_complex_from_file_example.py +++ b/src/cython/example/alpha_complex_from_file_example.py @@ -42,6 +42,8 @@ parser = argparse.ArgumentParser(description='AlphaComplex creation from ' 'points from the given file. File format ' 'is X1, X2, ..., Xn') parser.add_argument('file', type=argparse.FileType('r')) +parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams') + args = parser.parse_args() points = pandas.read_csv(args.file, header=None) @@ -57,6 +59,6 @@ diag = alpha_complex.persistence(homology_coeff_field=2, min_persistence=0.1) print("betti_numbers()=") print(alpha_complex.betti_numbers()) -gudhi.diagram_persistence(diag) - -gudhi.barcode_persistence(diag) +if args.no_diagram == False: + gudhi.diagram_persistence(diag) + gudhi.barcode_persistence(diag) diff --git a/src/cython/example/alpha_complex_from_points.py b/src/cython/example/alpha_complex_from_points_example.py index da98f3d4..da98f3d4 100755 --- a/src/cython/example/alpha_complex_from_points.py +++ b/src/cython/example/alpha_complex_from_points_example.py diff --git a/src/cython/src/cython/rips_complex.pyx b/src/cython/src/cython/rips_complex.pyx index 7e07f36b..bed1aa4a 100644 --- a/src/cython/src/cython/rips_complex.pyx +++ b/src/cython/src/cython/rips_complex.pyx @@ -78,15 +78,21 @@ cdef class RipsComplex: cdef Rips_complex_persistence_interface * pcohptr - def __cinit__(self, points=[], max_dimension=3, - max_edge_length=float('inf')): + # Fake constructor that does nothing but documenting the constructor + def __init__(self, points=[], max_alpha_square=float('inf')): """RipsComplex constructor. - Args: - points (list): A list of points in d-Dimension. - max_dimension (int): Maximum dimension of the N-simplex to insert. - max_edge_length (float): Maximum edge length, or distance. + :param points: A list of points in d-Dimension. + :type points: list of list of double + :param max_dimension: Maximum dimension of the complex to be expanded. + :type max_dimension: int + :param max_edge_length: Maximum edge length value (rips radius). + :type max_edge_length: double """ + + # The real cython constructor + def __cinit__(self, points=[], max_dimension=3, + max_edge_length=float('inf')): self.thisptr = new Rips_complex_interface() # Constructor from graph expansion if points is not None: |