summaryrefslogtreecommitdiff
path: root/src/Rips_complex
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-04-03 21:20:42 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-04-03 21:20:42 +0000
commit1e55ed3f7ce467f598c66e18e6a7337476961588 (patch)
tree28abf10fee50e222c821eecde93878571a577198 /src/Rips_complex
parent9a60bbaf5b0895ccc24a545aafe5190b2d108126 (diff)
parentc06596e61c92f54a01756e1ba1babaff800f0f02 (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/Rips_complex')
-rw-r--r--src/Rips_complex/doc/Intro_rips_complex.h27
-rw-r--r--src/Rips_complex/example/CMakeLists.txt7
-rw-r--r--src/Rips_complex/example/example_one_skeleton_rips_from_correlation_matrix.cpp81
-rw-r--r--src/Rips_complex/example/one_skeleton_rips_from_correlation_matrix_for_doc.txt17
-rw-r--r--src/Rips_complex/utilities/CMakeLists.txt7
-rw-r--r--src/Rips_complex/utilities/rips_correlation_matrix_persistence.cpp170
-rw-r--r--src/Rips_complex/utilities/ripscomplex.md40
7 files changed, 347 insertions, 2 deletions
diff --git a/src/Rips_complex/doc/Intro_rips_complex.h b/src/Rips_complex/doc/Intro_rips_complex.h
index 9cc58412..da6bd8d9 100644
--- a/src/Rips_complex/doc/Intro_rips_complex.h
+++ b/src/Rips_complex/doc/Intro_rips_complex.h
@@ -203,6 +203,33 @@ namespace rips_complex {
*
* \include Rips_complex/full_skeleton_rips_for_doc.txt
*
+ *
+ * \section ripscorrelationematrix Correlation matrix
+ *
+ * Analogously to the case of distance matrix, Rips complexes can be also constructed based on correlation matrix.
+ * Given a correlation matrix M, comportment-wise 1-M is a distance matrix.
+ * This example builds the one skeleton graph from the given corelation matrix and threshold value.
+ * Then it creates a `Simplex_tree` with it.
+ *
+ * Then, it is asked to display information about the simplicial complex.
+ *
+ * \include Rips_complex/example_one_skeleton_rips_from_correlation_matrix.cpp
+ *
+ * When launching:
+ *
+ * \code $> ./example_one_skeleton_from_correlation_matrix
+ * \endcode
+ *
+ * the program output is:
+ *
+ * \include Rips_complex/one_skeleton_rips_from_correlation_matrix_for_doc.txt
+ *
+ * All the other constructions discussed for Rips complex for distance matrix can be also performed for Rips complexes
+ * construction from correlation matrices.
+ *
+ * @warning As persistence diagrams points will be under the diagonal, bottleneck distance and persistence graphical
+ * tool will not work properly, this is a known issue.
+ *
*/
/** @} */ // end defgroup rips_complex
diff --git a/src/Rips_complex/example/CMakeLists.txt b/src/Rips_complex/example/CMakeLists.txt
index d05d3e57..90c2d9f7 100644
--- a/src/Rips_complex/example/CMakeLists.txt
+++ b/src/Rips_complex/example/CMakeLists.txt
@@ -14,11 +14,15 @@ add_executable ( Rips_complex_example_from_csv_distance_matrix example_rips_comp
# Point cloud
add_executable ( Rips_complex_example_sparse example_sparse_rips.cpp )
+# Correlation matrix
+add_executable ( Rips_complex_example_one_skeleton_rips_from_correlation_matrix example_one_skeleton_rips_from_correlation_matrix.cpp )
+
if (TBB_FOUND)
target_link_libraries(Rips_complex_example_from_off ${TBB_LIBRARIES})
target_link_libraries(Rips_complex_example_one_skeleton_from_points ${TBB_LIBRARIES})
target_link_libraries(Rips_complex_example_one_skeleton_from_distance_matrix ${TBB_LIBRARIES})
target_link_libraries(Rips_complex_example_from_csv_distance_matrix ${TBB_LIBRARIES})
+ target_link_libraries(Rips_complex_example_one_skeleton_rips_from_correlation_matrix ${TBB_LIBRARIES})
target_link_libraries(Rips_complex_example_sparse ${TBB_LIBRARIES})
endif()
@@ -26,6 +30,8 @@ add_test(NAME Rips_complex_example_one_skeleton_from_points
COMMAND $<TARGET_FILE:Rips_complex_example_one_skeleton_from_points>)
add_test(NAME Rips_complex_example_one_skeleton_from_distance_matrix
COMMAND $<TARGET_FILE:Rips_complex_example_one_skeleton_from_distance_matrix>)
+add_test(NAME Rips_complex_example_one_skeleton_rips_from_correlation_matrix
+ COMMAND $<TARGET_FILE:Rips_complex_example_one_skeleton_rips_from_correlation_matrix>)
add_test(NAME Rips_complex_example_from_off_doc_12_1 COMMAND $<TARGET_FILE:Rips_complex_example_from_off>
"${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" "12.0" "1" "${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_1.txt")
@@ -61,3 +67,4 @@ install(TARGETS Rips_complex_example_from_off DESTINATION bin)
install(TARGETS Rips_complex_example_one_skeleton_from_points DESTINATION bin)
install(TARGETS Rips_complex_example_one_skeleton_from_distance_matrix DESTINATION bin)
install(TARGETS Rips_complex_example_from_csv_distance_matrix DESTINATION bin)
+install(TARGETS Rips_complex_example_one_skeleton_rips_from_correlation_matrix DESTINATION bin)
diff --git a/src/Rips_complex/example/example_one_skeleton_rips_from_correlation_matrix.cpp b/src/Rips_complex/example/example_one_skeleton_rips_from_correlation_matrix.cpp
new file mode 100644
index 00000000..1343f24d
--- /dev/null
+++ b/src/Rips_complex/example/example_one_skeleton_rips_from_correlation_matrix.cpp
@@ -0,0 +1,81 @@
+#include <gudhi/Rips_complex.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/distance_functions.h>
+
+#include <iostream>
+#include <string>
+#include <vector>
+#include <limits> // for std::numeric_limits
+
+int main() {
+ // Type definitions
+ using Simplex_tree = Gudhi::Simplex_tree<>;
+ using Filtration_value = Simplex_tree::Filtration_value;
+ using Rips_complex = Gudhi::rips_complex::Rips_complex<Filtration_value>;
+ using Distance_matrix = std::vector<std::vector<Filtration_value>>;
+
+ // User defined correlation matrix is:
+ // |1 0.06 0.23 0.01 0.89|
+ // |0.06 1 0.74 0.01 0.61|
+ // |0.23 0.74 1 0.72 0.03|
+ // |0.01 0.01 0.72 1 0.7 |
+ // |0.89 0.61 0.03 0.7 1 |
+
+ Distance_matrix correlations;
+ correlations.push_back({});
+ correlations.push_back({0.06});
+ correlations.push_back({0.23, 0.74});
+ correlations.push_back({0.01, 0.01, 0.72});
+ correlations.push_back({0.89, 0.61, 0.03, 0.7});
+
+ // ----------------------------------------------------------------------------
+ // Convert correlation matrix to a distance matrix:
+ // ----------------------------------------------------------------------------
+ double threshold = 0;
+ for (size_t i = 0; i != correlations.size(); ++i) {
+ for (size_t j = 0; j != correlations[i].size(); ++j) {
+ // Here we check if our data comes from corelation matrix.
+ if ((correlations[i][j] < -1) || (correlations[i][j] > 1)) {
+ std::cerr << "The input matrix is not a correlation matrix. The program will now terminate.\n";
+ throw "The input matrix is not a correlation matrix. The program will now terminate.\n";
+ }
+ correlations[i][j] = 1 - correlations[i][j];
+ // Here we make sure that we will get the treshold value equal to maximal
+ // distance in the matrix.
+ if (correlations[i][j] > threshold) threshold = correlations[i][j];
+ }
+ }
+
+ //-----------------------------------------------------------------------------
+ // Now the correlation matrix is a distance matrix and can be processed further.
+ //-----------------------------------------------------------------------------
+ Distance_matrix distances = correlations;
+
+ Rips_complex rips_complex_from_points(distances, threshold);
+
+ Simplex_tree stree;
+ rips_complex_from_points.create_complex(stree, 1);
+ // ----------------------------------------------------------------------------
+ // Display information about the one skeleton Rips complex. Note that
+ // the filtration displayed here comes from the distance matrix computed
+ // above, which is 1 - initial correlation matrix. Only this way, we obtain
+ // a complex with filtration. If a correlation matrix is used instead, we would
+ // have a reverse filtration (i.e. filtration of boundary of each simplex S
+ // is greater or equal to the filtration of S).
+ // ----------------------------------------------------------------------------
+ std::cout << "Rips complex is of dimension " << stree.dimension() << " - " << stree.num_simplices() << " simplices - "
+ << stree.num_vertices() << " vertices." << std::endl;
+
+ std::cout << "Iterator on Rips complex simplices in the filtration order, with [filtration value]:" << std::endl;
+ for (auto f_simplex : stree.filtration_simplex_range()) {
+ std::cout << " ( ";
+ for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
+ std::cout << vertex << " ";
+ }
+ std::cout << ") -> "
+ << "[" << stree.filtration(f_simplex) << "] ";
+ std::cout << std::endl;
+ }
+
+ return 0;
+}
diff --git a/src/Rips_complex/example/one_skeleton_rips_from_correlation_matrix_for_doc.txt b/src/Rips_complex/example/one_skeleton_rips_from_correlation_matrix_for_doc.txt
new file mode 100644
index 00000000..640d7083
--- /dev/null
+++ b/src/Rips_complex/example/one_skeleton_rips_from_correlation_matrix_for_doc.txt
@@ -0,0 +1,17 @@
+Rips complex is of dimension 1 - 15 simplices - 5 vertices.
+Iterator on Rips complex simplices in the filtration order, with [filtration value]:
+ ( 0 ) -> [0]
+ ( 1 ) -> [0]
+ ( 2 ) -> [0]
+ ( 3 ) -> [0]
+ ( 4 ) -> [0]
+ ( 4 0 ) -> [0.11]
+ ( 2 1 ) -> [0.26]
+ ( 3 2 ) -> [0.28]
+ ( 4 3 ) -> [0.3]
+ ( 4 1 ) -> [0.39]
+ ( 2 0 ) -> [0.77]
+ ( 1 0 ) -> [0.94]
+ ( 4 2 ) -> [0.97]
+ ( 3 0 ) -> [0.99]
+ ( 3 1 ) -> [0.99]
diff --git a/src/Rips_complex/utilities/CMakeLists.txt b/src/Rips_complex/utilities/CMakeLists.txt
index b245eb08..c8d389a0 100644
--- a/src/Rips_complex/utilities/CMakeLists.txt
+++ b/src/Rips_complex/utilities/CMakeLists.txt
@@ -7,12 +7,16 @@ target_link_libraries(rips_distance_matrix_persistence ${Boost_PROGRAM_OPTIONS_L
add_executable(rips_persistence rips_persistence.cpp)
target_link_libraries(rips_persistence ${Boost_PROGRAM_OPTIONS_LIBRARY})
+add_executable(rips_correlation_matrix_persistence rips_correlation_matrix_persistence.cpp)
+target_link_libraries(rips_correlation_matrix_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
+
add_executable(sparse_rips_persistence sparse_rips_persistence.cpp)
target_link_libraries(sparse_rips_persistence ${Boost_PROGRAM_OPTIONS_LIBRARY})
if (TBB_FOUND)
target_link_libraries(rips_distance_matrix_persistence ${TBB_LIBRARIES})
target_link_libraries(rips_persistence ${TBB_LIBRARIES})
+ target_link_libraries(rips_correlation_matrix_persistence ${TBB_LIBRARIES})
target_link_libraries(sparse_rips_persistence ${TBB_LIBRARIES})
endif()
@@ -20,9 +24,12 @@ add_test(NAME Rips_complex_utility_from_rips_distance_matrix COMMAND $<TARGET_FI
"${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv" "-r" "1.0" "-d" "3" "-p" "3" "-m" "0")
add_test(NAME Rips_complex_utility_from_rips_on_tore_3D COMMAND $<TARGET_FILE:rips_persistence>
"${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-r" "0.25" "-m" "0.5" "-d" "3" "-p" "3")
+add_test(NAME Rips_complex_utility_from_rips_correlation_matrix COMMAND $<TARGET_FILE:rips_correlation_matrix_persistence>
+ "${CMAKE_SOURCE_DIR}/data/correlation_matrix/lower_triangular_correlation_matrix.csv" "-c" "0.3" "-d" "3" "-p" "3" "-m" "0")
add_test(NAME Sparse_rips_complex_utility_on_tore_3D COMMAND $<TARGET_FILE:sparse_rips_persistence>
"${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-e" "0.5" "-m" "0.2" "-d" "3" "-p" "2")
install(TARGETS rips_distance_matrix_persistence DESTINATION bin)
install(TARGETS rips_persistence DESTINATION bin)
+install(TARGETS rips_correlation_matrix_persistence DESTINATION bin)
install(TARGETS sparse_rips_persistence DESTINATION bin)
diff --git a/src/Rips_complex/utilities/rips_correlation_matrix_persistence.cpp b/src/Rips_complex/utilities/rips_correlation_matrix_persistence.cpp
new file mode 100644
index 00000000..c2082fae
--- /dev/null
+++ b/src/Rips_complex/utilities/rips_correlation_matrix_persistence.cpp
@@ -0,0 +1,170 @@
+/* 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): Pawel Dlotko, 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/>.
+ */
+
+#include <gudhi/Rips_complex.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/Persistent_cohomology.h>
+#include <gudhi/reader_utils.h>
+#include <gudhi/writing_persistence_to_file.h>
+
+#include <boost/program_options.hpp>
+
+#include <string>
+#include <vector>
+#include <limits> // infinity
+
+// Types definition
+using Simplex_tree = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>;
+using Filtration_value = Simplex_tree::Filtration_value;
+using Rips_complex = Gudhi::rips_complex::Rips_complex<Filtration_value>;
+using Field_Zp = Gudhi::persistent_cohomology::Field_Zp;
+using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp>;
+using Correlation_matrix = std::vector<std::vector<Filtration_value>>;
+using intervals_common = Gudhi::Persistence_interval_common<double, int>;
+
+void program_options(int argc, char* argv[], std::string& csv_matrix_file, std::string& filediag,
+ Filtration_value& correlation_min, int& dim_max, int& p, Filtration_value& min_persistence);
+
+int main(int argc, char* argv[]) {
+ std::string csv_matrix_file;
+ std::string filediag;
+ Filtration_value correlation_min;
+ int dim_max;
+ int p;
+ Filtration_value min_persistence;
+
+ program_options(argc, argv, csv_matrix_file, filediag, correlation_min, dim_max, p, min_persistence);
+
+ Correlation_matrix correlations =
+ Gudhi::read_lower_triangular_matrix_from_csv_file<Filtration_value>(csv_matrix_file);
+
+ Filtration_value threshold = 0;
+
+ // Given a correlation matrix M, we compute component-wise M'[i,j] = 1-M[i,j] to get a distance matrix:
+ for (size_t i = 0; i != correlations.size(); ++i) {
+ for (size_t j = 0; j != correlations[i].size(); ++j) {
+ correlations[i][j] = 1 - correlations[i][j];
+ // Here we make sure that the values of corelations lie between -1 and 1.
+ // If not, we throw an exception.
+ if ((correlations[i][j] < -1) || (correlations[i][j] > 1)) {
+ std::cerr << "The input matrix is not a correlation matrix. The program will now terminate. \n";
+ throw "The input matrix is not a correlation matrix. The program will now terminate. \n";
+ }
+ if (correlations[i][j] > threshold) threshold = correlations[i][j];
+ }
+ }
+
+ Rips_complex rips_complex_from_file(correlations, threshold);
+
+ // Construct the Rips complex in a Simplex Tree
+ Simplex_tree simplex_tree;
+
+ rips_complex_from_file.create_complex(simplex_tree, dim_max);
+ std::cout << "The complex contains " << simplex_tree.num_simplices() << " simplices \n";
+ std::cout << " and has dimension " << simplex_tree.dimension() << " \n";
+
+ // Sort the simplices in the order of the filtration
+ simplex_tree.initialize_filtration();
+
+ // Compute the persistence diagram of the complex
+ Persistent_cohomology pcoh(simplex_tree);
+ // initializes the coefficient field for homology
+ pcoh.init_coefficients(p);
+ // compute persistence
+ pcoh.compute_persistent_cohomology(min_persistence);
+
+ // invert the persistence diagram. The reason for this procedure is the following:
+ // The input to the program is a corelation matrix M. When processing it, it is
+ // turned into 1-M and the obtained persistence intervals are in '1-M' units.
+ // Below we reverse every (birth,death) pair into (1-birth, 1-death) pair
+ // so that the input and the output to the program is expressed in the same
+ // units.
+ auto pairs = pcoh.get_persistent_pairs();
+ std::vector<intervals_common> processed_persistence_intervals;
+ processed_persistence_intervals.reserve(pairs.size());
+ for (auto pair : pairs) {
+ double birth = 1 - simplex_tree.filtration(get<0>(pair));
+ double death = 1 - simplex_tree.filtration(get<1>(pair));
+ unsigned dimension = (unsigned)simplex_tree.dimension(get<0>(pair));
+ int field = get<2>(pair);
+ processed_persistence_intervals.push_back(intervals_common(birth, death, dimension, field));
+ }
+
+ // sort the processed intervals:
+ std::sort(processed_persistence_intervals.begin(), processed_persistence_intervals.end());
+
+ // and write them to a file
+ if (filediag.empty()) {
+ write_persistence_intervals_to_stream(processed_persistence_intervals);
+ } else {
+ std::ofstream out(filediag);
+ write_persistence_intervals_to_stream(processed_persistence_intervals, out);
+ }
+ return 0;
+}
+
+void program_options(int argc, char* argv[], std::string& csv_matrix_file, std::string& filediag,
+ Filtration_value& correlation_min, int& dim_max, int& p, Filtration_value& min_persistence) {
+ namespace po = boost::program_options;
+ po::options_description hidden("Hidden options");
+ hidden.add_options()(
+ "input-file", po::value<std::string>(&csv_matrix_file),
+ "Name of file containing a corelation matrix. Can be square or lower triangular matrix. Separator is ';'.");
+ po::options_description visible("Allowed options", 100);
+ visible.add_options()("help,h", "produce help message")(
+ "output-file,o", po::value<std::string>(&filediag)->default_value(std::string()),
+ "Name of file in which the persistence diagram is written. Default print in std::cout")(
+ "min-edge-corelation,c", po::value<Filtration_value>(&correlation_min)->default_value(0),
+ "Minimal corelation of an edge for the Rips complex construction.")(
+ "cpx-dimension,d", po::value<int>(&dim_max)->default_value(1),
+ "Maximal dimension of the Rips complex we want to compute.")(
+ "field-charac,p", po::value<int>(&p)->default_value(11),
+ "Characteristic p of the coefficient field Z/pZ for computing homology.")(
+ "min-persistence,m", po::value<Filtration_value>(&min_persistence),
+ "Minimal lifetime of homology feature to be recorded. Default is 0. Enter a negative value to see zero length "
+ "intervals");
+
+ po::positional_options_description pos;
+ pos.add("input-file", 1);
+
+ po::options_description all;
+ all.add(visible).add(hidden);
+
+ po::variables_map vm;
+ po::store(po::command_line_parser(argc, argv).options(all).positional(pos).run(), vm);
+ po::notify(vm);
+
+ if (vm.count("help") || !vm.count("input-file")) {
+ std::cout << std::endl;
+ std::cout << "Compute the persistent homology with coefficient field Z/pZ \n";
+ std::cout << "of a Rips complex defined on a corelation matrix.\n \n";
+ std::cout << "The output diagram contains one bar per line, written with the convention: \n";
+ std::cout << " p dim b d \n";
+ std::cout << "where dim is the dimension of the homological feature,\n";
+ std::cout << "b and d are respectively the birth and death of the feature and \n";
+ std::cout << "p is the characteristic of the field Z/pZ used for homology coefficients." << std::endl << std::endl;
+
+ std::cout << "Usage: " << argv[0] << " [options] input-file" << std::endl << std::endl;
+ std::cout << visible << std::endl;
+ std::abort();
+ }
+}
diff --git a/src/Rips_complex/utilities/ripscomplex.md b/src/Rips_complex/utilities/ripscomplex.md
index 421caa7d..84f40cc1 100644
--- a/src/Rips_complex/utilities/ripscomplex.md
+++ b/src/Rips_complex/utilities/ripscomplex.md
@@ -1,3 +1,13 @@
+---
+layout: page
+title: "Rips complex"
+meta_title: "Rips complex"
+teaser: ""
+permalink: /ripscomplex/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
# Rips complex #
@@ -35,20 +45,46 @@ Beware: this program may use a lot of RAM and take a lot of time if `max-edge-le
## rips_distance_matrix_persistence ##
-Same as `rips_persistence` but taking a distance matrix as input.
+Same as `rips_persistence` but taking a distance matrix as input.
**Usage**
-`rips_persistence [options] <CSV input file>`
+`rips_distance_matrix_persistence [options] <CSV input file>`
where
`<CSV input file>` is the path to the file containing a distance matrix. Can be square or lower triangular matrix. Separator is ';'.
+The code do not check if it is dealing with a distance matrix. It is the user responsibility to provide a valid input.
+Please refer to data/distance_matrix/lower_triangular_distance_matrix.csv for an example of a file.
**Example**
`rips_distance_matrix_persistence data/distance_matrix/full_square_distance_matrix.csv -r 15 -d 3 -p 3 -m 0`
+## rips_correlation_matrix_persistence ##
+
+Same as `rips_distance_matrix_persistence` but taking a correlation matrix as input.
+
+**Usage**
+
+`rips_correlation_matrix_persistence [options] <CSV input file>`
+
+where
+`<CSV input file>` is the path to the file containing a correlation matrix. Can be square or lower triangular matrix. Separator is ';'.
+Note that no check is performed if the matrix given as the input is a correlation matrix.
+It is the user responsibility to ensure that this is the case.
+Please refer to data/correlation_matrix/lower_triangular_correlation_matrix.csv for an example of a file.
+
+**Example**
+
+`rips_correlation_matrix_persistence data/distance_matrix/full_square_distance_matrix.csv -r 15 -d 3 -p 3 -m 0`
+
+**Warning**
+
+As persistence diagrams points will be under the diagonal, bottleneck distance and persistence graphical tool will not work
+properly, this is a known issue.
+
+
## sparse_rips_persistence ##
This program computes the persistent homology with coefficient field *Z/pZ*
of a sparse (1+epsilon)-approximation of the Rips complex defined on a set of input Euclidean points. The output diagram contains one bar per line, written with the convention: