diff options
Diffstat (limited to 'cython/doc')
41 files changed, 296 insertions, 154 deletions
diff --git a/cython/doc/_templates/layout.html b/cython/doc/_templates/layout.html index 8e4eba40..1161ed8e 100644 --- a/cython/doc/_templates/layout.html +++ b/cython/doc/_templates/layout.html @@ -56,6 +56,12 @@ </a></p> {%- endif %} {%- endblock %} + <h2><a href="index.html">GUDHI</a></h2> + <h2><a href="fileformats.html">File formats</a></h2> + <h2><a href="installation.html">GUDHI installation</a></h2> + <h2><a href="citation.html">Acknowledging the GUDHI library</a></h2> + <h2><a href="genindex.html">Index</a></h2> + <h2><a href="examples.html">Examples</a></h2> {%- if sidebars != None %} {#- new style sidebar: explicitly include/exclude templates #} {%- for sidebartemplate in sidebars %} @@ -64,13 +70,6 @@ {%- else %} {#- old style sidebars: using blocks -- should be deprecated #} {%- block sidebartoc %} -<h2><a href="index.html">GUDHI</a></h2> -<h2><a href="fileformats.html">File formats</a></h2> -<h2><a href="installation.html">GUDHI installation</a></h2> -<h2><a href="citation.html">Acknowledging the GUDHI library</a></h2> -<h2><a href="genindex.html">Index</a></h2> -<h2><a href="examples.html">Examples</a></h2> - {%- include "localtoc.html" %} {%- endblock %} {%- block sidebarrel %} @@ -166,60 +165,61 @@ <body role="document"> <!-- GUDHI website header BEGIN --> <div id="navigation" class="sticky"> - <nav class="top-bar" role="navigation" data-topbar> - <ul class="title-area"> - <li class="name"> - <h1 class="show-for-small-only"><a href="http://gudhi.gforge.inria.fr" class="icon-tree"> GUDHI C++ library</a></h1> - </li> - <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone --> - <li class="toggle-topbar menu-icon"><a href="#"><span>Navigation</span></a></li> - </ul> - <section class="top-bar-section"> - <ul class="right"> - <li class="divider"></li> - <li><a href="http://gudhi.gforge.inria.fr/contact/">Contact</a></li> - </ul> - <ul class="left"> - <li><a href="http://gudhi.gforge.inria.fr/"> <img src="http://gudhi.gforge.inria.fr/assets/img/home.png" alt=" GUDHI"> GUDHI </a></li> - <li class="divider"></li> - <li class="has-dropdown"> - <a href="#">Project</a> - <ul class="dropdown"> - <li><a href="http://gudhi.gforge.inria.fr/people/">People</a></li> - <li><a href="http://gudhi.gforge.inria.fr/keepintouch/">Keep in touch</a></li> - <li><a href="http://gudhi.gforge.inria.fr/partners/">Partners and Funding</a></li> - <li><a href="http://gudhi.gforge.inria.fr/relatedprojects/">Related projects</a></li> - <li><a href="http://gudhi.gforge.inria.fr/theyaretalkingaboutus/">They are talking about us</a></li> - </ul> - </li> - <li class="divider"></li> - <li class="has-dropdown"> - <a href="#">Download</a> - <ul class="dropdown"> - <li><a href="http://gudhi.gforge.inria.fr/licensing/">Licensing</a></li> - <li><a href="https://gforge.inria.fr/frs/?group_id=3865" target="_blank">Get the sources</a></li> - <li><a href="https://gforge.inria.fr/frs/download.php/file/37113/GUDHI_2.0.0_OSX_UTILS.beta.tar.gz" target="_blank">Utils for Mac OSx</a></li> - <li><a href="https://gforge.inria.fr/frs/download.php/file/37112/GUDHI_2.0.0_WIN64_UTILS.beta.zip" target="_blank">Utils for Win x64</a></li> - </ul> - </li> - <li class="divider"></li> - <li class="has-dropdown"> - <a href="#">Documentation</a> - <ul class="dropdown"> - <li><a href="http://gudhi.gforge.inria.fr/doc/latest/">C++ documentation</a></li> - <li><a href="http://gudhi.gforge.inria.fr/doc/latest/installation.html">C++ installation manual</a></li> - <li><a href="http://gudhi.gforge.inria.fr/python/latest/">Python documentation</a></li> - <li><a href="http://gudhi.gforge.inria.fr/python/latest/installation.html">Python installation manual</a></li> - <li><a href="http://gudhi.gforge.inria.fr/utils/">Utilities</a></li> - <li><a href="http://bertrand.michel.perso.math.cnrs.fr/Enseignements/TDA-Gudhi-Python.html" target="_blank">Tutorial</a></li> - </ul> - </li> - <li class="divider"></li> - <li><a href="http://gudhi.gforge.inria.fr/interfaces/">Interfaces</a></li> - <li class="divider"></li> - </ul> - </section> - </nav> + <nav class="top-bar" role="navigation" data-topbar> + <ul class="title-area"> + <li class="name"> + <h1 class="show-for-small-only"><a href="" class="icon-tree"> GUDHI C++ library</a></h1> + </li> + <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone --> + <li class="toggle-topbar menu-icon"><a href="#"><span>Navigation</span></a></li> + </ul> + <section class="top-bar-section"> + <ul class="right"> + <li class="divider"></li> + <li><a href="/contact/">Contact</a></li> + </ul> + <ul class="left"> + <li><a href="/"> <img src="/assets/img/home.png" alt=" GUDHI"> GUDHI </a></li> + <li class="divider"></li> + <li class="has-dropdown"> + <a href="#">Project</a> + <ul class="dropdown"> + <li><a href="/people/">People</a></li> + <li><a href="/keepintouch/">Keep in touch</a></li> + <li><a href="/partners/">Partners and Funding</a></li> + <li><a href="/relatedprojects/">Related projects</a></li> + <li><a href="/theyaretalkingaboutus/">They are talking about us</a></li> + </ul> + </li> + <li class="divider"></li> + <li class="has-dropdown"> + <a href="#">Download</a> + <ul class="dropdown"> + <li><a href="/licensing/">Licensing</a></li> + <li><a href="https://gforge.inria.fr/frs/download.php/latestzip/5253/library-latest.zip" target="_blank">Get the latest sources</a></li> + <li><a href="https://gforge.inria.fr/frs/download.php/latestzip/5280/utils_osx-latest.zip" target="_blank">Utils for Mac OSx</a></li> + <li><a href="https://gforge.inria.fr/frs/download.php/latestzip/5279/utils_win64-latest.zip" target="_blank">Utils for Win x64</a></li> + </ul> + </li> + <li class="divider"></li> + <li class="has-dropdown"> + <a href="#">Documentation</a> + <ul class="dropdown"> + <li><a href="/doc/latest/">C++ documentation</a></li> + <li><a href="/doc/latest/installation.html">C++ installation manual</a></li> + <li><a href="/python/latest/">Python documentation</a></li> + <li><a href="/python/latest/installation.html">Python installation manual</a></li> + <li><a href="/utils/">Utilities</a></li> + <li><a href="/tutorials/">Tutorials</a></li> + <li><a href="/dockerfile/">Dockerfile</a></li> + </ul> + </li> + <li class="divider"></li> + <li><a href="/interfaces/">Interfaces</a></li> + <li class="divider"></li> + </ul> + </section> + </nav> </div><!-- /#navigation --> <!-- GUDHI website header BEGIN --> diff --git a/cython/doc/alpha_complex_ref.rst b/cython/doc/alpha_complex_ref.rst index 6a122b09..7da79543 100644 --- a/cython/doc/alpha_complex_ref.rst +++ b/cython/doc/alpha_complex_ref.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + ============================== Alpha complex reference manual ============================== diff --git a/cython/doc/alpha_complex_sum.rst b/cython/doc/alpha_complex_sum.inc index 1680a712..1680a712 100644 --- a/cython/doc/alpha_complex_sum.rst +++ b/cython/doc/alpha_complex_sum.inc diff --git a/cython/doc/alpha_complex_user.rst b/cython/doc/alpha_complex_user.rst index db7edd6f..d1e9c7cd 100644 --- a/cython/doc/alpha_complex_user.rst +++ b/cython/doc/alpha_complex_user.rst @@ -1,11 +1,15 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Alpha complex user manual ========================= Definition ---------- -.. include:: alpha_complex_sum.rst +.. include:: alpha_complex_sum.inc -Alpha_complex is constructing a :doc:`Simplex_tree <simplex_tree_sum>` using +Alpha_complex is constructing a :doc:`Simplex_tree <simplex_tree_ref>` using `Delaunay Triangulation <http://doc.cgal.org/latest/Triangulation/index.html#Chapter_Triangulations>`_ :cite:`cgal:hdj-t-15b` from `CGAL <http://www.cgal.org/>`_ (the Computational Geometry Algorithms Library :cite:`cgal:eb-15b`). @@ -99,9 +103,9 @@ Filtration value computation algorithm **end for** **end for** **end for** - + make_filtration_non_decreasing() - + prune_above_filtration() Dimension 2 diff --git a/cython/doc/bottleneck_distance_sum.rst b/cython/doc/bottleneck_distance_sum.inc index 030fad9e..030fad9e 100644 --- a/cython/doc/bottleneck_distance_sum.rst +++ b/cython/doc/bottleneck_distance_sum.inc diff --git a/cython/doc/bottleneck_distance_user.rst b/cython/doc/bottleneck_distance_user.rst index 7692dce2..605db022 100644 --- a/cython/doc/bottleneck_distance_user.rst +++ b/cython/doc/bottleneck_distance_user.rst @@ -1,9 +1,13 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Bottleneck distance user manual =============================== Definition ---------- -.. include:: bottleneck_distance_sum.rst +.. include:: bottleneck_distance_sum.inc Function -------- diff --git a/cython/doc/citation.rst b/cython/doc/citation.rst index f4fdf83b..117eb9dd 100644 --- a/cython/doc/citation.rst +++ b/cython/doc/citation.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Acknowledging the GUDHI library ############################### diff --git a/cython/doc/conf.py b/cython/doc/conf.py index a13c9751..4a54d4fd 100755 --- a/cython/doc/conf.py +++ b/cython/doc/conf.py @@ -85,7 +85,7 @@ version = gudhi.__version__ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build'] +exclude_patterns = ['_build', '*.inc'] # The reST default role (used for this markup: `text`) to use for all # documents. @@ -125,6 +125,7 @@ html_theme_options = { "sidebarbgcolor": "#A1ADCD", "sidebartextcolor": "black", "sidebarlinkcolor": "#334D5C", + "body_max_width": "1200px", } # Add any paths that contain custom themes here, relative to this directory. diff --git a/cython/doc/cubical_complex_ref.rst b/cython/doc/cubical_complex_ref.rst index 84aa4223..1fe9d5fb 100644 --- a/cython/doc/cubical_complex_ref.rst +++ b/cython/doc/cubical_complex_ref.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Cubical complex reference manual ################################ diff --git a/cython/doc/cubical_complex_sum.rst b/cython/doc/cubical_complex_sum.inc index 280ad0e0..280ad0e0 100644 --- a/cython/doc/cubical_complex_sum.rst +++ b/cython/doc/cubical_complex_sum.inc diff --git a/cython/doc/cubical_complex_user.rst b/cython/doc/cubical_complex_user.rst index 34598f02..320bd79b 100644 --- a/cython/doc/cubical_complex_user.rst +++ b/cython/doc/cubical_complex_user.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Cubical complex user manual =========================== Definition @@ -144,6 +148,7 @@ the program output is: .. testoutput:: Periodic cubical complex is of dimension 2 - 42 simplices. + Examples. --------- @@ -152,6 +157,6 @@ End user programs are available in cython/example/ folder. Bibliography ============ -.. bibliography:: ../../bibliography.bib +.. bibliography:: ../../biblio/bibliography.bib :filter: docnames :style: unsrt diff --git a/cython/doc/euclidean_strong_witness_complex_ref.rst b/cython/doc/euclidean_strong_witness_complex_ref.rst index bebf0f9a..1a602cd5 100644 --- a/cython/doc/euclidean_strong_witness_complex_ref.rst +++ b/cython/doc/euclidean_strong_witness_complex_ref.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + ================================================= Euclidean strong witness complex reference manual ================================================= diff --git a/cython/doc/euclidean_witness_complex_ref.rst b/cython/doc/euclidean_witness_complex_ref.rst index 29b8806f..28daf965 100644 --- a/cython/doc/euclidean_witness_complex_ref.rst +++ b/cython/doc/euclidean_witness_complex_ref.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + ========================================== Euclidean witness complex reference manual ========================================== diff --git a/cython/doc/examples.rst b/cython/doc/examples.rst index 1e596e18..d42f5a92 100644 --- a/cython/doc/examples.rst +++ b/cython/doc/examples.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Examples ######## diff --git a/cython/doc/fileformats.rst b/cython/doc/fileformats.rst index 4f0b6f6d..ff20f26e 100644 --- a/cython/doc/fileformats.rst +++ b/cython/doc/fileformats.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + File formats ############ diff --git a/cython/doc/index.rst b/cython/doc/index.rst index 3945d72a..4e444fb0 100644 --- a/cython/doc/index.rst +++ b/cython/doc/index.rst @@ -34,32 +34,32 @@ Data structures Alpha complex ============= -.. include:: alpha_complex_sum.rst +.. include:: alpha_complex_sum.inc Cubical complex =============== -.. include:: cubical_complex_sum.rst +.. include:: cubical_complex_sum.inc Rips complex ============ -.. include:: rips_complex_sum.rst +.. include:: rips_complex_sum.inc Simplex tree ============ -.. include:: simplex_tree_sum.rst +.. include:: simplex_tree_sum.inc Tangential complex ================== -.. include:: tangential_complex_sum.rst +.. include:: tangential_complex_sum.inc Witness complex =============== -.. include:: witness_complex_sum.rst +.. include:: witness_complex_sum.inc Toolbox @@ -68,17 +68,17 @@ Toolbox Bottleneck distance =================== -.. include:: bottleneck_distance_sum.rst +.. include:: bottleneck_distance_sum.inc Persistence cohomology ====================== -.. include:: persistent_cohomology_sum.rst +.. include:: persistent_cohomology_sum.inc Persistence graphical tools =========================== -.. include:: persistence_graphical_tools_sum.rst +.. include:: persistence_graphical_tools_sum.inc Bibliography ************ diff --git a/cython/doc/installation.rst b/cython/doc/installation.rst index c182f176..43ff85c5 100644 --- a/cython/doc/installation.rst +++ b/cython/doc/installation.rst @@ -1,12 +1,16 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Installation ############ Compiling ********* - -The library uses c++11 and requires `Boost <http://www.boost.org/>`_ with -version 1.48.0 or more recent. It is a multi-platform library and compiles on -Linux, Mac OSX and Visual Studio 2015. +The library uses c++11 and requires `Boost <https://www.boost.org/>`_ ≥ 1.48.0 +and `CMake <https://www.cmake.org/>`_ ≥ 3.1. +It is a multi-platform library and compiles on Linux, Mac OSX and Visual +Studio 2015. It also requires cmake to generate makefiles, and cython to compile the library. @@ -43,6 +47,9 @@ following command in a terminal: export PYTHONPATH='$PYTHONPATH:/path-to-gudhi/build/cython' ctest -R py_test +If tests fail, please try to :code:`import gudhi` and check the errors. +The problem can come from a third-party library bad link or installation. + Documentation ============= diff --git a/cython/doc/periodic_cubical_complex_ref.rst b/cython/doc/periodic_cubical_complex_ref.rst index c6190a1b..4b831647 100644 --- a/cython/doc/periodic_cubical_complex_ref.rst +++ b/cython/doc/periodic_cubical_complex_ref.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Periodic cubical complex reference manual ######################################### diff --git a/cython/doc/persistence_graphical_tools_ref.rst b/cython/doc/persistence_graphical_tools_ref.rst index 27c2f68a..a2c6bcef 100644 --- a/cython/doc/persistence_graphical_tools_ref.rst +++ b/cython/doc/persistence_graphical_tools_ref.rst @@ -1,8 +1,11 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + ============================================ Persistence graphical tools reference manual ============================================ .. autofunction:: gudhi.__min_birth_max_death -.. autofunction:: gudhi.show_palette_values .. autofunction:: gudhi.plot_persistence_barcode .. autofunction:: gudhi.plot_persistence_diagram diff --git a/cython/doc/persistence_graphical_tools_sum.rst b/cython/doc/persistence_graphical_tools_sum.inc index d602daa7..d602daa7 100644 --- a/cython/doc/persistence_graphical_tools_sum.rst +++ b/cython/doc/persistence_graphical_tools_sum.inc diff --git a/cython/doc/persistence_graphical_tools_user.rst b/cython/doc/persistence_graphical_tools_user.rst index 9033331f..292915eb 100644 --- a/cython/doc/persistence_graphical_tools_user.rst +++ b/cython/doc/persistence_graphical_tools_user.rst @@ -1,49 +1,26 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Persistence graphical tools user manual ======================================= Definition ---------- -.. include:: persistence_graphical_tools_sum.rst - - -Show palette values -------------------- - -This function is useful to show the color palette values of dimension: - +.. include:: persistence_graphical_tools_sum.inc -.. testcode:: - - import gudhi - plt = gudhi.show_palette_values(alpha=1.0) - plt.show() - -.. plot:: - - import gudhi - plt = gudhi.show_palette_values(alpha=1.0) - plt.show() Show persistence as a barcode ----------------------------- This function can display the persistence result as a barcode: -.. testcode:: - - import gudhi - - periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file=gudhi.__root_source_dir__ + \ - '/data/bitmap/3d_torus.txt') - diag = periodic_cc.persistence() - plt = gudhi.plot_persistence_barcode(diag) - plt.show() - .. plot:: + :include-source: import gudhi - periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file=gudhi.__root_source_dir__ + \ - '/data/bitmap/3d_torus.txt') + perseus_file = gudhi.__root_source_dir__ + '/data/bitmap/3d_torus.txt' + periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file=perseus_file) diag = periodic_cc.persistence() print("diag = ", diag) plt = gudhi.plot_persistence_barcode(diag) @@ -54,24 +31,32 @@ Show persistence as a diagram This function can display the persistence result as a diagram: -.. testcode:: +.. plot:: + :include-source: import gudhi - - rips_complex = gudhi.RipsComplex(off_file=gudhi.__root_source_dir__ + \ - '/data/points/tore3D_1307.off', max_edge_length=0.2) - simplex_tree = rips_complex.create_simplex_tree(max_dimension=3) - diag = simplex_tree.persistence() - plt = gudhi.plot_persistence_diagram(diag, band_boot=0.13) + + # rips_on_tore3D_1307.pers obtained from write_persistence_diagram method + persistence_file=gudhi.__root_source_dir__ + \ + '/data/persistence_diagram/rips_on_tore3D_1307.pers' + plt = gudhi.plot_persistence_diagram(persistence_file=persistence_file, + legend=True) plt.show() +If you want more information on a specific dimension, for instance: + .. plot:: + :include-source: import gudhi - rips_complex = gudhi.RipsComplex(off_file=gudhi.__root_source_dir__ + \ - '/data/points/tore3D_1307.off', max_edge_length=0.2) - simplex_tree = rips_complex.create_simplex_tree(max_dimension=3) - diag = simplex_tree.persistence() - plt = gudhi.plot_persistence_diagram(diag, band_boot=0.13) + persistence_file=gudhi.__root_source_dir__ + \ + '/data/persistence_diagram/rips_on_tore3D_1307.pers' + diag = \ + gudhi.read_persistence_intervals_grouped_by_dimension(persistence_file=\ + persistence_file) + dim = 1 + # Display all points with some transparency + plt = gudhi.plot_persistence_diagram([(dim,interval) for interval in diag[dim]], + max_plots=0, alpha=0.1) plt.show() diff --git a/cython/doc/persistent_cohomology_sum.rst b/cython/doc/persistent_cohomology_sum.inc index a26df1dc..a26df1dc 100644 --- a/cython/doc/persistent_cohomology_sum.rst +++ b/cython/doc/persistent_cohomology_sum.inc diff --git a/cython/doc/persistent_cohomology_user.rst b/cython/doc/persistent_cohomology_user.rst index bf90c163..ce7fc685 100644 --- a/cython/doc/persistent_cohomology_user.rst +++ b/cython/doc/persistent_cohomology_user.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Persistent cohomology user manual ================================= Definition diff --git a/cython/doc/pyplots/barcode_persistence.py b/cython/doc/pyplots/barcode_persistence.py deleted file mode 100755 index de33d506..00000000 --- a/cython/doc/pyplots/barcode_persistence.py +++ /dev/null @@ -1,7 +0,0 @@ -import gudhi - -periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file=gudhi.__root_source_dir__ + \ - '/data/bitmap/3d_torus.txt') -diag = periodic_cc.persistence() -plt = gudhi.plot_persistence_barcode(diag) -plt.show() diff --git a/cython/doc/pyplots/diagram_persistence.py b/cython/doc/pyplots/diagram_persistence.py deleted file mode 100755 index c2fbf801..00000000 --- a/cython/doc/pyplots/diagram_persistence.py +++ /dev/null @@ -1,8 +0,0 @@ -import gudhi - -rips_complex = gudhi.RipsComplex(off_file=gudhi.__root_source_dir__ + \ - '/data/points/tore3D_1307.off', max_edge_length=0.2) -simplex_tree = rips_complex.create_simplex_tree(max_dimension=3) -diag = simplex_tree.persistence() -plt = gudhi.plot_persistence_diagram(diag, band_boot=0.13) -plt.show() diff --git a/cython/doc/pyplots/show_palette_values.py b/cython/doc/pyplots/show_palette_values.py deleted file mode 100755 index fdf9645f..00000000 --- a/cython/doc/pyplots/show_palette_values.py +++ /dev/null @@ -1,3 +0,0 @@ -import gudhi -plt = gudhi.show_palette_values(alpha=1.0) -plt.show() diff --git a/cython/doc/reader_utils_ref.rst b/cython/doc/reader_utils_ref.rst index 9c1ea6fc..f3ecebad 100644 --- a/cython/doc/reader_utils_ref.rst +++ b/cython/doc/reader_utils_ref.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + ============================= Reader utils reference manual ============================= diff --git a/cython/doc/rips_complex_ref.rst b/cython/doc/rips_complex_ref.rst index b17dc4e0..22b5616c 100644 --- a/cython/doc/rips_complex_ref.rst +++ b/cython/doc/rips_complex_ref.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + ============================= Rips complex reference manual ============================= diff --git a/cython/doc/rips_complex_sum.rst b/cython/doc/rips_complex_sum.inc index 5616bfa9..5616bfa9 100644 --- a/cython/doc/rips_complex_sum.rst +++ b/cython/doc/rips_complex_sum.inc diff --git a/cython/doc/rips_complex_user.rst b/cython/doc/rips_complex_user.rst index 96ba9944..a8c06cf9 100644 --- a/cython/doc/rips_complex_user.rst +++ b/cython/doc/rips_complex_user.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Rips complex user manual ========================= Definition @@ -101,8 +105,8 @@ Finally, it is asked to display information about the Rips complex. .. testcode:: import gudhi - rips_complex = gudhi.RipsComplex(off_file=gudhi.__root_source_dir__ + \ - '/data/points/alphacomplexdoc.off', max_edge_length=12.0) + point_cloud = gudhi.read_off(off_file=gudhi.__root_source_dir__ + '/data/points/alphacomplexdoc.off') + rips_complex = gudhi.RipsComplex(points=point_cloud, max_edge_length=12.0) simplex_tree = rips_complex.create_simplex_tree(max_dimension=1) result_str = 'Rips complex is of dimension ' + repr(simplex_tree.dimension()) + ' - ' + \ repr(simplex_tree.num_simplices()) + ' simplices - ' + \ @@ -197,7 +201,7 @@ Example from csv file ^^^^^^^^^^^^^^^^^^^^^ This example builds the :doc:`Rips_complex <rips_complex_ref>` from the given -points in an OFF file, and max_edge_length value. +distance matrix in a csv file, and max_edge_length value. Then it creates a :doc:`Simplex_tree <simplex_tree_ref>` with it. Finally, it is asked to display information about the Rips complex. @@ -206,8 +210,9 @@ Finally, it is asked to display information about the Rips complex. .. testcode:: import gudhi - rips_complex = gudhi.RipsComplex(csv_file=gudhi.__root_source_dir__ + \ - '/data/distance_matrix/full_square_distance_matrix.csv', max_edge_length=12.0) + distance_matrix = gudhi.read_lower_triangular_matrix_from_csv_file(csv_file=gudhi.__root_source_dir__ + \ + '/data/distance_matrix/full_square_distance_matrix.csv') + rips_complex = gudhi.RipsComplex(distance_matrix=distance_matrix, max_edge_length=12.0) simplex_tree = rips_complex.create_simplex_tree(max_dimension=1) result_str = 'Rips complex is of dimension ' + repr(simplex_tree.dimension()) + ' - ' + \ repr(simplex_tree.num_simplices()) + ' simplices - ' + \ @@ -240,3 +245,72 @@ the program output is: [0, 3] -> 9.43 [4, 6] -> 9.49 [3, 6] -> 11.00 + +Correlation matrix +------------------ + +Example from a correlation matrix +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Analogously to the case of distance matrix, Rips complexes can be also constructed based on correlation matrix. +Given a correlation matrix M, comportment-wise 1-M is a distance matrix. +This example builds the one skeleton graph from the given corelation matrix and threshold value. +Then it creates a :doc:`Simplex_tree <simplex_tree_ref>` with it. + +Finally, it is asked to display information about the simplicial complex. + +.. testcode:: + + import gudhi + import numpy as np + + # User defined correlation matrix is: + # |1 0.06 0.23 0.01 0.89| + # |0.06 1 0.74 0.01 0.61| + # |0.23 0.74 1 0.72 0.03| + # |0.01 0.01 0.72 1 0.7 | + # |0.89 0.61 0.03 0.7 1 | + correlation_matrix=np.array([[1., 0.06, 0.23, 0.01, 0.89], + [0.06, 1., 0.74, 0.01, 0.61], + [0.23, 0.74, 1., 0.72, 0.03], + [0.01, 0.01, 0.72, 1., 0.7], + [0.89, 0.61, 0.03, 0.7, 1.]], float) + + distance_matrix = np.ones((correlation_matrix.shape),float) - correlation_matrix + rips_complex = gudhi.RipsComplex(distance_matrix=distance_matrix, max_edge_length=1.0) + + simplex_tree = rips_complex.create_simplex_tree(max_dimension=1) + result_str = 'Rips complex is of dimension ' + repr(simplex_tree.dimension()) + ' - ' + \ + repr(simplex_tree.num_simplices()) + ' simplices - ' + \ + repr(simplex_tree.num_vertices()) + ' vertices.' + print(result_str) + fmt = '%s -> %.2f' + for filtered_value in simplex_tree.get_filtration(): + print(fmt % tuple(filtered_value)) + +When launching (Rips maximal distance between 2 points is 12.0, is expanded +until dimension 1 - one skeleton graph in other words), the output is: + +.. testoutput:: + + Rips complex is of dimension 1 - 15 simplices - 5 vertices. + [0] -> 0.00 + [1] -> 0.00 + [2] -> 0.00 + [3] -> 0.00 + [4] -> 0.00 + [0, 4] -> 0.11 + [1, 2] -> 0.26 + [2, 3] -> 0.28 + [3, 4] -> 0.30 + [1, 4] -> 0.39 + [0, 2] -> 0.77 + [0, 1] -> 0.94 + [2, 4] -> 0.97 + [0, 3] -> 0.99 + [1, 3] -> 0.99 + +.. note:: + As persistence diagrams points will be under the diagonal, + bottleneck distance and persistence graphical tool will not work properly, + this is a known issue. diff --git a/cython/doc/simplex_tree_ref.rst b/cython/doc/simplex_tree_ref.rst index 6d196843..9eb8c199 100644 --- a/cython/doc/simplex_tree_ref.rst +++ b/cython/doc/simplex_tree_ref.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + ============================= Simplex tree reference manual ============================= diff --git a/cython/doc/simplex_tree_sum.rst b/cython/doc/simplex_tree_sum.inc index fb0e54c1..fb0e54c1 100644 --- a/cython/doc/simplex_tree_sum.rst +++ b/cython/doc/simplex_tree_sum.inc diff --git a/cython/doc/simplex_tree_user.rst b/cython/doc/simplex_tree_user.rst index 4b1dde19..aebeb29f 100644 --- a/cython/doc/simplex_tree_user.rst +++ b/cython/doc/simplex_tree_user.rst @@ -1,9 +1,13 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Simplex tree user manual ======================== Definition ---------- -.. include:: simplex_tree_sum.rst +.. include:: simplex_tree_sum.inc A simplicial complex :math:`\mathbf{K}` on a set of vertices :math:`V = \{1, \cdots ,|V|\}` is a collection of simplices :math:`\{\sigma\}`, :math:`\sigma \subseteq V` such that diff --git a/cython/doc/strong_witness_complex_ref.rst b/cython/doc/strong_witness_complex_ref.rst index 4ed4fe46..d624d711 100644 --- a/cython/doc/strong_witness_complex_ref.rst +++ b/cython/doc/strong_witness_complex_ref.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + ======================================= Strong witness complex reference manual ======================================= diff --git a/cython/doc/tangential_complex_ref.rst b/cython/doc/tangential_complex_ref.rst index 35589475..cdfda082 100644 --- a/cython/doc/tangential_complex_ref.rst +++ b/cython/doc/tangential_complex_ref.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + =================================== Tangential complex reference manual =================================== diff --git a/cython/doc/tangential_complex_sum.rst b/cython/doc/tangential_complex_sum.inc index 72b4d7ba..72b4d7ba 100644 --- a/cython/doc/tangential_complex_sum.rst +++ b/cython/doc/tangential_complex_sum.inc diff --git a/cython/doc/tangential_complex_user.rst b/cython/doc/tangential_complex_user.rst index efa6d7ce..5ce69e86 100644 --- a/cython/doc/tangential_complex_user.rst +++ b/cython/doc/tangential_complex_user.rst @@ -1,6 +1,10 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Tangential complex user manual ============================== -.. include:: tangential_complex_sum.rst +.. include:: tangential_complex_sum.inc Definition ---------- @@ -122,8 +126,8 @@ This example builds the Tangential complex of point set read in an OFF file. .. testcode:: import gudhi - tc = gudhi.TangentialComplex(off_file=gudhi.__root_source_dir__ + \ - '/data/points/alphacomplexdoc.off') + tc = gudhi.TangentialComplex(intrisic_dim = 1, + off_file=gudhi.__root_source_dir__ + '/data/points/alphacomplexdoc.off') result_str = 'Tangential contains ' + repr(tc.num_simplices()) + \ ' simplices - ' + repr(tc.num_vertices()) + ' vertices.' print(result_str) @@ -169,7 +173,8 @@ simplices. .. testcode:: import gudhi - tc = gudhi.TangentialComplex(points=[[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 1.0]]) + tc = gudhi.TangentialComplex(intrisic_dim = 1, + points=[[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 1.0]]) result_str = 'Tangential contains ' + repr(tc.num_vertices()) + ' vertices.' print(result_str) diff --git a/cython/doc/todos.rst b/cython/doc/todos.rst index 78972a4c..ca274ced 100644 --- a/cython/doc/todos.rst +++ b/cython/doc/todos.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + ========== To be done ========== diff --git a/cython/doc/witness_complex_ref.rst b/cython/doc/witness_complex_ref.rst index c78760cb..9987d3fd 100644 --- a/cython/doc/witness_complex_ref.rst +++ b/cython/doc/witness_complex_ref.rst @@ -1,3 +1,7 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + ================================ Witness complex reference manual ================================ diff --git a/cython/doc/witness_complex_sum.rst b/cython/doc/witness_complex_sum.inc index a8a126a0..a8a126a0 100644 --- a/cython/doc/witness_complex_sum.rst +++ b/cython/doc/witness_complex_sum.inc diff --git a/cython/doc/witness_complex_user.rst b/cython/doc/witness_complex_user.rst index 99be5185..40e94134 100644 --- a/cython/doc/witness_complex_user.rst +++ b/cython/doc/witness_complex_user.rst @@ -1,7 +1,11 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Witness complex user manual =========================== -.. include:: witness_complex_sum.rst +.. include:: witness_complex_sum.inc Definitions ----------- |