From bf4b4eeda9762ed9e99c2b24f19331fa0111fcfe Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Mon, 27 Jan 2020 10:43:16 +0100 Subject: Code review: Use std::clog instead of std::cout --- .../persistence_from_simple_simplex_tree.cpp | 46 +++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/Persistent_cohomology/example/persistence_from_simple_simplex_tree.cpp') diff --git a/src/Persistent_cohomology/example/persistence_from_simple_simplex_tree.cpp b/src/Persistent_cohomology/example/persistence_from_simple_simplex_tree.cpp index 3c91662f..bffaabdd 100644 --- a/src/Persistent_cohomology/example/persistence_from_simple_simplex_tree.cpp +++ b/src/Persistent_cohomology/example/persistence_from_simple_simplex_tree.cpp @@ -51,62 +51,62 @@ int main(int argc, char * const argv[]) { } // TEST OF INSERTION - std::cout << "********************************************************************" << std::endl; - std::cout << "TEST OF INSERTION" << std::endl; + std::clog << "********************************************************************" << std::endl; + std::clog << "TEST OF INSERTION" << std::endl; Simplex_tree st; // ++ FIRST - std::cout << " - INSERT (0,1,2)" << std::endl; + std::clog << " - INSERT (0,1,2)" << std::endl; typeVectorVertex SimplexVector = {0, 1, 2}; st.insert_simplex_and_subfaces(SimplexVector, 0.3); // ++ SECOND - std::cout << " - INSERT 3" << std::endl; + std::clog << " - INSERT 3" << std::endl; SimplexVector = {3}; st.insert_simplex_and_subfaces(SimplexVector, 0.1); // ++ THIRD - std::cout << " - INSERT (0,3)" << std::endl; + std::clog << " - INSERT (0,3)" << std::endl; SimplexVector = {0, 3}; st.insert_simplex_and_subfaces(SimplexVector, 0.2); // ++ FOURTH - std::cout << " - INSERT (0,1) (already inserted)" << std::endl; + std::clog << " - INSERT (0,1) (already inserted)" << std::endl; SimplexVector = {0, 1}; st.insert_simplex_and_subfaces(SimplexVector, 0.2); // ++ FIFTH - std::cout << " - INSERT (3,4,5)" << std::endl; + std::clog << " - INSERT (3,4,5)" << std::endl; SimplexVector = {3, 4, 5}; st.insert_simplex_and_subfaces(SimplexVector, 0.3); // ++ SIXTH - std::cout << " - INSERT (0,1,6,7)" << std::endl; + std::clog << " - INSERT (0,1,6,7)" << std::endl; SimplexVector = {0, 1, 6, 7}; st.insert_simplex_and_subfaces(SimplexVector, 0.4); // ++ SEVENTH - std::cout << " - INSERT (4,5,8,9)" << std::endl; + std::clog << " - INSERT (4,5,8,9)" << std::endl; SimplexVector = {4, 5, 8, 9}; st.insert_simplex_and_subfaces(SimplexVector, 0.4); // ++ EIGHTH - std::cout << " - INSERT (9,10,11)" << std::endl; + std::clog << " - INSERT (9,10,11)" << std::endl; SimplexVector = {9, 10, 11}; st.insert_simplex_and_subfaces(SimplexVector, 0.3); // ++ NINETH - std::cout << " - INSERT (2,10,12)" << std::endl; + std::clog << " - INSERT (2,10,12)" << std::endl; SimplexVector = {2, 10, 12}; st.insert_simplex_and_subfaces(SimplexVector, 0.3); // ++ TENTH - std::cout << " - INSERT (11,6)" << std::endl; + std::clog << " - INSERT (11,6)" << std::endl; SimplexVector = {6, 11}; st.insert_simplex_and_subfaces(SimplexVector, 0.2); // ++ ELEVENTH - std::cout << " - INSERT (13,14,15)" << std::endl; + std::clog << " - INSERT (13,14,15)" << std::endl; SimplexVector = {13, 14, 15}; st.insert_simplex_and_subfaces(SimplexVector, 0.25); @@ -131,24 +131,24 @@ int main(int argc, char * const argv[]) { /* An edge [10,12,2] */ - std::cout << "The complex contains " << st.num_simplices() << " simplices - " << st.num_vertices() << " vertices " + std::clog << "The complex contains " << st.num_simplices() << " simplices - " << st.num_vertices() << " vertices " << std::endl; - std::cout << " - dimension " << st.dimension() << std::endl; - std::cout << std::endl << std::endl << "Iterator on Simplices in the filtration, with [filtration value]:" + std::clog << " - dimension " << st.dimension() << std::endl; + std::clog << std::endl << std::endl << "Iterator on Simplices in the filtration, with [filtration value]:" << std::endl; - std::cout << "**************************************************************" << std::endl; - std::cout << "strict graph G { " << std::endl; + std::clog << "**************************************************************" << std::endl; + std::clog << "strict graph G { " << std::endl; for (auto f_simplex : st.filtration_simplex_range()) { - std::cout << " " << "[" << st.filtration(f_simplex) << "] "; + std::clog << " " << "[" << st.filtration(f_simplex) << "] "; for (auto vertex : st.simplex_vertex_range(f_simplex)) { - std::cout << static_cast(vertex) << " -- "; + std::clog << static_cast(vertex) << " -- "; } - std::cout << ";" << std::endl; + std::clog << ";" << std::endl; } - std::cout << "}" << std::endl; - std::cout << "**************************************************************" << std::endl; + std::clog << "}" << std::endl; + std::clog << "**************************************************************" << std::endl; // Compute the persistence diagram of the complex Persistent_cohomology pcoh(st); -- cgit v1.2.3