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.txt13
-rw-r--r--src/Rips_complex/example/example_one_skeleton_rips_from_correlation_matrix.cpp14
-rw-r--r--src/Rips_complex/example/example_one_skeleton_rips_from_distance_matrix.cpp12
-rw-r--r--src/Rips_complex/example/example_one_skeleton_rips_from_points.cpp12
-rw-r--r--src/Rips_complex/example/example_rips_complex_from_csv_distance_matrix_file.cpp8
-rw-r--r--src/Rips_complex/example/example_rips_complex_from_off_file.cpp8
-rw-r--r--src/Rips_complex/example/example_sparse_rips.cpp2
7 files changed, 36 insertions, 33 deletions
diff --git a/src/Rips_complex/example/CMakeLists.txt b/src/Rips_complex/example/CMakeLists.txt
index e7772bdb..206f4c11 100644
--- a/src/Rips_complex/example/CMakeLists.txt
+++ b/src/Rips_complex/example/CMakeLists.txt
@@ -53,19 +53,22 @@ if (DIFF_PATH)
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)
+ set_tests_properties(Rips_complex_example_from_off_doc_12_1_diff_files PROPERTIES DEPENDS Rips_complex_example_from_off_doc_12_1)
+
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)
+ set_tests_properties(Rips_complex_example_from_off_doc_12_3_diff_files PROPERTIES DEPENDS Rips_complex_example_from_off_doc_12_3)
+
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)
+ set_tests_properties(Rips_complex_example_from_csv_distance_matrix_doc_12_1_diff_files PROPERTIES DEPENDS Rips_complex_example_from_csv_distance_matrix_doc_12_1)
+
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)
+ set_tests_properties(Rips_complex_example_from_csv_distance_matrix_doc_12_3_diff_files PROPERTIES DEPENDS Rips_complex_example_from_csv_distance_matrix_doc_12_3)
+
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
index 05bacb9f..3811d1f1 100644
--- 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
@@ -40,7 +40,7 @@ int main() {
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
+ // Here we make sure that we will get the threshold value equal to maximal
// distance in the matrix.
if (correlations[i][j] > threshold) threshold = correlations[i][j];
}
@@ -63,18 +63,18 @@ int main() {
// 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 - "
+ std::clog << "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;
+ std::clog << "Iterator on Rips complex simplices in the filtration order, with [filtration value]:" << std::endl;
for (auto f_simplex : stree.filtration_simplex_range()) {
- std::cout << " ( ";
+ std::clog << " ( ";
for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
- std::cout << vertex << " ";
+ std::clog << vertex << " ";
}
- std::cout << ") -> "
+ std::clog << ") -> "
<< "[" << stree.filtration(f_simplex) << "] ";
- std::cout << std::endl;
+ std::clog << 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
index bbc3c755..25f93b03 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
@@ -39,19 +39,19 @@ int main() {
// ----------------------------------------------------------------------------
// Display information about the one skeleton Rips complex
// ----------------------------------------------------------------------------
- std::cout << "Rips complex is of dimension " << stree.dimension() <<
+ std::clog << "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::clog << "Iterator on Rips complex simplices in the filtration order, with [filtration value]:" <<
std::endl;
for (auto f_simplex : stree.filtration_simplex_range()) {
- std::cout << " ( ";
+ std::clog << " ( ";
for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
- std::cout << vertex << " ";
+ std::clog << vertex << " ";
}
- std::cout << ") -> " << "[" << stree.filtration(f_simplex) << "] ";
- std::cout << std::endl;
+ std::clog << ") -> " << "[" << stree.filtration(f_simplex) << "] ";
+ std::clog << 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 a1db8910..d9df245b 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
@@ -34,19 +34,19 @@ int main() {
// ----------------------------------------------------------------------------
// Display information about the one skeleton Rips complex
// ----------------------------------------------------------------------------
- std::cout << "Rips complex is of dimension " << stree.dimension() <<
+ std::clog << "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::clog << "Iterator on Rips complex simplices in the filtration order, with [filtration value]:" <<
std::endl;
for (auto f_simplex : stree.filtration_simplex_range()) {
- std::cout << " ( ";
+ std::clog << " ( ";
for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
- std::cout << vertex << " ";
+ std::clog << vertex << " ";
}
- std::cout << ") -> " << "[" << stree.filtration(f_simplex) << "] ";
- std::cout << std::endl;
+ std::clog << ") -> " << "[" << stree.filtration(f_simplex) << "] ";
+ std::clog << 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 9e182f1e..c0c57e7b 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
@@ -35,19 +35,19 @@ int main(int argc, char **argv) {
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::streambuf* streambuffer;
std::ofstream ouput_file_stream;
if (argc == 5) {
ouput_file_stream.open(std::string(argv[4]));
- streambufffer = ouput_file_stream.rdbuf();
+ streambuffer = ouput_file_stream.rdbuf();
} else {
- streambufffer = std::cout.rdbuf();
+ streambuffer = std::clog.rdbuf();
}
Simplex_tree stree;
rips_complex_from_file.create_complex(stree, dim_max);
- std::ostream output_stream(streambufffer);
+ std::ostream output_stream(streambuffer);
// ----------------------------------------------------------------------------
// Display information about the Rips complex
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 de2e4ea4..9aa7a657 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
@@ -34,19 +34,19 @@ int main(int argc, char **argv) {
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::streambuf* streambuffer;
std::ofstream ouput_file_stream;
if (argc == 5) {
ouput_file_stream.open(std::string(argv[4]));
- streambufffer = ouput_file_stream.rdbuf();
+ streambuffer = ouput_file_stream.rdbuf();
} else {
- streambufffer = std::cout.rdbuf();
+ streambuffer = std::clog.rdbuf();
}
Simplex_tree stree;
rips_complex_from_file.create_complex(stree, dim_max);
- std::ostream output_stream(streambufffer);
+ std::ostream output_stream(streambuffer);
// ----------------------------------------------------------------------------
// Display information about the Rips complex
diff --git a/src/Rips_complex/example/example_sparse_rips.cpp b/src/Rips_complex/example/example_sparse_rips.cpp
index 1c95b48c..4bd31103 100644
--- a/src/Rips_complex/example/example_sparse_rips.cpp
+++ b/src/Rips_complex/example/example_sparse_rips.cpp
@@ -25,6 +25,6 @@ int main() {
// ----------------------------------------------------------------------------
// Display information about the complex
// ----------------------------------------------------------------------------
- std::cout << "Sparse Rips complex is of dimension " << stree.dimension() << " - " << stree.num_simplices()
+ std::clog << "Sparse Rips complex is of dimension " << stree.dimension() << " - " << stree.num_simplices()
<< " simplices - " << stree.num_vertices() << " vertices." << std::endl;
}