summaryrefslogtreecommitdiff
path: root/src/cython/example/alpha_rips_persistence_bottleneck_distance.py
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-09-28 13:43:58 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-09-28 13:43:58 +0000
commitef61b085afd77976a2c7fc5dfa13bc4b293b4f95 (patch)
tree99c82e4ec0681c6d13ea68bfcecb76516c2a54b1 /src/cython/example/alpha_rips_persistence_bottleneck_distance.py
parent82fdc7d643e6ad589e16bc25782e8dd068d033ae (diff)
Remove python rips_complex construction from files as it can lead to errors with correlation matrix
Add examples for doxygen Cythonization of rips correlation matrix git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/rips_complex_from_correlation_matrix@2727 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 8aae33839fa27f9d26897e625904671b2c05e0e7
Diffstat (limited to 'src/cython/example/alpha_rips_persistence_bottleneck_distance.py')
-rwxr-xr-xsrc/cython/example/alpha_rips_persistence_bottleneck_distance.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cython/example/alpha_rips_persistence_bottleneck_distance.py b/src/cython/example/alpha_rips_persistence_bottleneck_distance.py
index ab5fc1e9..386f8457 100755
--- a/src/cython/example/alpha_rips_persistence_bottleneck_distance.py
+++ b/src/cython/example/alpha_rips_persistence_bottleneck_distance.py
@@ -45,13 +45,14 @@ args = parser.parse_args()
with open(args.file, 'r') as f:
first_line = f.readline()
if (first_line == 'OFF\n') or (first_line == 'nOFF\n'):
+ point_cloud = gudhi.read_off(off_file=args.file)
print("#####################################################################")
print("RipsComplex creation from points read in a OFF file")
message = "RipsComplex with max_edge_length=" + repr(args.threshold)
print(message)
- rips_complex = gudhi.RipsComplex(off_file=args.file,
+ rips_complex = gudhi.RipsComplex(points=point_cloud,
max_edge_length=args.threshold)
rips_stree = rips_complex.create_simplex_tree(max_dimension=args.max_dimension)
@@ -67,7 +68,7 @@ with open(args.file, 'r') as f:
message = "AlphaComplex with max_edge_length=" + repr(args.threshold)
print(message)
- alpha_complex = gudhi.AlphaComplex(off_file=args.file)
+ alpha_complex = gudhi.AlphaComplex(points=point_cloud)
alpha_stree = alpha_complex.create_simplex_tree(max_alpha_square=(args.threshold * args.threshold))
message = "Number of simplices=" + repr(alpha_stree.num_simplices())