summaryrefslogtreecommitdiff
path: root/src/Rips_complex/example
diff options
context:
space:
mode:
Diffstat (limited to 'src/Rips_complex/example')
-rw-r--r--src/Rips_complex/example/CMakeLists.txt71
-rw-r--r--src/Rips_complex/example/example_one_skeleton_rips_from_correlation_matrix.cpp81
-rw-r--r--src/Rips_complex/example/example_one_skeleton_rips_from_distance_matrix.cpp58
-rw-r--r--src/Rips_complex/example/example_one_skeleton_rips_from_points.cpp52
-rw-r--r--src/Rips_complex/example/example_rips_complex_from_csv_distance_matrix_file.cpp72
-rw-r--r--src/Rips_complex/example/example_rips_complex_from_off_file.cpp71
-rw-r--r--src/Rips_complex/example/example_sparse_rips.cpp30
-rw-r--r--src/Rips_complex/example/full_skeleton_rips_for_doc.txt26
-rw-r--r--src/Rips_complex/example/one_skeleton_rips_for_doc.txt20
-rw-r--r--src/Rips_complex/example/one_skeleton_rips_from_correlation_matrix_for_doc.txt17
10 files changed, 498 insertions, 0 deletions
diff --git a/src/Rips_complex/example/CMakeLists.txt b/src/Rips_complex/example/CMakeLists.txt
new file mode 100644
index 00000000..e7772bdb
--- /dev/null
+++ b/src/Rips_complex/example/CMakeLists.txt
@@ -0,0 +1,71 @@
+project(Rips_complex_examples)
+
+# Point cloud
+add_executable ( Rips_complex_example_from_off example_rips_complex_from_off_file.cpp )
+
+add_executable ( Rips_complex_example_one_skeleton_from_points example_one_skeleton_rips_from_points.cpp )
+
+# Distance matrix
+add_executable ( Rips_complex_example_one_skeleton_from_distance_matrix example_one_skeleton_rips_from_distance_matrix.cpp )
+
+add_executable ( Rips_complex_example_from_csv_distance_matrix example_rips_complex_from_csv_distance_matrix_file.cpp )
+
+# Sparse rips from points
+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_sparse ${TBB_LIBRARIES})
+ target_link_libraries(Rips_complex_example_one_skeleton_rips_from_correlation_matrix ${TBB_LIBRARIES})
+endif()
+
+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_sparse
+ COMMAND $<TARGET_FILE:Rips_complex_example_sparse>)
+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")
+add_test(NAME Rips_complex_example_from_off_doc_12_3 COMMAND $<TARGET_FILE:Rips_complex_example_from_off>
+ "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" "12.0" "3" "${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_3.txt")
+
+add_test(NAME Rips_complex_example_from_csv_distance_matrix_doc_12_1 COMMAND $<TARGET_FILE:Rips_complex_example_from_csv_distance_matrix>
+ "${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv" "12.0" "1" "${CMAKE_CURRENT_BINARY_DIR}/ripscsvreader_result_12_1.txt")
+add_test(NAME Rips_complex_example_from_csv_distance_matrix_doc_12_3 COMMAND $<TARGET_FILE:Rips_complex_example_from_csv_distance_matrix>
+ "${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv" "12.0" "3" "${CMAKE_CURRENT_BINARY_DIR}/ripscsvreader_result_12_3.txt")
+
+
+if (DIFF_PATH)
+ # Do not forget to copy test results files in current binary dir
+ file(COPY "one_skeleton_rips_for_doc.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
+ file(COPY "full_skeleton_rips_for_doc.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
+
+ add_test(Rips_complex_example_from_off_doc_12_1_diff_files ${DIFF_PATH}
+ ${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_1.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/one_skeleton_rips_for_doc.txt)
+ add_test(Rips_complex_example_from_off_doc_12_3_diff_files ${DIFF_PATH}
+ ${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_3.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/full_skeleton_rips_for_doc.txt)
+ add_test(Rips_complex_example_from_csv_distance_matrix_doc_12_1_diff_files ${DIFF_PATH}
+ ${CMAKE_CURRENT_BINARY_DIR}/ripscsvreader_result_12_1.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/one_skeleton_rips_for_doc.txt)
+ add_test(Rips_complex_example_from_csv_distance_matrix_doc_12_3_diff_files ${DIFF_PATH}
+ ${CMAKE_CURRENT_BINARY_DIR}/ripscsvreader_result_12_3.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/full_skeleton_rips_for_doc.txt)
+endif()
+
+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..05bacb9f
--- /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/example_one_skeleton_rips_from_distance_matrix.cpp b/src/Rips_complex/example/example_one_skeleton_rips_from_distance_matrix.cpp
new file mode 100644
index 00000000..bbc3c755
--- /dev/null
+++ b/src/Rips_complex/example/example_one_skeleton_rips_from_distance_matrix.cpp
@@ -0,0 +1,58 @@
+#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 distance matrix is:
+ // | 0 0.94 0.77 0.99 0.11 |
+ // | 0.94 0 0.26 0.99 0.39 |
+ // | 0.77 0.26 0 0.28 0.97 |
+ // | 0.99 0.99 0.28 0 0.30 |
+ // | 0.11 0.39 0.97 0.30 0 |
+
+ Distance_matrix distances;
+ distances.push_back({});
+ distances.push_back({0.94});
+ distances.push_back({0.77, 0.26});
+ distances.push_back({0.99, 0.99, 0.28});
+ distances.push_back({0.11, 0.39, 0.97, 0.30});
+
+ // ----------------------------------------------------------------------------
+ // Init of a Rips complex from points
+ // ----------------------------------------------------------------------------
+ double threshold = 1.0;
+ 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
+ // ----------------------------------------------------------------------------
+ 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/example_one_skeleton_rips_from_points.cpp b/src/Rips_complex/example/example_one_skeleton_rips_from_points.cpp
new file mode 100644
index 00000000..a1db8910
--- /dev/null
+++ b/src/Rips_complex/example/example_one_skeleton_rips_from_points.cpp
@@ -0,0 +1,52 @@
+#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 Point = std::vector<double>;
+ 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>;
+
+ std::vector<Point> points;
+ points.push_back({1.0, 1.0});
+ points.push_back({7.0, 0.0});
+ points.push_back({4.0, 6.0});
+ points.push_back({9.0, 6.0});
+ points.push_back({0.0, 14.0});
+ points.push_back({2.0, 19.0});
+ points.push_back({9.0, 17.0});
+
+ // ----------------------------------------------------------------------------
+ // Init of a Rips complex from points
+ // ----------------------------------------------------------------------------
+ double threshold = 12.0;
+ Rips_complex rips_complex_from_points(points, threshold, Gudhi::Euclidean_distance());
+
+ Simplex_tree stree;
+ rips_complex_from_points.create_complex(stree, 1);
+ // ----------------------------------------------------------------------------
+ // Display information about the one skeleton Rips complex
+ // ----------------------------------------------------------------------------
+ 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/example_rips_complex_from_csv_distance_matrix_file.cpp b/src/Rips_complex/example/example_rips_complex_from_csv_distance_matrix_file.cpp
new file mode 100644
index 00000000..9e182f1e
--- /dev/null
+++ b/src/Rips_complex/example/example_rips_complex_from_csv_distance_matrix_file.cpp
@@ -0,0 +1,72 @@
+#include <gudhi/Rips_complex.h>
+// to construct Rips_complex from a csv file representing a distance matrix
+#include <gudhi/reader_utils.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/distance_functions.h>
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+void usage(int nbArgs, char * const progName) {
+ std::cerr << "Error: Number of arguments (" << nbArgs << ") is not correct\n";
+ std::cerr << "Usage: " << progName << " filename.csv threshold dim_max [ouput_file.txt]\n";
+ std::cerr << " i.e.: " << progName << " ../../data/distance_matrix/full_square_distance_matrix.csv 1.0 3\n";
+ exit(-1); // ----- >>
+}
+
+int main(int argc, char **argv) {
+ if ((argc != 4) && (argc != 5)) usage(argc, (argv[0] - 1));
+
+ std::string csv_file_name(argv[1]);
+ double threshold = atof(argv[2]);
+ int dim_max = atoi(argv[3]);
+
+ // 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>>;
+
+ // ----------------------------------------------------------------------------
+ // Init of a Rips complex from a distance matrix in a csv file
+ // Default separator is ';'
+ // ----------------------------------------------------------------------------
+ Distance_matrix distances = Gudhi::read_lower_triangular_matrix_from_csv_file<Filtration_value>(csv_file_name);
+ Rips_complex rips_complex_from_file(distances, threshold);
+
+ std::streambuf* streambufffer;
+ std::ofstream ouput_file_stream;
+
+ if (argc == 5) {
+ ouput_file_stream.open(std::string(argv[4]));
+ streambufffer = ouput_file_stream.rdbuf();
+ } else {
+ streambufffer = std::cout.rdbuf();
+ }
+
+ Simplex_tree stree;
+ rips_complex_from_file.create_complex(stree, dim_max);
+ std::ostream output_stream(streambufffer);
+
+ // ----------------------------------------------------------------------------
+ // Display information about the Rips complex
+ // ----------------------------------------------------------------------------
+ output_stream << "Rips complex is of dimension " << stree.dimension() <<
+ " - " << stree.num_simplices() << " simplices - " <<
+ stree.num_vertices() << " vertices." << std::endl;
+
+ output_stream << "Iterator on Rips complex simplices in the filtration order, with [filtration value]:" <<
+ std::endl;
+ for (auto f_simplex : stree.filtration_simplex_range()) {
+ output_stream << " ( ";
+ for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
+ output_stream << vertex << " ";
+ }
+ output_stream << ") -> " << "[" << stree.filtration(f_simplex) << "] ";
+ output_stream << std::endl;
+ }
+
+ ouput_file_stream.close();
+ return 0;
+}
diff --git a/src/Rips_complex/example/example_rips_complex_from_off_file.cpp b/src/Rips_complex/example/example_rips_complex_from_off_file.cpp
new file mode 100644
index 00000000..de2e4ea4
--- /dev/null
+++ b/src/Rips_complex/example/example_rips_complex_from_off_file.cpp
@@ -0,0 +1,71 @@
+#include <gudhi/Rips_complex.h>
+// to construct Rips_complex from a OFF file of points
+#include <gudhi/Points_off_io.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/distance_functions.h>
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+void usage(int nbArgs, char * const progName) {
+ std::cerr << "Error: Number of arguments (" << nbArgs << ") is not correct\n";
+ std::cerr << "Usage: " << progName << " filename.off threshold dim_max [ouput_file.txt]\n";
+ std::cerr << " i.e.: " << progName << " ../../data/points/alphacomplexdoc.off 60.0\n";
+ exit(-1); // ----- >>
+}
+
+int main(int argc, char **argv) {
+ if ((argc != 4) && (argc != 5)) usage(argc, (argv[0] - 1));
+
+ std::string off_file_name(argv[1]);
+ double threshold = atof(argv[2]);
+ int dim_max = atoi(argv[3]);
+
+ // Type definitions
+ using Point = std::vector<float>;
+ using Simplex_tree = Gudhi::Simplex_tree<>;
+ using Filtration_value = Simplex_tree::Filtration_value;
+ using Rips_complex = Gudhi::rips_complex::Rips_complex<Filtration_value>;
+
+ // ----------------------------------------------------------------------------
+ // Init of a Rips complex from an OFF file
+ // ----------------------------------------------------------------------------
+ Gudhi::Points_off_reader<Point> off_reader(off_file_name);
+ Rips_complex rips_complex_from_file(off_reader.get_point_cloud(), threshold, Gudhi::Euclidean_distance());
+
+ std::streambuf* streambufffer;
+ std::ofstream ouput_file_stream;
+
+ if (argc == 5) {
+ ouput_file_stream.open(std::string(argv[4]));
+ streambufffer = ouput_file_stream.rdbuf();
+ } else {
+ streambufffer = std::cout.rdbuf();
+ }
+
+ Simplex_tree stree;
+ rips_complex_from_file.create_complex(stree, dim_max);
+ std::ostream output_stream(streambufffer);
+
+ // ----------------------------------------------------------------------------
+ // Display information about the Rips complex
+ // ----------------------------------------------------------------------------
+ output_stream << "Rips complex is of dimension " << stree.dimension() <<
+ " - " << stree.num_simplices() << " simplices - " <<
+ stree.num_vertices() << " vertices." << std::endl;
+
+ output_stream << "Iterator on Rips complex simplices in the filtration order, with [filtration value]:" <<
+ std::endl;
+ for (auto f_simplex : stree.filtration_simplex_range()) {
+ output_stream << " ( ";
+ for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
+ output_stream << vertex << " ";
+ }
+ output_stream << ") -> " << "[" << stree.filtration(f_simplex) << "] ";
+ output_stream << std::endl;
+ }
+
+ ouput_file_stream.close();
+ return 0;
+}
diff --git a/src/Rips_complex/example/example_sparse_rips.cpp b/src/Rips_complex/example/example_sparse_rips.cpp
new file mode 100644
index 00000000..1c95b48c
--- /dev/null
+++ b/src/Rips_complex/example/example_sparse_rips.cpp
@@ -0,0 +1,30 @@
+#include <gudhi/Sparse_rips_complex.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/distance_functions.h>
+
+#include <iostream>
+#include <vector>
+
+int main() {
+ using Point = std::vector<double>;
+ using Simplex_tree = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>;
+ using Filtration_value = Simplex_tree::Filtration_value;
+ using Sparse_rips = Gudhi::rips_complex::Sparse_rips_complex<Filtration_value>;
+
+ Point points[] = {{1.0, 1.0}, {7.0, 0.0}, {4.0, 6.0}, {9.0, 6.0}, {0.0, 14.0}, {2.0, 19.0}, {9.0, 17.0}};
+
+ // ----------------------------------------------------------------------------
+ // Init from Euclidean points
+ // ----------------------------------------------------------------------------
+ double epsilon = 2; // very rough, no guarantees
+ Sparse_rips sparse_rips(points, Gudhi::Euclidean_distance(), epsilon);
+
+ Simplex_tree stree;
+ sparse_rips.create_complex(stree, 10);
+
+ // ----------------------------------------------------------------------------
+ // Display information about the complex
+ // ----------------------------------------------------------------------------
+ std::cout << "Sparse Rips complex is of dimension " << stree.dimension() << " - " << stree.num_simplices()
+ << " simplices - " << stree.num_vertices() << " vertices." << std::endl;
+}
diff --git a/src/Rips_complex/example/full_skeleton_rips_for_doc.txt b/src/Rips_complex/example/full_skeleton_rips_for_doc.txt
new file mode 100644
index 00000000..55de4ab8
--- /dev/null
+++ b/src/Rips_complex/example/full_skeleton_rips_for_doc.txt
@@ -0,0 +1,26 @@
+Rips complex is of dimension 3 - 24 simplices - 7 vertices.
+Iterator on Rips complex simplices in the filtration order, with [filtration value]:
+ ( 0 ) -> [0]
+ ( 1 ) -> [0]
+ ( 2 ) -> [0]
+ ( 3 ) -> [0]
+ ( 4 ) -> [0]
+ ( 5 ) -> [0]
+ ( 6 ) -> [0]
+ ( 3 2 ) -> [5]
+ ( 5 4 ) -> [5.38516]
+ ( 2 0 ) -> [5.83095]
+ ( 1 0 ) -> [6.08276]
+ ( 3 1 ) -> [6.32456]
+ ( 2 1 ) -> [6.7082]
+ ( 2 1 0 ) -> [6.7082]
+ ( 3 2 1 ) -> [6.7082]
+ ( 6 5 ) -> [7.28011]
+ ( 4 2 ) -> [8.94427]
+ ( 3 0 ) -> [9.43398]
+ ( 3 1 0 ) -> [9.43398]
+ ( 3 2 0 ) -> [9.43398]
+ ( 3 2 1 0 ) -> [9.43398]
+ ( 6 4 ) -> [9.48683]
+ ( 6 5 4 ) -> [9.48683]
+ ( 6 3 ) -> [11]
diff --git a/src/Rips_complex/example/one_skeleton_rips_for_doc.txt b/src/Rips_complex/example/one_skeleton_rips_for_doc.txt
new file mode 100644
index 00000000..706512a5
--- /dev/null
+++ b/src/Rips_complex/example/one_skeleton_rips_for_doc.txt
@@ -0,0 +1,20 @@
+Rips complex is of dimension 1 - 18 simplices - 7 vertices.
+Iterator on Rips complex simplices in the filtration order, with [filtration value]:
+ ( 0 ) -> [0]
+ ( 1 ) -> [0]
+ ( 2 ) -> [0]
+ ( 3 ) -> [0]
+ ( 4 ) -> [0]
+ ( 5 ) -> [0]
+ ( 6 ) -> [0]
+ ( 3 2 ) -> [5]
+ ( 5 4 ) -> [5.38516]
+ ( 2 0 ) -> [5.83095]
+ ( 1 0 ) -> [6.08276]
+ ( 3 1 ) -> [6.32456]
+ ( 2 1 ) -> [6.7082]
+ ( 6 5 ) -> [7.28011]
+ ( 4 2 ) -> [8.94427]
+ ( 3 0 ) -> [9.43398]
+ ( 6 4 ) -> [9.48683]
+ ( 6 3 ) -> [11]
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]