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/example_one_skeleton_rips_from_distance_matrix.cpp32
-rw-r--r--src/Rips_complex/example/example_one_skeleton_rips_from_points.cpp33
-rw-r--r--src/Rips_complex/example/example_rips_complex_from_csv_distance_matrix_file.cpp34
-rw-r--r--src/Rips_complex/example/example_rips_complex_from_off_file.cpp34
4 files changed, 66 insertions, 67 deletions
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
index 02bffe0d..326ad52f 100644
--- 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
@@ -45,24 +45,24 @@ int main(int argc, char **argv) {
Rips_complex rips_complex_from_points(distances, threshold);
Simplex_tree stree;
- if (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;
+ 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;
+ 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
index efbcd88e..6e8dee27 100644
--- a/src/Rips_complex/example/example_one_skeleton_rips_from_points.cpp
+++ b/src/Rips_complex/example/example_one_skeleton_rips_from_points.cpp
@@ -40,24 +40,23 @@ int main(int argc, char **argv) {
Rips_complex rips_complex_from_points(points, threshold, Euclidean_distance());
Simplex_tree stree;
- if (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;
+ 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
index 7cdaffdf..cc6c3a33 100644
--- 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
@@ -46,27 +46,27 @@ int main(int argc, char **argv) {
}
Simplex_tree stree;
- if (rips_complex_from_file.create_complex(stree, dim_max)) {
- std::ostream output_stream(streambufffer);
+ 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;
+ // ----------------------------------------------------------------------------
+ // 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;
+ 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
index 8849d784..b6c961d0 100644
--- a/src/Rips_complex/example/example_rips_complex_from_off_file.cpp
+++ b/src/Rips_complex/example/example_rips_complex_from_off_file.cpp
@@ -45,27 +45,27 @@ int main(int argc, char **argv) {
}
Simplex_tree stree;
- if (rips_complex_from_file.create_complex(stree, dim_max)) {
- std::ostream output_stream(streambufffer);
+ 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;
+ // ----------------------------------------------------------------------------
+ // 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;
+ 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;
}