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 --- .../rips_persistence_via_boundary_matrix.cpp | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp') diff --git a/src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp b/src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp index 37fa5e93..db456f70 100644 --- a/src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp +++ b/src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp @@ -64,8 +64,8 @@ int main(int argc, char * argv[]) { Simplex_tree& st = *new Simplex_tree; rips_complex_from_file.create_complex(st, dim_max); - std::cout << "The complex contains " << st.num_simplices() << " simplices \n"; - std::cout << " and has dimension " << st.dimension() << " \n"; + std::clog << "The complex contains " << st.num_simplices() << " simplices \n"; + std::clog << " and has dimension " << st.dimension() << " \n"; #ifdef GUDHI_USE_TBB // Unnecessary, but clarifies which operations are parallel. @@ -122,7 +122,7 @@ void program_options(int argc, char * argv[] visible.add_options() ("help,h", "produce help message") ("output-file,o", po::value(&filediag)->default_value(std::string()), - "Name of file in which the persistence diagram is written. Default print in std::cout") + "Name of file in which the persistence diagram is written. Default print in std::clog") ("max-edge-length,r", po::value(&threshold)->default_value(0), "Maximal length of an edge for the Rips complex construction.") ("cpx-dimension,d", po::value(&dim_max)->default_value(1), @@ -144,17 +144,17 @@ void program_options(int argc, char * argv[] 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 set of input points.\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::clog << std::endl; + std::clog << "Compute the persistent homology with coefficient field Z/pZ \n"; + std::clog << "of a Rips complex defined on a set of input points.\n \n"; + std::clog << "The output diagram contains one bar per line, written with the convention: \n"; + std::clog << " p dim b d \n"; + std::clog << "where dim is the dimension of the homological feature,\n"; + std::clog << "b and d are respectively the birth and death of the feature and \n"; + std::clog << "p is the characteristic of the field Z/pZ used for homology coefficients." << std::endl << std::endl; + + std::clog << "Usage: " << argv[0] << " [options] input-file" << std::endl << std::endl; + std::clog << visible << std::endl; exit(-1); } } -- cgit v1.2.3 From 8edcb434b45ef07828f8111dedcbed024f469314 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Sun, 3 May 2020 09:04:17 +0200 Subject: Fix TBB Warning: tbb/task_scheduler_init.h is deprecated. --- .../example/rips_persistence_via_boundary_matrix.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp') diff --git a/src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp b/src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp index db456f70..8c5742aa 100644 --- a/src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp +++ b/src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp @@ -17,10 +17,6 @@ #include -#ifdef GUDHI_USE_TBB -#include -#endif - #include #include @@ -67,11 +63,6 @@ int main(int argc, char * argv[]) { std::clog << "The complex contains " << st.num_simplices() << " simplices \n"; std::clog << " and has dimension " << st.dimension() << " \n"; -#ifdef GUDHI_USE_TBB - // Unnecessary, but clarifies which operations are parallel. - tbb::task_scheduler_init ts; -#endif - // Sort the simplices in the order of the filtration st.initialize_filtration(); int count = 0; @@ -81,10 +72,6 @@ int main(int argc, char * argv[]) { // Convert to a more convenient representation. Gudhi::Hasse_complex<> hcpx(st); -#ifdef GUDHI_USE_TBB - ts.terminate(); -#endif - // Free some space. delete &st; -- cgit v1.2.3