From b35f3d3dc3225bf12152172d332942e6d7dfc956 Mon Sep 17 00:00:00 2001
From: vrouvrea
Date: Mon, 19 Mar 2018 16:35:00 +0000
Subject: Documentation for Nerve_gic
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/python_nerve_gic_vincent@3297 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 3e80b2592386707ac760d0f7cd4bce9d2e9fd7e6
---
src/cython/doc/index.rst | 5 +
src/cython/doc/nerve_gic_complex_ref.rst | 10 ++
src/cython/doc/nerve_gic_complex_sum.rst | 15 +++
src/cython/doc/nerve_gic_complex_user.rst | 160 ++++++++++++++++++++++++++++++
4 files changed, 190 insertions(+)
create mode 100644 src/cython/doc/nerve_gic_complex_ref.rst
create mode 100644 src/cython/doc/nerve_gic_complex_sum.rst
create mode 100644 src/cython/doc/nerve_gic_complex_user.rst
(limited to 'src/cython/doc')
diff --git a/src/cython/doc/index.rst b/src/cython/doc/index.rst
index 3945d72a..c5e7954f 100644
--- a/src/cython/doc/index.rst
+++ b/src/cython/doc/index.rst
@@ -36,6 +36,11 @@ Alpha complex
.. include:: alpha_complex_sum.rst
+Cover complexes
+===============
+
+.. include:: nerve_gic_complex_sum.rst
+
Cubical complex
===============
diff --git a/src/cython/doc/nerve_gic_complex_ref.rst b/src/cython/doc/nerve_gic_complex_ref.rst
new file mode 100644
index 00000000..e24e01fc
--- /dev/null
+++ b/src/cython/doc/nerve_gic_complex_ref.rst
@@ -0,0 +1,10 @@
+================================
+Cover complexes reference manual
+================================
+
+.. autoclass:: gudhi.CoverComplex
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+ .. automethod:: gudhi.CoverComplex.__init__
diff --git a/src/cython/doc/nerve_gic_complex_sum.rst b/src/cython/doc/nerve_gic_complex_sum.rst
new file mode 100644
index 00000000..72782c7a
--- /dev/null
+++ b/src/cython/doc/nerve_gic_complex_sum.rst
@@ -0,0 +1,15 @@
+================================================================= =================================== ===================================
+:Author: Mathieu Carrière :Introduced in: GUDHI 2.1.0 :Copyright: GPL v3
+:Requires: CGAL :math:`\geq` 4.8.1
+================================================================= =================================== ===================================
+
++----------------------------------------------------------------+------------------------------------------------------------------------+
+| .. figure:: | Nerves and Graph Induced Complexes are cover complexes, i.e. |
+| ../../doc/Nerve_GIC/gicvisu.jpg | simplicial complexes that provably contain topological information |
+| :alt: Graph Induced Complex of a point cloud. | about the input data. They can be computed with a cover of the data, |
+| :figclass: align-center | that comes i.e. from the preimage of a family of intervals covering |
+| | the image of a scalar-valued function defined on the data. |
+| Graph Induced Complex of a point cloud. | |
++----------------------------------------------------------------+------------------------------------------------------------------------+
+| :doc:`nerve_gic_complex_user` | :doc:`nerve_gic_complex_ref` |
++----------------------------------------------------------------+------------------------------------------------------------------------+
diff --git a/src/cython/doc/nerve_gic_complex_user.rst b/src/cython/doc/nerve_gic_complex_user.rst
new file mode 100644
index 00000000..249d79f1
--- /dev/null
+++ b/src/cython/doc/nerve_gic_complex_user.rst
@@ -0,0 +1,160 @@
+Cover complexes user manual
+===========================
+Definition
+----------
+
+.. include:: nerve_gic_complex_sum.rst
+
+Visualizations of the simplicial complexes can be done with either
+neato (from `graphviz `_),
+`geomview `_,
+`KeplerMapper `_.
+Input point clouds are assumed to be
+`OFF files `_.
+
+Covers
+------
+
+Nerves and Graph Induced Complexes require a cover C of the input point cloud P,
+that is a set of subsets of P whose union is P itself.
+Very often, this cover is obtained from the preimage of a family of intervals covering
+the image of some scalar-valued function f defined on P. This family is parameterized
+by its resolution, which can be either the number or the length of the intervals,
+and its gain, which is the overlap percentage between consecutive intervals (ordered by their first values).
+
+Nerves
+------
+
+Nerve definition
+^^^^^^^^^^^^^^^^
+
+Assume you are given a cover C of your point cloud P. Then, the Nerve of this cover
+is the simplicial complex that has one k-simplex per k-fold intersection of cover elements.
+See also `Wikipedia `_.
+
+.. figure::
+ ../../doc/Nerve_GIC/nerve.png
+ :figclass: align-center
+ :alt: Nerve of a double torus
+
+ Nerve of a double torus
+
+Example
+^^^^^^^
+
+This example builds the Nerve of a point cloud sampled on a 3D human shape (human.off).
+The cover C comes from the preimages of intervals (10 intervals with gain 0.3)
+covering the height function (coordinate 2),
+which are then refined into their connected components using the triangulation of the .OFF file.
+
+.. testcode::
+
+ import gudhi
+ nerve_complex = gudhi.CoverComplex()
+ nerve_complex.set_verbose(True)
+
+ if (nerve_complex.read_point_cloud(gudhi.__root_source_dir__ + \
+ '/data/points/human.off')):
+ nerve_complex.set_type('Nerve')
+ nerve_complex.set_color_from_coordinate(2)
+ nerve_complex.set_function_from_coordinate(2)
+ nerve_complex.set_graph_from_OFF()
+ nerve_complex.set_resolution_with_interval_number(10)
+ nerve_complex.set_gain(0.3)
+ nerve_complex.set_cover_from_function()
+ nerve_complex.find_simplices()
+ nerve_complex.write_info()
+ simplex_tree = nerve_complex.create_simplex_tree()
+ nerve_complex.compute_PD()
+ result_str = 'Nerve is of dimension ' + repr(simplex_tree.dimension()) + ' - ' + \
+ repr(simplex_tree.num_simplices()) + ' simplices - ' + \
+ repr(simplex_tree.num_vertices()) + ' vertices.'
+ print(result_str)
+ for filtered_value in simplex_tree.get_filtration():
+ print(filtered_value[0])
+
+the program output is:
+
+ Min function value = -0.979672 and Max function value = 0.816414
+ Interval 0 = [-0.979672, -0.761576]
+ Interval 1 = [-0.838551, -0.581967]
+ Interval 2 = [-0.658942, -0.402359]
+ Interval 3 = [-0.479334, -0.22275]
+ Interval 4 = [-0.299725, -0.0431414]
+ Interval 5 = [-0.120117, 0.136467]
+ Interval 6 = [0.059492, 0.316076]
+ Interval 7 = [0.239101, 0.495684]
+ Interval 8 = [0.418709, 0.675293]
+ Interval 9 = [0.598318, 0.816414]
+ Computing preimages...
+ Computing connected components...
+ 5 interval(s) in dimension 0:
+ [-0.909111, 0.0081753]
+ [-0.171433, 0.367393]
+ [-0.171433, 0.367393]
+ [-0.909111, 0.745853]
+ 0 interval(s) in dimension 1:
+
+.. testoutput::
+
+ Nerve is of dimension 1 - 41 simplices - 21 vertices.
+ [1]
+ [0]
+ [4]
+ [0, 4]
+ [2]
+ [1, 2]
+ [8]
+ [2, 8]
+ [5]
+ [4, 5]
+ [9]
+ [8, 9]
+ [13]
+ [5, 13]
+ [14]
+ [9, 14]
+ [19]
+ [13, 19]
+ [25]
+ [32]
+ [20]
+ [20, 32]
+ [33]
+ [25, 33]
+ [26]
+ [14, 26]
+ [19, 26]
+ [42]
+ [26, 42]
+ [34]
+ [33, 34]
+ [27]
+ [20, 27]
+ [35]
+ [27, 35]
+ [34, 35]
+ [35, 42]
+ [44]
+ [35, 44]
+ [54]
+ [44, 54]
+
+
+The program also writes a file ../../data/points/human.off_sc.txt. The first
+three lines in this file are the location of the input point cloud and the
+function used to compute the cover.
+The fourth line contains the number of vertices nv and edges ne of the Nerve.
+The next nv lines represent the vertices. Each line contains the vertex ID,
+the number of data points it contains, and their average color function value.
+Finally, the next ne lines represent the edges, characterized by the ID of
+their vertices.
+
+Using KeplerMapper, one can obtain the following visualization:
+
+.. figure::
+ ../../doc/Nerve_GIC/nervevisu.jpg
+ :figclass: align-center
+ :alt: Visualization with KeplerMapper
+
+ Visualization with KeplerMapper
--
cgit v1.2.3
From 423d68bfe3fcd95260e31cee55f3bca39c7525bf Mon Sep 17 00:00:00 2001
From: vrouvrea
Date: Mon, 19 Mar 2018 22:40:20 +0000
Subject: Add nerve_gic voronoi part
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/python_nerve_gic_vincent@3298 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: c1cada23c1c492692df8e6764ed5371b494ccea8
---
src/cython/doc/nerve_gic_complex_user.rst | 62 +++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
(limited to 'src/cython/doc')
diff --git a/src/cython/doc/nerve_gic_complex_user.rst b/src/cython/doc/nerve_gic_complex_user.rst
index 249d79f1..7edf0578 100644
--- a/src/cython/doc/nerve_gic_complex_user.rst
+++ b/src/cython/doc/nerve_gic_complex_user.rst
@@ -75,6 +75,8 @@ which are then refined into their connected components using the triangulation o
the program output is:
+.. code-block:: none
+
Min function value = -0.979672 and Max function value = 0.816414
Interval 0 = [-0.979672, -0.761576]
Interval 1 = [-0.838551, -0.581967]
@@ -158,3 +160,63 @@ Using KeplerMapper, one can obtain the following visualization:
:alt: Visualization with KeplerMapper
Visualization with KeplerMapper
+
+Graph Induced Complexes (GIC)
+-----------------------------
+
+GIC definition
+^^^^^^^^^^^^^^
+
+Again, assume you are given a cover C of your point cloud P. Moreover, assume
+you are also given a graph G built on top of P. Then, for any clique in G
+whose nodes all belong to different elements of C, the GIC includes a
+corresponding simplex, whose dimension is the number of nodes in the clique
+minus one.
+See :cite:`Dey13` for more details.
+
+.. figure::
+ ../../doc/Nerve_GIC/GIC.jpg
+ :figclass: align-center
+ :alt: GIC of a point cloud
+
+ GIC of a point cloud
+
+Example with cover from Voronoï
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This example builds the GIC of a point cloud sampled on a 3D human shape
+(human.off).
+We randomly subsampled 100 points in the point cloud, which act as seeds of
+a geodesic Voronoï diagram. Each cell of the diagram is then an element of C.
+The graph G (used to compute both the geodesics for Voronoï and the GIC)
+comes from the triangulation of the human shape. Note that the resulting
+simplicial complex is in dimension 3 in this example.
+
+.. testcode::
+
+ import gudhi
+ nerve_complex = gudhi.CoverComplex()
+
+ if (nerve_complex.read_point_cloud(gudhi.__root_source_dir__ + \
+ '/data/points/human.off')):
+ nerve_complex.set_type('GIC')
+ nerve_complex.set_color_from_coordinate()
+ nerve_complex.set_graph_from_OFF()
+ nerve_complex.set_cover_from_Voronoi(700)
+ nerve_complex.find_simplices()
+ nerve_complex.plot_off()
+
+the program outputs SC.off. Using e.g.
+
+.. code-block:: none
+
+ geomview ../../data/points/human.off_sc.off
+
+one can obtain the following visualization:
+
+.. figure::
+ ../../doc/Nerve_GIC/gicvoronoivisu.jpg
+ :figclass: align-center
+ :alt: Visualization with Geomview
+
+ Visualization with Geomview
--
cgit v1.2.3
From 81a29b51428e902e89ce878cbcefb74239203414 Mon Sep 17 00:00:00 2001
From: vrouvrea
Date: Tue, 20 Mar 2018 15:27:09 +0000
Subject: Finish the documentation and examples
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/python_nerve_gic_vincent@3299 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: d60f4db274962c1c6aaef3c4ab6787bda8c0640f
---
src/Nerve_GIC/example/CoordGIC.cpp | 4 +-
src/cython/cython/nerve_gic.pyx | 2 +-
src/cython/doc/examples.rst | 4 +
src/cython/doc/nerve_gic_complex_user.rst | 90 ++++++++++++++++++++++
.../example/coordinate_graph_induced_complex.py | 68 ++++++++++++++++
.../example/functional_graph_induced_complex.py | 69 +++++++++++++++++
src/cython/example/nerve_of_a_covering.py | 70 +++++++++++++++++
.../example/voronoi_graph_induced_complex.py | 65 ++++++++++++++++
8 files changed, 369 insertions(+), 3 deletions(-)
create mode 100755 src/cython/example/coordinate_graph_induced_complex.py
create mode 100755 src/cython/example/functional_graph_induced_complex.py
create mode 100755 src/cython/example/nerve_of_a_covering.py
create mode 100755 src/cython/example/voronoi_graph_induced_complex.py
(limited to 'src/cython/doc')
diff --git a/src/Nerve_GIC/example/CoordGIC.cpp b/src/Nerve_GIC/example/CoordGIC.cpp
index c92cf235..8479c369 100644
--- a/src/Nerve_GIC/example/CoordGIC.cpp
+++ b/src/Nerve_GIC/example/CoordGIC.cpp
@@ -76,10 +76,10 @@ int main(int argc, char **argv) {
// --------------------------------------------
if (verb) {
- std::cout << "Functional GIC is of dimension " << stree.dimension() << " - " << stree.num_simplices()
+ std::cout << "Coordinate GIC is of dimension " << stree.dimension() << " - " << stree.num_simplices()
<< " simplices - " << stree.num_vertices() << " vertices." << std::endl;
- std::cout << "Iterator on functional GIC simplices" << std::endl;
+ std::cout << "Iterator on coordinate GIC simplices" << std::endl;
for (auto f_simplex : stree.filtration_simplex_range()) {
for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
std::cout << vertex << " ";
diff --git a/src/cython/cython/nerve_gic.pyx b/src/cython/cython/nerve_gic.pyx
index 32c3cd26..51c7cff4 100644
--- a/src/cython/cython/nerve_gic.pyx
+++ b/src/cython/cython/nerve_gic.pyx
@@ -268,7 +268,7 @@ cdef class CoverComplex:
"""
self.thisptr.set_function_from_range(function)
- def set_gain(self, g):
+ def set_gain(self, g = 0.3):
"""Sets a gain from a value stored in memory.
:param g: Gain (default value is 0.3).
diff --git a/src/cython/doc/examples.rst b/src/cython/doc/examples.rst
index 1e596e18..58b25793 100644
--- a/src/cython/doc/examples.rst
+++ b/src/cython/doc/examples.rst
@@ -19,3 +19,7 @@ Examples
* :download:`rips_complex_diagram_persistence_from_distance_matrix_file_example.py <../example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py>`
* :download:`rips_persistence_diagram.py <../example/rips_persistence_diagram.py>`
* :download:`random_cubical_complex_persistence_example.py <../example/random_cubical_complex_persistence_example.py>`
+ * :download:`coordinate_graph_induced_complex.py <../example/coordinate_graph_induced_complex.py>`
+ * :download:`functional_graph_induced_complex.py <../example/functional_graph_induced_complex.py>`
+ * :download:`voronoi_graph_induced_complex.py <../example/voronoi_graph_induced_complex.py>`
+ * :download:`nerve_of_a_covering.py <../example/nerve_of_a_covering.py>`
diff --git a/src/cython/doc/nerve_gic_complex_user.rst b/src/cython/doc/nerve_gic_complex_user.rst
index 7edf0578..b2669303 100644
--- a/src/cython/doc/nerve_gic_complex_user.rst
+++ b/src/cython/doc/nerve_gic_complex_user.rst
@@ -220,3 +220,93 @@ one can obtain the following visualization:
:alt: Visualization with Geomview
Visualization with Geomview
+
+Functional GIC
+^^^^^^^^^^^^^^
+
+If one restricts to the cliques in G whose nodes all belong to preimages of
+consecutive intervals (assuming the cover of the height function is minimal,
+i.e. no more than two intervals can intersect at a time), the GIC is of
+dimension one, i.e. a graph.
+We call this graph the functional GIC. See :cite:`Carriere16` for more details.
+
+Example
+^^^^^^^
+
+Functional GIC comes with automatic selection of the Rips threshold,
+the resolution and the gain of the function cover. See :cite:`Carriere17c` for
+more details. In this example, we compute the functional GIC of a Klein bottle
+embedded in R^5, where the graph G comes from a Rips complex with automatic
+threshold, and the cover C comes from the preimages of intervals covering the
+first coordinate, with automatic resolution and gain. Note that automatic
+threshold, resolution and gain can be computed as well for the Nerve.
+
+.. testcode::
+
+ import gudhi
+ nerve_complex = gudhi.CoverComplex()
+
+ if (nerve_complex.read_point_cloud(gudhi.__root_source_dir__ + \
+ '/data/points/KleinBottle5D.off')):
+ nerve_complex.set_type('GIC')
+ nerve_complex.set_color_from_coordinate(0)
+ nerve_complex.set_function_from_coordinate(0)
+ nerve_complex.set_graph_from_automatic_rips()
+ nerve_complex.set_automatic_resolution()
+ nerve_complex.set_gain()
+ nerve_complex.set_cover_from_function()
+ nerve_complex.find_simplices()
+ nerve_complex.plot_dot()
+
+the program outputs SC.dot. Using e.g.
+
+.. code-block:: none
+
+ neato ../../data/points/KleinBottle5D.off_sc.dot -Tpdf -o ../../data/points/KleinBottle5D.off_sc.pdf
+
+one can obtain the following visualization:
+
+.. figure::
+ ../../doc/Nerve_GIC/coordGICvisu2.jpg
+ :figclass: align-center
+ :alt: Visualization with neato
+
+ Visualization with neato
+
+where nodes are colored by the filter function values and, for each node, the
+first number is its ID and the second is the number of data points that its
+contain.
+
+We also provide an example on a set of 72 pictures taken around the same object
+(lucky_cat.off).
+The function is now the first eigenfunction given by PCA, whose values are
+written in a file (lucky_cat_PCA1). Threshold, resolution and gain are
+automatically selected as before.
+
+.. testcode::
+
+ import gudhi
+ nerve_complex = gudhi.CoverComplex()
+
+ if (nerve_complex.read_point_cloud(gudhi.__root_source_dir__ + \
+ '/data/points/COIL_database/lucky_cat.off')):
+ nerve_complex.set_type('GIC')
+ pca_file = gudhi.__root_source_dir__ + \
+ '/data/points/COIL_database/lucky_cat_PCA1'
+ nerve_complex.set_color_from_file(pca_file)
+ nerve_complex.set_function_from_file(pca_file)
+ nerve_complex.set_graph_from_automatic_rips()
+ nerve_complex.set_automatic_resolution()
+ nerve_complex.set_gain()
+ nerve_complex.set_cover_from_function()
+ nerve_complex.find_simplices()
+ nerve_complex.plot_dot()
+
+the program outputs again SC.dot which gives the following visualization after using neato:
+
+.. figure::
+ ../../doc/Nerve_GIC/funcGICvisu.jpg
+ :figclass: align-center
+ :alt: Visualization with neato
+
+ Visualization with neato
diff --git a/src/cython/example/coordinate_graph_induced_complex.py b/src/cython/example/coordinate_graph_induced_complex.py
new file mode 100755
index 00000000..71b87f7a
--- /dev/null
+++ b/src/cython/example/coordinate_graph_induced_complex.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+
+import gudhi
+import argparse
+
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2018 Inria
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2018 Inria"
+__license__ = "GPL v3"
+
+parser = argparse.ArgumentParser(description='Coordinate GIC '
+ 'from points read in a OFF file.',
+ epilog='Example: '
+ 'example/coordinate_graph_induced_complex.py '
+ '-f ../data/points/KleinBottle5D.off 0 -v'
+ '- Constructs the coordinate GIC with the '
+ 'points from the given OFF file.')
+parser.add_argument("-f", "--file", type=str, required=True)
+parser.add_argument("-c", "--coordinate", type=int, default=0)
+parser.add_argument("-v", "--verbose", default=False, action='store_true' , help='Flag for program verbosity')
+
+args = parser.parse_args()
+
+nerve_complex = gudhi.CoverComplex()
+nerve_complex.set_verbose(args.verbose)
+
+if (nerve_complex.read_point_cloud(args.file)):
+ nerve_complex.set_type('GIC')
+ nerve_complex.set_color_from_coordinate(args.coordinate)
+ nerve_complex.set_function_from_coordinate(args.coordinate)
+ nerve_complex.set_graph_from_automatic_rips()
+ nerve_complex.set_automatic_resolution()
+ nerve_complex.set_gain()
+ nerve_complex.set_cover_from_function()
+ nerve_complex.find_simplices()
+ nerve_complex.plot_dot()
+ simplex_tree = nerve_complex.create_simplex_tree()
+ nerve_complex.compute_PD()
+ if (args.verbose):
+ print('Iterator on coordinate GIC simplices')
+ result_str = 'Coordinate GIC is of dimension ' + \
+ repr(simplex_tree.dimension()) + ' - ' + \
+ repr(simplex_tree.num_simplices()) + ' simplices - ' + \
+ repr(simplex_tree.num_vertices()) + ' vertices.'
+ print(result_str)
+ for filtered_value in simplex_tree.get_filtration():
+ print(filtered_value[0])
diff --git a/src/cython/example/functional_graph_induced_complex.py b/src/cython/example/functional_graph_induced_complex.py
new file mode 100755
index 00000000..6ad7c2ec
--- /dev/null
+++ b/src/cython/example/functional_graph_induced_complex.py
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+
+import gudhi
+import argparse
+
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2018 Inria
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2018 Inria"
+__license__ = "GPL v3"
+
+parser = argparse.ArgumentParser(description='Functional GIC '
+ 'from points read in a OFF file.',
+ epilog='Example: '
+ 'example/functional_graph_induced_complex.py '
+ '-o ../data/points/COIL_database/lucky_cat.off '
+ '-f ../data/points/COIL_database/lucky_cat_PCA1'
+ '- Constructs the functional GIC with the '
+ 'points from the given OFF and function files.')
+parser.add_argument("-o", "--off-file", type=str, required=True)
+parser.add_argument("-f", "--function-file", type=str, required=True)
+parser.add_argument("-v", "--verbose", default=False, action='store_true' , help='Flag for program verbosity')
+
+args = parser.parse_args()
+
+nerve_complex = gudhi.CoverComplex()
+nerve_complex.set_verbose(args.verbose)
+
+if (nerve_complex.read_point_cloud(args.off_file)):
+ nerve_complex.set_type('GIC')
+ nerve_complex.set_color_from_file(args.function_file)
+ nerve_complex.set_function_from_file(args.function_file)
+ nerve_complex.set_graph_from_automatic_rips()
+ nerve_complex.set_automatic_resolution()
+ nerve_complex.set_gain()
+ nerve_complex.set_cover_from_function()
+ nerve_complex.find_simplices()
+ nerve_complex.plot_dot()
+ simplex_tree = nerve_complex.create_simplex_tree()
+ nerve_complex.compute_PD()
+ if (args.verbose):
+ print('Iterator on functional GIC simplices')
+ result_str = 'Functional GIC is of dimension ' + \
+ repr(simplex_tree.dimension()) + ' - ' + \
+ repr(simplex_tree.num_simplices()) + ' simplices - ' + \
+ repr(simplex_tree.num_vertices()) + ' vertices.'
+ print(result_str)
+ for filtered_value in simplex_tree.get_filtration():
+ print(filtered_value[0])
diff --git a/src/cython/example/nerve_of_a_covering.py b/src/cython/example/nerve_of_a_covering.py
new file mode 100755
index 00000000..c5577cb1
--- /dev/null
+++ b/src/cython/example/nerve_of_a_covering.py
@@ -0,0 +1,70 @@
+#!/usr/bin/env python
+
+import gudhi
+import argparse
+
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2018 Inria
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2018 Inria"
+__license__ = "GPL v3"
+
+parser = argparse.ArgumentParser(description='Nerve of a covering creation '
+ 'from points read in a OFF file.',
+ epilog='Example: '
+ 'example/nerve_of_a_covering.py '
+ '-f ../data/points/human.off -c 2 -r 10 -g 0.3'
+ '- Constructs Nerve of a covering with the '
+ 'points from the given OFF file.')
+parser.add_argument("-f", "--file", type=str, required=True)
+parser.add_argument("-c", "--coordinate", type=int, default=0)
+parser.add_argument("-r", "--resolution", type=int, default=10)
+parser.add_argument("-g", "--gain", type=float, default=0.3)
+parser.add_argument("-v", "--verbose", default=False, action='store_true' , help='Flag for program verbosity')
+
+args = parser.parse_args()
+
+nerve_complex = gudhi.CoverComplex()
+nerve_complex.set_verbose(args.verbose)
+
+if (nerve_complex.read_point_cloud(args.file)):
+ nerve_complex.set_type('Nerve')
+ nerve_complex.set_color_from_coordinate(args.coordinate)
+ nerve_complex.set_function_from_coordinate(args.coordinate)
+ nerve_complex.set_graph_from_OFF()
+ nerve_complex.set_resolution_with_interval_number(args.resolution)
+ nerve_complex.set_gain(args.gain)
+ nerve_complex.set_cover_from_function()
+ nerve_complex.find_simplices()
+ nerve_complex.write_info()
+ simplex_tree = nerve_complex.create_simplex_tree()
+ nerve_complex.compute_PD()
+ if (args.verbose):
+ print('Iterator on graph induced complex simplices')
+ result_str = 'Nerve is of dimension ' + \
+ repr(simplex_tree.dimension()) + ' - ' + \
+ repr(simplex_tree.num_simplices()) + ' simplices - ' + \
+ repr(simplex_tree.num_vertices()) + ' vertices.'
+ print(result_str)
+ for filtered_value in simplex_tree.get_filtration():
+ print(filtered_value[0])
diff --git a/src/cython/example/voronoi_graph_induced_complex.py b/src/cython/example/voronoi_graph_induced_complex.py
new file mode 100755
index 00000000..8266a0e4
--- /dev/null
+++ b/src/cython/example/voronoi_graph_induced_complex.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+
+import gudhi
+import argparse
+
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2018 Inria
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2018 Inria"
+__license__ = "GPL v3"
+
+parser = argparse.ArgumentParser(description='Voronoi GIC '
+ 'from points read in a OFF file.',
+ epilog='Example: '
+ 'example/voronoi_graph_induced_complex.py '
+ '-f ../data/points/human.off -n 700 -v'
+ '- Constructs the Voronoi GIC with the '
+ 'points from the given OFF file.')
+parser.add_argument("-f", "--file", type=str, required=True)
+parser.add_argument("-n", "--subsample-nb-points", type=int, default=100)
+parser.add_argument("-v", "--verbose", default=False, action='store_true' , help='Flag for program verbosity')
+
+args = parser.parse_args()
+
+nerve_complex = gudhi.CoverComplex()
+nerve_complex.set_verbose(args.verbose)
+
+if (nerve_complex.read_point_cloud(args.file)):
+ nerve_complex.set_type('GIC')
+ nerve_complex.set_color_from_coordinate()
+ nerve_complex.set_graph_from_OFF()
+ nerve_complex.set_cover_from_Voronoi(args.subsample_nb_points)
+ nerve_complex.find_simplices()
+ nerve_complex.plot_off()
+ simplex_tree = nerve_complex.create_simplex_tree()
+ nerve_complex.compute_PD()
+ if (args.verbose):
+ print('Iterator on graph induced complex simplices')
+ result_str = 'Graph induced complex is of dimension ' + \
+ repr(simplex_tree.dimension()) + ' - ' + \
+ repr(simplex_tree.num_simplices()) + ' simplices - ' + \
+ repr(simplex_tree.num_vertices()) + ' vertices.'
+ print(result_str)
+ for filtered_value in simplex_tree.get_filtration():
+ print(filtered_value[0])
--
cgit v1.2.3
From 3ce013afc21df5d05d663dd17a6640cec9af4aed Mon Sep 17 00:00:00 2001
From: vrouvrea
Date: Tue, 24 Apr 2018 12:31:44 +0000
Subject: Fix Python tangential complex version
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/python_2.1.0_fix_vincent@3392 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: f0d9e008229a6cd7868f4afd11eaf3c566e81adf
---
src/cython/CMakeLists.txt | 2 +-
src/cython/cython/tangential_complex.pyx | 15 +++++++++------
src/cython/doc/tangential_complex_user.rst | 7 ++++---
...ential_complex_plain_homology_from_off_file_example.py | 5 +++--
src/cython/include/Tangential_complex_interface.h | 13 ++++---------
src/cython/test/test_tangential_complex.py | 2 +-
6 files changed, 22 insertions(+), 22 deletions(-)
(limited to 'src/cython/doc')
diff --git a/src/cython/CMakeLists.txt b/src/cython/CMakeLists.txt
index b19cc550..f9721b46 100644
--- a/src/cython/CMakeLists.txt
+++ b/src/cython/CMakeLists.txt
@@ -183,7 +183,7 @@ if(CYTHON_FOUND)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}"
${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/tangential_complex_plain_homology_from_off_file_example.py"
- --no-diagram -f ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off)
+ --no-diagram -i 2 -f ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off)
add_gudhi_py_test(test_tangential_complex)
diff --git a/src/cython/cython/tangential_complex.pyx b/src/cython/cython/tangential_complex.pyx
index d55bb050..44a3a96a 100644
--- a/src/cython/cython/tangential_complex.pyx
+++ b/src/cython/cython/tangential_complex.pyx
@@ -33,9 +33,9 @@ __license__ = "GPL v3"
cdef extern from "Tangential_complex_interface.h" namespace "Gudhi":
cdef cppclass Tangential_complex_interface "Gudhi::tangential_complex::Tangential_complex_interface":
- Tangential_complex_interface(vector[vector[double]] points)
+ Tangential_complex_interface(int intrisic_dim, vector[vector[double]] points)
# bool from_file is a workaround for cython to find the correct signature
- Tangential_complex_interface(string off_file, bool from_file)
+ Tangential_complex_interface(int intrisic_dim, string off_file, bool from_file)
vector[double] get_point(unsigned vertex)
unsigned number_of_vertices()
unsigned number_of_simplices()
@@ -54,9 +54,12 @@ cdef class TangentialComplex:
cdef Tangential_complex_interface * thisptr
# Fake constructor that does nothing but documenting the constructor
- def __init__(self, points=None, off_file=''):
+ def __init__(self, intrisic_dim, points=None, off_file=''):
"""TangentialComplex constructor.
+ :param intrisic_dim: Intrinsic dimension of the manifold.
+ :type intrisic_dim: integer
+
:param points: A list of points in d-Dimension.
:type points: list of list of double
@@ -67,17 +70,17 @@ cdef class TangentialComplex:
"""
# The real cython constructor
- def __cinit__(self, points=None, off_file=''):
+ def __cinit__(self, intrisic_dim, points=None, off_file=''):
if off_file is not '':
if os.path.isfile(off_file):
- self.thisptr = new Tangential_complex_interface(str.encode(off_file), True)
+ self.thisptr = new Tangential_complex_interface(intrisic_dim, str.encode(off_file), True)
else:
print("file " + off_file + " not found.")
else:
if points is None:
# Empty tangential construction
points=[]
- self.thisptr = new Tangential_complex_interface(points)
+ self.thisptr = new Tangential_complex_interface(intrisic_dim, points)
def __dealloc__(self):
diff --git a/src/cython/doc/tangential_complex_user.rst b/src/cython/doc/tangential_complex_user.rst
index efa6d7ce..fafb3193 100644
--- a/src/cython/doc/tangential_complex_user.rst
+++ b/src/cython/doc/tangential_complex_user.rst
@@ -122,8 +122,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 +169,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/src/cython/example/tangential_complex_plain_homology_from_off_file_example.py b/src/cython/example/tangential_complex_plain_homology_from_off_file_example.py
index 6145e7f2..08ae5d07 100755
--- a/src/cython/example/tangential_complex_plain_homology_from_off_file_example.py
+++ b/src/cython/example/tangential_complex_plain_homology_from_off_file_example.py
@@ -33,10 +33,11 @@ parser = argparse.ArgumentParser(description='TangentialComplex creation from '
'points read in a OFF file.',
epilog='Example: '
'example/tangential_complex_plain_homology_from_off_file_example.py '
- '-f ../data/points/tore3D_300.off'
+ '-f ../data/points/tore3D_300.off -i 3'
'- Constructs a tangential complex with the '
'points from the given OFF file')
parser.add_argument("-f", "--file", type=str, required=True)
+parser.add_argument("-i", "--intrisic_dim", type=int, required=True)
parser.add_argument("-b", "--band_boot", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
@@ -48,7 +49,7 @@ with open(args.file, 'r') as f:
print("#####################################################################")
print("TangentialComplex creation from points read in a OFF file")
- tc = gudhi.TangentialComplex(off_file=args.file)
+ tc = gudhi.TangentialComplex(intrisic_dim = args.intrisic_dim, off_file=args.file)
st = tc.create_simplex_tree()
message = "Number of simplices=" + repr(st.num_simplices())
diff --git a/src/cython/include/Tangential_complex_interface.h b/src/cython/include/Tangential_complex_interface.h
index 0c3a510e..aef50424 100644
--- a/src/cython/include/Tangential_complex_interface.h
+++ b/src/cython/include/Tangential_complex_interface.h
@@ -45,24 +45,19 @@ class Tangential_complex_interface {
using TC = Tangential_complex;
public:
- Tangential_complex_interface(const std::vector>& points) {
+ Tangential_complex_interface(int intrisic_dim, const std::vector>& points) {
Dynamic_kernel k;
- unsigned intrisic_dim = 0;
- if (points.size() > 0)
- intrisic_dim = points[0].size() - 1;
tangential_complex_ = new TC(points, intrisic_dim, k);
tangential_complex_->compute_tangential_complex();
num_inconsistencies_ = tangential_complex_->number_of_inconsistent_simplices();
}
- Tangential_complex_interface(const std::string& off_file_name, bool from_file = true) {
- Gudhi::Points_off_reader off_reader(off_file_name);
+ Tangential_complex_interface(int intrisic_dim, const std::string& off_file_name, bool from_file = true) {
Dynamic_kernel k;
- unsigned intrisic_dim = 0;
+
+ Gudhi::Points_off_reader off_reader(off_file_name);
std::vector points = off_reader.get_point_cloud();
- if (points.size() > 0)
- intrisic_dim = points[0].size() - 1;
tangential_complex_ = new TC(points, intrisic_dim, k);
tangential_complex_->compute_tangential_complex();
diff --git a/src/cython/test/test_tangential_complex.py b/src/cython/test/test_tangential_complex.py
index 8aa4023c..ca9d936d 100755
--- a/src/cython/test/test_tangential_complex.py
+++ b/src/cython/test/test_tangential_complex.py
@@ -29,7 +29,7 @@ __license__ = "GPL v3"
def test_tangential():
point_list = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 1.0]]
- tc = TangentialComplex(points=point_list)
+ tc = TangentialComplex(intrisic_dim = 1, points=point_list)
assert tc.__is_defined() == True
assert tc.num_vertices() == 4
--
cgit v1.2.3
From 7ac3c086c6c794ac8c493a2c3abbd59624e81c06 Mon Sep 17 00:00:00 2001
From: vrouvrea
Date: Fri, 27 Apr 2018 13:00:38 +0000
Subject: Code and doc review with IFPEN : plot_*: c'est quoi ce paramètre
alpha ?
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
band_boot: Renommer en 'band', sans référence au bootstrap. Ne pas
l'utiliser dans la majorité des exemples / tutos.
max_plots: mettre une valeur par défaut, pour éviter qu'on se retrouve
trop facilement coincé à attendre 1h qu'il affiche des points.
Éventuellement afficher un message indiquant que certains points n'ont pas
été affichés et comment changer ça.
barcode: trier les barres par date de naissance (le faire
tout le temps ou avoir une option et le faire par défaut).
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/python_2.1.0_fix_vincent@3404 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: cfa775e425fbf12da1758d601ccbd80a2c7d3bc9
---
src/cython/cython/persistence_graphical_tools.py | 41 +++++++++++++---------
.../doc/persistence_graphical_tools_user.rst | 4 +--
src/cython/doc/pyplots/diagram_persistence.py | 2 +-
...ex_diagram_persistence_from_off_file_example.py | 4 +--
...ex_diagram_persistence_from_off_file_example.py | 4 +--
...ex_diagram_persistence_from_off_file_example.py | 4 +--
.../example/gudhi_graphical_tools_example.py | 2 +-
...istence_from_correlation_matrix_file_example.py | 4 +--
...ersistence_from_distance_matrix_file_example.py | 4 +--
...ex_diagram_persistence_from_off_file_example.py | 4 +--
...complex_plain_homology_from_off_file_example.py | 4 +--
11 files changed, 42 insertions(+), 35 deletions(-)
(limited to 'src/cython/doc')
diff --git a/src/cython/cython/persistence_graphical_tools.py b/src/cython/cython/persistence_graphical_tools.py
index fb837e29..f7dadb53 100755
--- a/src/cython/cython/persistence_graphical_tools.py
+++ b/src/cython/cython/persistence_graphical_tools.py
@@ -28,13 +28,13 @@ __author__ = "Vincent Rouvreau, Bertrand Michel"
__copyright__ = "Copyright (C) 2016 INRIA"
__license__ = "GPL v3"
-def __min_birth_max_death(persistence, band_boot=0.):
+def __min_birth_max_death(persistence, band=0.):
"""This function returns (min_birth, max_death) from the persistence.
:param persistence: The persistence to plot.
:type persistence: list of tuples(dimension, tuple(birth, death)).
- :param band_boot: bootstrap band
- :type band_boot: float.
+ :param band: band
+ :type band: float.
:returns: (float, float) -- (min_birth, max_death).
"""
# Look for minimum birth date and maximum death date for plot optimisation
@@ -48,8 +48,8 @@ def __min_birth_max_death(persistence, band_boot=0.):
max_death = float(interval[1][0])
if float(interval[1][0]) < min_birth:
min_birth = float(interval[1][0])
- if band_boot > 0.:
- max_death += band_boot
+ if band > 0.:
+ max_death += band
return (min_birth, max_death)
"""
@@ -77,16 +77,17 @@ def show_palette_values(alpha=0.6):
plt.title('Dimension palette values')
return plt
-def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max_barcodes=0):
+def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max_barcodes=1000):
"""This function plots the persistence bar code.
:param persistence: The persistence to plot.
:type persistence: list of tuples(dimension, tuple(birth, death)).
:param persistence_file: A persistence file style name (reset persistence if both are set).
:type persistence_file: string
- :param alpha: alpha value in [0.0, 1.0] for horizontal bars (default is 0.6).
+ :param alpha: barcode transparency value (0.0 transparent through 1.0 opaque - default is 0.6).
:type alpha: float.
- :param max_barcodes: number of maximal barcodes to be displayed
+ :param max_barcodes: number of maximal barcodes to be displayed.
+ Set it to 0 to see all, Default value is 1000.
(persistence will be sorted by life time if max_barcodes is set)
:type max_barcodes: int.
:returns: plot -- An horizontal bar plot of persistence.
@@ -107,6 +108,8 @@ def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max
# Sort by life time, then takes only the max_plots elements
persistence = sorted(persistence, key=lambda life_time: life_time[1][1]-life_time[1][0], reverse=True)[:max_barcodes]
+ persistence = sorted(persistence, key=lambda birth: birth[1][0])
+
(min_birth, max_death) = __min_birth_max_death(persistence)
ind = 0
delta = ((max_death - min_birth) / 10.0)
@@ -120,12 +123,14 @@ def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max
# Finite death case
plt.barh(ind, (interval[1][1] - interval[1][0]), height=0.8,
left = interval[1][0], alpha=alpha,
- color = palette[interval[0]])
+ color = palette[interval[0]],
+ linewidth=0)
else:
# Infinite death case for diagram to be nicer
plt.barh(ind, (infinity - interval[1][0]), height=0.8,
left = interval[1][0], alpha=alpha,
- color = palette[interval[0]])
+ color = palette[interval[0]],
+ linewidth=0)
ind = ind + 1
plt.title('Persistence barcode')
@@ -133,18 +138,20 @@ def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max
plt.axis([axis_start, infinity, 0, ind])
return plt
-def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, band_boot=0., max_plots=0):
+def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, band=0., max_plots=1000):
"""This function plots the persistence diagram with an optional confidence band.
:param persistence: The persistence to plot.
:type persistence: list of tuples(dimension, tuple(birth, death)).
:param persistence_file: A persistence file style name (reset persistence if both are set).
:type persistence_file: string
- :param alpha: alpha value in [0.0, 1.0] for points and horizontal infinity line (default is 0.6).
+ :param alpha: plot transparency value (0.0 transparent through 1.0 opaque - default is 0.6).
:type alpha: float.
- :param band_boot: bootstrap band (not displayed if :math:`\leq` 0.)
- :type band_boot: float.
+ :param band: band (not displayed if :math:`\leq` 0. - default is 0.)
+ :type band: float.
:param max_plots: number of maximal plots to be displayed
+ Set it to 0 to see all, Default value is 1000.
+ (persistence will be sorted by life time if max_plots is set)
:type max_plots: int.
:returns: plot -- A diagram plot of persistence.
"""
@@ -164,7 +171,7 @@ def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, ban
# Sort by life time, then takes only the max_plots elements
persistence = sorted(persistence, key=lambda life_time: life_time[1][1]-life_time[1][0], reverse=True)[:max_plots]
- (min_birth, max_death) = __min_birth_max_death(persistence, band_boot)
+ (min_birth, max_death) = __min_birth_max_death(persistence, band)
ind = 0
delta = ((max_death - min_birth) / 10.0)
# Replace infinity values with max_death + delta for diagram to be more
@@ -179,8 +186,8 @@ def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, ban
plt.plot(x, [infinity] * len(x), linewidth=1.0, color='k', alpha=alpha)
plt.text(axis_start, infinity, r'$\infty$', color='k', alpha=alpha)
# bootstrap band
- if band_boot > 0.:
- plt.fill_between(x, x, x+band_boot, alpha=alpha, facecolor='red')
+ if band > 0.:
+ plt.fill_between(x, x, x+band, alpha=alpha, facecolor='red')
# Draw points in loop
for interval in reversed(persistence):
diff --git a/src/cython/doc/persistence_graphical_tools_user.rst b/src/cython/doc/persistence_graphical_tools_user.rst
index a5523d23..290b13c3 100644
--- a/src/cython/doc/persistence_graphical_tools_user.rst
+++ b/src/cython/doc/persistence_graphical_tools_user.rst
@@ -62,7 +62,7 @@ This function can display the persistence result as a diagram:
rips_complex = gudhi.RipsComplex(points=point_cloud, 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 = gudhi.plot_persistence_diagram(diag)
plt.show()
.. plot::
@@ -73,5 +73,5 @@ This function can display the persistence result as a diagram:
rips_complex = gudhi.RipsComplex(points=point_cloud, 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 = gudhi.plot_persistence_diagram(diag)
plt.show()
diff --git a/src/cython/doc/pyplots/diagram_persistence.py b/src/cython/doc/pyplots/diagram_persistence.py
index ac20bf47..5abf52b9 100755
--- a/src/cython/doc/pyplots/diagram_persistence.py
+++ b/src/cython/doc/pyplots/diagram_persistence.py
@@ -5,5 +5,5 @@ point_cloud = gudhi.read_off(off_file=gudhi.__root_source_dir__ + \
rips_complex = gudhi.RipsComplex(points=point_cloud, 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 = gudhi.plot_persistence_diagram(diag)
plt.show()
diff --git a/src/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py b/src/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py
index b4487be4..10d4867a 100755
--- a/src/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py
+++ b/src/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py
@@ -38,7 +38,7 @@ parser = argparse.ArgumentParser(description='AlphaComplex creation from '
'points from the given OFF file.')
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-a", "--max_alpha_square", type=float, default=0.5)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -64,7 +64,7 @@ with open(args.file, 'r') as f:
print(simplex_tree.betti_numbers())
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
else:
print(args.file, "is not a valid OFF file")
diff --git a/src/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py b/src/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py
index e3f362dc..28a8599c 100755
--- a/src/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py
+++ b/src/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py
@@ -40,7 +40,7 @@ parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-a", "--max_alpha_square", type=float, required=True)
parser.add_argument("-n", "--number_of_landmarks", type=int, required=True)
parser.add_argument("-d", "--limit_dimension", type=int, required=True)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -71,7 +71,7 @@ with open(args.file, 'r') as f:
print(simplex_tree.betti_numbers())
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
else:
print(args.file, "is not a valid OFF file")
diff --git a/src/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py b/src/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py
index c236d992..b19d7d8c 100755
--- a/src/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py
+++ b/src/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py
@@ -40,7 +40,7 @@ parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-a", "--max_alpha_square", type=float, required=True)
parser.add_argument("-n", "--number_of_landmarks", type=int, required=True)
parser.add_argument("-d", "--limit_dimension", type=int, required=True)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -71,7 +71,7 @@ with open(args.file, 'r') as f:
print(simplex_tree.betti_numbers())
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
else:
print(args.file, "is not a valid OFF file")
diff --git a/src/cython/example/gudhi_graphical_tools_example.py b/src/cython/example/gudhi_graphical_tools_example.py
index ed87806b..97983262 100755
--- a/src/cython/example/gudhi_graphical_tools_example.py
+++ b/src/cython/example/gudhi_graphical_tools_example.py
@@ -50,5 +50,5 @@ pplot.show()
print("#####################################################################")
print("Show diagram persistence example with a confidence band")
-pplot = gudhi.plot_persistence_diagram(persistence, band_boot=0.2)
+pplot = gudhi.plot_persistence_diagram(persistence, band=0.2)
pplot.show()
diff --git a/src/cython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py b/src/cython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py
index aa82ef71..0af4397a 100755
--- a/src/cython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py
+++ b/src/cython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py
@@ -40,7 +40,7 @@ parser = argparse.ArgumentParser(description='RipsComplex creation from '
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-c", "--min_edge_correlation", type=float, default=0.5)
parser.add_argument("-d", "--max_dimension", type=int, default=1)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -80,5 +80,5 @@ print(simplex_tree.betti_numbers())
invert_diag = [(diag[pers][0],(1.-diag[pers][1][0], 1.-diag[pers][1][1])) for pers in range(len(diag))]
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(invert_diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(invert_diag, band=args.band)
pplot.show()
diff --git a/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py b/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py
index c8aac240..266c09ca 100755
--- a/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py
+++ b/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py
@@ -39,7 +39,7 @@ parser = argparse.ArgumentParser(description='RipsComplex creation from '
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-e", "--max_edge_length", type=float, default=0.5)
parser.add_argument("-d", "--max_dimension", type=int, default=1)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -63,5 +63,5 @@ print("betti_numbers()=")
print(simplex_tree.betti_numbers())
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
diff --git a/src/cython/example/rips_complex_diagram_persistence_from_off_file_example.py b/src/cython/example/rips_complex_diagram_persistence_from_off_file_example.py
index 544b68c9..fede920c 100755
--- a/src/cython/example/rips_complex_diagram_persistence_from_off_file_example.py
+++ b/src/cython/example/rips_complex_diagram_persistence_from_off_file_example.py
@@ -39,7 +39,7 @@ parser = argparse.ArgumentParser(description='RipsComplex creation from '
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-e", "--max_edge_length", type=float, default=0.5)
parser.add_argument("-d", "--max_dimension", type=int, default=1)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -66,7 +66,7 @@ with open(args.file, 'r') as f:
print(simplex_tree.betti_numbers())
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
else:
print(args.file, "is not a valid OFF file")
diff --git a/src/cython/example/tangential_complex_plain_homology_from_off_file_example.py b/src/cython/example/tangential_complex_plain_homology_from_off_file_example.py
index 08ae5d07..1f562b5c 100755
--- a/src/cython/example/tangential_complex_plain_homology_from_off_file_example.py
+++ b/src/cython/example/tangential_complex_plain_homology_from_off_file_example.py
@@ -38,7 +38,7 @@ parser = argparse.ArgumentParser(description='TangentialComplex creation from '
'points from the given OFF file')
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-i", "--intrisic_dim", type=int, required=True)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -61,7 +61,7 @@ with open(args.file, 'r') as f:
print(st.betti_numbers())
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
else:
print(args.file, "is not a valid OFF file")
--
cgit v1.2.3
From 0902c35ad4701d78a91b30e2d055a529f4de01d5 Mon Sep 17 00:00:00 2001
From: vrouvrea
Date: Fri, 27 Apr 2018 16:03:43 +0000
Subject: Remove show_palette_values Add legend flag to display the legend Set
rips threshold to 0.3 for users not to be surprised when playing with
threshold
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/python_2.1.0_fix_vincent@3406 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 03999711eafb81748a82b5725482a9f0d4307861
---
src/cython/cython/persistence_graphical_tools.py | 43 ++++++++++------------
src/cython/doc/persistence_graphical_tools_ref.rst | 1 -
.../doc/persistence_graphical_tools_user.rst | 22 +----------
src/cython/doc/pyplots/diagram_persistence.py | 2 +-
src/cython/doc/pyplots/show_palette_values.py | 3 --
.../example/gudhi_graphical_tools_example.py | 5 ---
6 files changed, 23 insertions(+), 53 deletions(-)
delete mode 100755 src/cython/doc/pyplots/show_palette_values.py
(limited to 'src/cython/doc')
diff --git a/src/cython/cython/persistence_graphical_tools.py b/src/cython/cython/persistence_graphical_tools.py
index 98e875b0..118fdd1a 100755
--- a/src/cython/cython/persistence_graphical_tools.py
+++ b/src/cython/cython/persistence_graphical_tools.py
@@ -1,4 +1,5 @@
import matplotlib.pyplot as plt
+import matplotlib.patches as mpatches
import numpy as np
import os
@@ -59,26 +60,8 @@ palette = ['#ff0000', '#00ff00', '#0000ff', '#00ffff', '#ff00ff', '#ffff00',
'#000000', '#880000', '#008800', '#000088', '#888800', '#880088',
'#008888']
-def show_palette_values(alpha=0.6):
- """This function shows palette color values in function of the dimension.
-
- :param alpha: alpha value in [0.0, 1.0] for horizontal bars (default is 0.6).
- :type alpha: float.
- :returns: A matplotlib object containing dimension palette values (launch
- `show()` method on it to display it).
- """
- colors = []
- for color in palette:
- colors.append(color)
-
- y_pos = np.arange(len(palette))
-
- plt.barh(y_pos, y_pos + 1, align='center', alpha=alpha, color=colors)
- plt.ylabel('Dimension')
- plt.title('Dimension palette values')
- return plt
-
-def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max_barcodes=1000):
+def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6,
+ max_barcodes=1000, inf_delta=0.1, legend=False):
"""This function plots the persistence bar code from persistence values list
or from a :doc:`persistence file `.
@@ -93,6 +76,9 @@ def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max
Set it to 0 to see all, Default value is 1000.
(persistence will be sorted by life time if max_barcodes is set)
:type max_barcodes: int.
+ :param inf_delta: Infinity is placed at ((max_death - min_birth) x inf_delta).
+ A reasonable value is between 0.05 and 0.5 - default is 0.1.
+ :type inf_delta: float.
:returns: A matplotlib object containing horizontal bar plot of persistence
(launch `show()` method on it to display it).
"""
@@ -116,7 +102,7 @@ def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max
(min_birth, max_death) = __min_birth_max_death(persistence)
ind = 0
- delta = ((max_death - min_birth) / 10.0)
+ delta = ((max_death - min_birth) * inf_delta)
# Replace infinity values with max_death + delta for bar code to be more
# readable
infinity = max_death + delta
@@ -137,12 +123,16 @@ def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max
linewidth=0)
ind = ind + 1
+ if legend:
+ dimensions = list(set(item[0] for item in persistence))
+ plt.legend(handles=[mpatches.Patch(color=palette[dim], label=str(dim)) for dim in dimensions])
plt.title('Persistence barcode')
# Ends plot on infinity value and starts a little bit before min_birth
plt.axis([axis_start, infinity, 0, ind])
return plt
-def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, band=0., max_plots=1000):
+def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6,
+ band=0., max_plots=1000, inf_delta=0.1, legend=False):
"""This function plots the persistence diagram from persistence values list
or from a :doc:`persistence file `.
@@ -159,6 +149,9 @@ def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, ban
Set it to 0 to see all, Default value is 1000.
(persistence will be sorted by life time if max_plots is set)
:type max_plots: int.
+ :param inf_delta: Infinity is placed at ((max_death - min_birth) x inf_delta).
+ A reasonable value is between 0.05 and 0.5 - default is 0.1.
+ :type inf_delta: float.
:returns: A matplotlib object containing diagram plot of persistence
(launch `show()` method on it to display it).
"""
@@ -180,7 +173,7 @@ def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, ban
(min_birth, max_death) = __min_birth_max_death(persistence, band)
ind = 0
- delta = ((max_death - min_birth) / 10.0)
+ delta = ((max_death - min_birth) * inf_delta)
# Replace infinity values with max_death + delta for diagram to be more
# readable
infinity = max_death + delta
@@ -208,6 +201,10 @@ def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, ban
color = palette[interval[0]])
ind = ind + 1
+ if legend:
+ dimensions = list(set(item[0] for item in persistence))
+ plt.legend(handles=[mpatches.Patch(color=palette[dim], label=str(dim)) for dim in dimensions])
+
plt.title('Persistence diagram')
plt.xlabel('Birth')
plt.ylabel('Death')
diff --git a/src/cython/doc/persistence_graphical_tools_ref.rst b/src/cython/doc/persistence_graphical_tools_ref.rst
index 27c2f68a..a69c8ba2 100644
--- a/src/cython/doc/persistence_graphical_tools_ref.rst
+++ b/src/cython/doc/persistence_graphical_tools_ref.rst
@@ -3,6 +3,5 @@ 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/src/cython/doc/persistence_graphical_tools_user.rst b/src/cython/doc/persistence_graphical_tools_user.rst
index 290b13c3..46f871c7 100644
--- a/src/cython/doc/persistence_graphical_tools_user.rst
+++ b/src/cython/doc/persistence_graphical_tools_user.rst
@@ -5,24 +5,6 @@ Definition
.. include:: persistence_graphical_tools_sum.rst
-Show palette values
--------------------
-
-This function is useful to show the color palette values of dimension:
-
-
-.. 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
-----------------------------
@@ -59,7 +41,7 @@ This function can display the persistence result as a diagram:
import gudhi
point_cloud = gudhi.read_off(off_file=gudhi.__root_source_dir__ + '/data/points/tore3D_1307.off')
- rips_complex = gudhi.RipsComplex(points=point_cloud, max_edge_length=0.2)
+ rips_complex = gudhi.RipsComplex(points=point_cloud, max_edge_length=0.3)
simplex_tree = rips_complex.create_simplex_tree(max_dimension=3)
diag = simplex_tree.persistence()
plt = gudhi.plot_persistence_diagram(diag)
@@ -70,7 +52,7 @@ This function can display the persistence result as a diagram:
import gudhi
point_cloud = gudhi.read_off(off_file=gudhi.__root_source_dir__ + '/data/points/tore3D_1307.off')
- rips_complex = gudhi.RipsComplex(points=point_cloud, max_edge_length=0.2)
+ rips_complex = gudhi.RipsComplex(points=point_cloud, max_edge_length=0.3)
simplex_tree = rips_complex.create_simplex_tree(max_dimension=3)
diag = simplex_tree.persistence()
plt = gudhi.plot_persistence_diagram(diag)
diff --git a/src/cython/doc/pyplots/diagram_persistence.py b/src/cython/doc/pyplots/diagram_persistence.py
index 5abf52b9..3bab0ca1 100755
--- a/src/cython/doc/pyplots/diagram_persistence.py
+++ b/src/cython/doc/pyplots/diagram_persistence.py
@@ -2,7 +2,7 @@ import gudhi
point_cloud = gudhi.read_off(off_file=gudhi.__root_source_dir__ + \
'/data/points/tore3D_1307.off')
-rips_complex = gudhi.RipsComplex(points=point_cloud, max_edge_length=0.2)
+rips_complex = gudhi.RipsComplex(points=point_cloud, max_edge_length=0.3)
simplex_tree = rips_complex.create_simplex_tree(max_dimension=3)
diag = simplex_tree.persistence()
plt = gudhi.plot_persistence_diagram(diag)
diff --git a/src/cython/doc/pyplots/show_palette_values.py b/src/cython/doc/pyplots/show_palette_values.py
deleted file mode 100755
index fdf9645f..00000000
--- a/src/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/src/cython/example/gudhi_graphical_tools_example.py b/src/cython/example/gudhi_graphical_tools_example.py
index 97983262..d21d44c2 100755
--- a/src/cython/example/gudhi_graphical_tools_example.py
+++ b/src/cython/example/gudhi_graphical_tools_example.py
@@ -28,11 +28,6 @@ __author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 INRIA"
__license__ = "GPL v3"
-print("#####################################################################")
-print("Show palette colors values for dimension")
-
-gudhi.show_palette_values()
-
print("#####################################################################")
print("Show barcode persistence example")
--
cgit v1.2.3
From e996b0fd0a0aecfa3b77e0ff3780f31b1b8bab4a Mon Sep 17 00:00:00 2001
From: vrouvrea
Date: Tue, 22 May 2018 20:59:45 +0000
Subject: Add CMake 3.1 in installation requirements.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3450 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: bae61cf108841dae3ff1be5953eb9f87f1713e41
---
src/common/doc/installation.h | 5 +++--
src/cython/doc/installation.rst | 8 ++++----
2 files changed, 7 insertions(+), 6 deletions(-)
(limited to 'src/cython/doc')
diff --git a/src/common/doc/installation.h b/src/common/doc/installation.h
index 25675cc5..12407c18 100644
--- a/src/common/doc/installation.h
+++ b/src/common/doc/installation.h
@@ -5,8 +5,9 @@
* Examples of GUDHI headers inclusion can be found in \ref demos.
*
* \section compiling Compiling
- * The library uses c++11 and requires Boost 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 ≥ 1.48.0
+ * and CMake ≥ 3.1.
+ * It is a multi-platform library and compiles on Linux, Mac OSX and Visual Studio 2015.
*
* \subsection demos Demos and examples
* To build the demos and examples, run the following commands in a terminal:
diff --git a/src/cython/doc/installation.rst b/src/cython/doc/installation.rst
index c182f176..52c5eb49 100644
--- a/src/cython/doc/installation.rst
+++ b/src/cython/doc/installation.rst
@@ -3,10 +3,10 @@ Installation
Compiling
*********
-
-The library uses c++11 and requires `Boost `_ 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 `_ ≥ 1.48.0
+and `CMake `_ ≥ 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.
--
cgit v1.2.3
From d0aa6ea5b543c4692f6e42d12252b03d5e43a255 Mon Sep 17 00:00:00 2001
From: vrouvrea
Date: Wed, 30 May 2018 20:53:45 +0000
Subject: Add install requires matplotlib and numpy in setup.py Add Python test
fail explanation
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/python_2.1.0_fix_vincent@3494 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 1bac18228a22ea718bb8c77d38efdf84f9b228eb
---
src/cython/doc/installation.rst | 3 +++
src/cython/setup.py.in | 7 +++++++
2 files changed, 10 insertions(+)
(limited to 'src/cython/doc')
diff --git a/src/cython/doc/installation.rst b/src/cython/doc/installation.rst
index c182f176..28d9dba2 100644
--- a/src/cython/doc/installation.rst
+++ b/src/cython/doc/installation.rst
@@ -43,6 +43,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/src/cython/setup.py.in b/src/cython/setup.py.in
index c767e93d..eda1ee04 100644
--- a/src/cython/setup.py.in
+++ b/src/cython/setup.py.in
@@ -46,4 +46,11 @@ setup(
version='@GUDHI_VERSION@',
url='http://gudhi.gforge.inria.fr/',
ext_modules = cythonize(gudhi),
+
+ #install_requires = required,
+ install_requires = [
+ "matplotlib",
+ "numpy",
+ "cython",
+ ],
)
--
cgit v1.2.3
From dde12ef73a36913c06d33ff3f5c2df43dd209930 Mon Sep 17 00:00:00 2001
From: vrouvrea
Date: Tue, 5 Jun 2018 19:44:59 +0000
Subject: Add new layout for documentation website for Doxygen (C++) and
sphinx (Python)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3539 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 2dc9edea317426fad7a7d99d849145845eb75bb9
---
src/common/doc/header.html | 109 +++++++++++++++++-----------------
src/cython/doc/_templates/layout.html | 109 +++++++++++++++++-----------------
2 files changed, 110 insertions(+), 108 deletions(-)
(limited to 'src/cython/doc')
diff --git a/src/common/doc/header.html b/src/common/doc/header.html
index 2f54e68d..4661dbbe 100644
--- a/src/common/doc/header.html
+++ b/src/common/doc/header.html
@@ -24,60 +24,61 @@ $extrastylesheet