summaryrefslogtreecommitdiff
path: root/src/cython/example
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-06-06 14:54:17 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-06-06 14:54:17 +0000
commit4a089fe4840f09b4aabafa06ad53200baa6d6547 (patch)
tree157100145d7f41c93aed0b275ed6f75c18aeb2fc /src/cython/example
parent17a700173e489acd763519f24d7321b1b64ad9b0 (diff)
bar code persistence tool
Copyright modification git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@1251 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: ff7a8baeffbcafe6d074786b6a7956d815edd21b
Diffstat (limited to 'src/cython/example')
-rwxr-xr-xsrc/cython/example/alpha_complex_example.py4
-rwxr-xr-xsrc/cython/example/alpha_complex_from_file_example.py4
-rwxr-xr-xsrc/cython/example/gudhi_graphical_tools_example.py42
-rwxr-xr-xsrc/cython/example/mini_simplex_tree_example.py4
-rwxr-xr-xsrc/cython/example/random_cubical_complex_example.py4
-rwxr-xr-xsrc/cython/example/rips_complex_example.py4
-rwxr-xr-xsrc/cython/example/rips_persistence_diagram.py14
-rwxr-xr-xsrc/cython/example/simplex_tree_example.py4
8 files changed, 57 insertions, 23 deletions
diff --git a/src/cython/example/alpha_complex_example.py b/src/cython/example/alpha_complex_example.py
index 37c04f23..cfeff5d8 100755
--- a/src/cython/example/alpha_complex_example.py
+++ b/src/cython/example/alpha_complex_example.py
@@ -8,7 +8,7 @@ import gudhi
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA Saclay (France)
+ Copyright (C) 2016 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
@@ -25,7 +25,7 @@ import gudhi
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__copyright__ = "Copyright (C) 2016 INRIA"
__license__ = "GPL v3"
print("#####################################################################")
diff --git a/src/cython/example/alpha_complex_from_file_example.py b/src/cython/example/alpha_complex_from_file_example.py
index 9ceb82b1..04b4b279 100755
--- a/src/cython/example/alpha_complex_from_file_example.py
+++ b/src/cython/example/alpha_complex_from_file_example.py
@@ -10,7 +10,7 @@ import argparse
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA Saclay (France)
+ Copyright (C) 2016 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
@@ -27,7 +27,7 @@ import argparse
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__copyright__ = "Copyright (C) 2016 INRIA"
__license__ = "GPL v3"
print("#####################################################################")
diff --git a/src/cython/example/gudhi_graphical_tools_example.py b/src/cython/example/gudhi_graphical_tools_example.py
new file mode 100755
index 00000000..c43b2338
--- /dev/null
+++ b/src/cython/example/gudhi_graphical_tools_example.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+
+import gudhi
+
+"""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) 2016 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 <http://www.gnu.org/licenses/>.
+"""
+
+__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 bar code persistence example")
+
+persistence = [(2, (1.0, float('inf'))), (1, (1.4142135623730951, float('inf'))),
+ (1, (1.4142135623730951, float('inf'))), (0, (0.0, float('inf'))),
+ (0, (0.0, 1.0)), (0, (0.0, 1.0)), (0, (0.0, 1.0))]
+gudhi.bar_code_persistence(persistence)
diff --git a/src/cython/example/mini_simplex_tree_example.py b/src/cython/example/mini_simplex_tree_example.py
index d7189ddf..7b65a9d6 100755
--- a/src/cython/example/mini_simplex_tree_example.py
+++ b/src/cython/example/mini_simplex_tree_example.py
@@ -8,7 +8,7 @@ import gudhi
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA Saclay (France)
+ Copyright (C) 2016 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
@@ -25,7 +25,7 @@ import gudhi
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__copyright__ = "Copyright (C) 2016 INRIA"
__license__ = "GPL v3"
print("#####################################################################")
diff --git a/src/cython/example/random_cubical_complex_example.py b/src/cython/example/random_cubical_complex_example.py
index b479e2e6..147eaa49 100755
--- a/src/cython/example/random_cubical_complex_example.py
+++ b/src/cython/example/random_cubical_complex_example.py
@@ -12,7 +12,7 @@ import operator
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA Saclay (France)
+ Copyright (C) 2016 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
@@ -29,7 +29,7 @@ import operator
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__copyright__ = "Copyright (C) 2016 INRIA"
__license__ = "GPL v3"
parser = argparse.ArgumentParser(description='Random cubical complex.',
diff --git a/src/cython/example/rips_complex_example.py b/src/cython/example/rips_complex_example.py
index 449ea2b3..65246c9c 100755
--- a/src/cython/example/rips_complex_example.py
+++ b/src/cython/example/rips_complex_example.py
@@ -8,7 +8,7 @@ import gudhi
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA Saclay (France)
+ Copyright (C) 2016 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
@@ -25,7 +25,7 @@ import gudhi
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__copyright__ = "Copyright (C) 2016 INRIA"
__license__ = "GPL v3"
print("#####################################################################")
diff --git a/src/cython/example/rips_persistence_diagram.py b/src/cython/example/rips_persistence_diagram.py
index 3e95f2cc..57f25b22 100755
--- a/src/cython/example/rips_persistence_diagram.py
+++ b/src/cython/example/rips_persistence_diagram.py
@@ -1,7 +1,6 @@
#!/usr/bin/env python
import gudhi
-import matplotlib.pyplot as plt
"""This file is part of the Gudhi Library. The Gudhi library
(Geometric Understanding in Higher Dimensions) is a generic C++
@@ -9,7 +8,7 @@ import matplotlib.pyplot as plt
Author(s): Marc Glisse
- Copyright (C) 2016 INRIA Saclay (France)
+ Copyright (C) 2016 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
@@ -26,7 +25,7 @@ import matplotlib.pyplot as plt
"""
__author__ = "Marc Glisse"
-__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__copyright__ = "Copyright (C) 2016 INRIA"
__license__ = "GPL v3"
print("#####################################################################")
@@ -37,11 +36,4 @@ rips = gudhi.RipsComplex(points=[[0, 0], [1, 0], [0, 1], [1, 1]],
diag = rips.persistence(homology_coeff_field=2, min_persistence=0)
print("diag=", diag)
-diag0=[i[1] for i in diag if i[0]==0]
-diag1=[i[1] for i in diag if i[0]==1]
-
-plt.plot([i[0] for i in diag0],[min(i[1],1.5) for i in diag0],'ro',
- [i[0] for i in diag1],[i[1] for i in diag1],'bs',[-.2,1.5],[-.2,1.5],
- '-')
-plt.axis([-.2,1.5,-.2,1.5])
-plt.show()
+gudhi.bar_code_persistence(diag)
diff --git a/src/cython/example/simplex_tree_example.py b/src/cython/example/simplex_tree_example.py
index 45d57c53..cc33ed6e 100755
--- a/src/cython/example/simplex_tree_example.py
+++ b/src/cython/example/simplex_tree_example.py
@@ -8,7 +8,7 @@ import gudhi
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA Saclay (France)
+ Copyright (C) 2016 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
@@ -25,7 +25,7 @@ import gudhi
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__copyright__ = "Copyright (C) 2016 INRIA"
__license__ = "GPL v3"
print("#####################################################################")