summaryrefslogtreecommitdiff
path: root/src/cython/example
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-06-10 15:45:00 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-06-10 15:45:00 +0000
commita661984d2ed0e515bd0d2f824ba2a03047dfdd38 (patch)
tree963339f74fdad450a25bcb1754158f7d8b109485 /src/cython/example
parent6f6467ac9cc71598c2946b7e84abcd3adea98528 (diff)
Add relaxed witness cytonization
Add 2000_random_points_on_3D_Torus.csv for rips_complex_from_file_example.py and witness_complex_from_file_example.py git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@1273 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 80469ca5fb20f21d87fd2816e3f212280ac45caf
Diffstat (limited to 'src/cython/example')
-rwxr-xr-xsrc/cython/example/rips_complex_from_file_example.py8
-rwxr-xr-xsrc/cython/example/witness_complex_from_file_example.py17
2 files changed, 10 insertions, 15 deletions
diff --git a/src/cython/example/rips_complex_from_file_example.py b/src/cython/example/rips_complex_from_file_example.py
index 9385aba0..fae72443 100755
--- a/src/cython/example/rips_complex_from_file_example.py
+++ b/src/cython/example/rips_complex_from_file_example.py
@@ -37,7 +37,7 @@ parser = argparse.ArgumentParser(description='RipsComplex creation from '
'points read in a file.',
epilog='Example: '
'example/rips_complex_from_file_example.py '
- 'data/500_random_points_on_3D_Torus.csv '
+ 'data/2000_random_points_on_3D_Torus.csv '
'- Constructs a rips complex with the '
'points from the given file. File format '
'is X1, X2, ..., Xn')
@@ -46,13 +46,13 @@ args = parser.parse_args()
points = pandas.read_csv(args.file, header=None)
-print("RipsComplex with max_edge_length=1.9")
+print("RipsComplex with max_edge_length=0.7")
rips_complex = gudhi.RipsComplex(points=points.values,
- max_dimension=len(points.values[0]), max_edge_length=1.9)
+ max_dimension=len(points.values[0]), max_edge_length=0.7)
rips_complex.initialize_filtration()
-diag = rips_complex.persistence(homology_coeff_field=2, min_persistence=0.1)
+diag = rips_complex.persistence(homology_coeff_field=2, min_persistence=0.3)
print("betti_numbers()=")
print(rips_complex.betti_numbers())
diff --git a/src/cython/example/witness_complex_from_file_example.py b/src/cython/example/witness_complex_from_file_example.py
index 9d1a940f..d67d1c34 100755
--- a/src/cython/example/witness_complex_from_file_example.py
+++ b/src/cython/example/witness_complex_from_file_example.py
@@ -37,7 +37,7 @@ parser = argparse.ArgumentParser(description='WitnessComplex creation from '
'points read in a file.',
epilog='Example: '
'example/witness_complex_from_file_example.py'
- ' data/500_random_points_on_3D_Torus.csv '
+ ' data/2000_random_points_on_3D_Torus.csv '
'- Constructs a witness complex with the '
'points from the given file. File format '
'is X1, X2, ..., Xn')
@@ -46,25 +46,20 @@ args = parser.parse_args()
points = pandas.read_csv(args.file, header=None)
-print("WitnessComplex with number_of_landmarks=5")
+print("WitnessComplex with number_of_landmarks=100 alpha=0.7 epsilon_mu=0.001 max_dim=10")
witness_complex = gudhi.WitnessComplex(points=points.values,
- number_of_landmarks=200)
-
-print("filtered_tree=", witness_complex.get_filtered_tree())
+ number_of_landmarks=100,
+ max_alpha_square=0.7,
+ mu_epsilon=0.001,
+ dimension_limit=10)
witness_complex.initialize_filtration()
diag = witness_complex.persistence(homology_coeff_field=2, min_persistence=0.1)
-print("diag=", diag)
-
-gudhi.diagram_persistence(diag)
-
-"""
print("betti_numbers()=")
print(witness_complex.betti_numbers())
gudhi.diagram_persistence(diag)
gudhi.barcode_persistence(diag)
-""" \ No newline at end of file