summaryrefslogtreecommitdiff
path: root/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-04-03 09:11:12 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-04-03 09:11:12 +0000
commit77d03dba655f8c19c413d70b929c6426f332dc34 (patch)
tree1e8aad7fbfd7df74796553ceeaf1234e3ac85c7d /src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py
parent8447fa7575ae4db0db6daa8e03a0c2f9a374df7c (diff)
parent3e1cf01b055718ead2433ef852dcfccce502cdb8 (diff)
Merge rips_complex_from_correlation_matrix branch
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3328 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a0d98d884fc06a6528e3362d6ed627cd964f527a
Diffstat (limited to 'src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py')
-rwxr-xr-xsrc/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py7
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())