diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-04-03 21:20:42 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-04-03 21:20:42 +0000 |
commit | 1e55ed3f7ce467f598c66e18e6a7337476961588 (patch) | |
tree | 28abf10fee50e222c821eecde93878571a577198 /src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py | |
parent | 9a60bbaf5b0895ccc24a545aafe5190b2d108126 (diff) | |
parent | c06596e61c92f54a01756e1ba1babaff800f0f02 (diff) |
Merge last trunk modifications
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/sparserips-glisse@3335 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 41b78dbadb13e3eca889479c1112814b2b58f679
Diffstat (limited to 'src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py')
-rwxr-xr-x | src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py | 7 |
1 files changed, 4 insertions, 3 deletions
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 3baebd17..c8aac240 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 @@ -30,12 +30,12 @@ __copyright__ = "Copyright (C) 2016 INRIA" __license__ = "GPL v3" parser = argparse.ArgumentParser(description='RipsComplex creation from ' - 'a distance matrix read in a OFF file.', + 'a distance matrix read in a csv file.', epilog='Example: ' 'example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py ' '-f ../data/distance_matrix/lower_triangular_distance_matrix.csv -e 12.0 -d 3' '- Constructs a Rips complex with the ' - 'points from the given OFF file.') + 'distance matrix from the given csv file.') 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) @@ -50,7 +50,8 @@ print("RipsComplex creation from distance matrix read in a csv file") message = "RipsComplex with max_edge_length=" + repr(args.max_edge_length) print(message) -rips_complex = gudhi.RipsComplex(csv_file=args.file, max_edge_length=args.max_edge_length) +distance_matrix = gudhi.read_lower_triangular_matrix_from_csv_file(csv_file=args.file) +rips_complex = gudhi.RipsComplex(distance_matrix=distance_matrix, max_edge_length=args.max_edge_length) simplex_tree = rips_complex.create_simplex_tree(max_dimension=args.max_dimension) message = "Number of simplices=" + repr(simplex_tree.num_simplices()) |