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 --- .../utilities/persistence_landscapes/average_landscapes.cpp | 6 +++--- .../persistence_landscapes/compute_distance_of_landscapes.cpp | 10 +++++----- .../compute_scalar_product_of_landscapes.cpp | 10 +++++----- .../utilities/persistence_landscapes/create_landscapes.cpp | 6 +++--- .../utilities/persistence_landscapes/plot_landscapes.cpp | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/Persistence_representations/utilities/persistence_landscapes') diff --git a/src/Persistence_representations/utilities/persistence_landscapes/average_landscapes.cpp b/src/Persistence_representations/utilities/persistence_landscapes/average_landscapes.cpp index 04a0ada4..612e9700 100644 --- a/src/Persistence_representations/utilities/persistence_landscapes/average_landscapes.cpp +++ b/src/Persistence_representations/utilities/persistence_landscapes/average_landscapes.cpp @@ -16,13 +16,13 @@ using Persistence_landscape = Gudhi::Persistence_representations::Persistence_landscape; int main(int argc, char** argv) { - std::cout << "This program computes average of persistence landscapes stored in files (the files needs to be " + std::clog << "This program computes average of persistence landscapes stored in files (the files needs to be " << "created beforehand).\n" << "The parameters of this programs are names of files with persistence landscapes.\n"; std::vector filenames; if (argc < 3) { - std::cout << "Wrong number of parameters, the program will now terminate \n"; + std::clog << "Wrong number of parameters, the program will now terminate \n"; return 1; } @@ -46,6 +46,6 @@ int main(int argc, char** argv) { delete lands[i]; } - std::cout << "Average can be found in 'average.land' file\n"; + std::clog << "Average can be found in 'average.land' file\n"; return 0; } diff --git a/src/Persistence_representations/utilities/persistence_landscapes/compute_distance_of_landscapes.cpp b/src/Persistence_representations/utilities/persistence_landscapes/compute_distance_of_landscapes.cpp index 1093c1aa..2246a37d 100644 --- a/src/Persistence_representations/utilities/persistence_landscapes/compute_distance_of_landscapes.cpp +++ b/src/Persistence_representations/utilities/persistence_landscapes/compute_distance_of_landscapes.cpp @@ -18,14 +18,14 @@ using Persistence_landscape = Gudhi::Persistence_representations::Persistence_landscape; int main(int argc, char** argv) { - std::cout << "This program computes distance of persistence landscapes stored in files (the files needs to be " + std::clog << "This program computes distance of persistence landscapes stored in files (the files needs to be " << "created beforehand).\n" << "The first parameter of a program is an integer p. The program compute L^p distance of the two heat " << "maps. For L^infty distance choose p = -1. \n" << "The remaining parameters of this program are names of files with persistence landscapes.\n"; if (argc < 3) { - std::cout << "Wrong number of parameters, the program will now terminate \n"; + std::clog << "Wrong number of parameters, the program will now terminate \n"; return 1; } @@ -68,14 +68,14 @@ int main(int argc, char** argv) { out.open("distance.land"); for (size_t i = 0; i != distance.size(); ++i) { for (size_t j = 0; j != distance.size(); ++j) { - std::cout << distance[i][j] << " "; + std::clog << distance[i][j] << " "; out << distance[i][j] << " "; } - std::cout << std::endl; + std::clog << std::endl; out << std::endl; } out.close(); - std::cout << "Distance can be found in 'distance.land' file\n"; + std::clog << "Distance can be found in 'distance.land' file\n"; return 0; } diff --git a/src/Persistence_representations/utilities/persistence_landscapes/compute_scalar_product_of_landscapes.cpp b/src/Persistence_representations/utilities/persistence_landscapes/compute_scalar_product_of_landscapes.cpp index 16b76497..44f50543 100644 --- a/src/Persistence_representations/utilities/persistence_landscapes/compute_scalar_product_of_landscapes.cpp +++ b/src/Persistence_representations/utilities/persistence_landscapes/compute_scalar_product_of_landscapes.cpp @@ -17,12 +17,12 @@ using Persistence_landscape = Gudhi::Persistence_representations::Persistence_landscape; int main(int argc, char** argv) { - std::cout << "This program computes scalar product of persistence landscapes stored in a file (the file needs to be " + std::clog << "This program computes scalar product of persistence landscapes stored in a file (the file needs to be " << "created beforehand). \n" << "The parameters of this programs are names of files with persistence landscapes.\n"; if (argc < 3) { - std::cout << "Wrong number of parameters, the program will now terminate \n"; + std::clog << "Wrong number of parameters, the program will now terminate \n"; return 1; } @@ -59,14 +59,14 @@ int main(int argc, char** argv) { out.open("scalar_product.land"); for (size_t i = 0; i != scalar_product.size(); ++i) { for (size_t j = 0; j != scalar_product.size(); ++j) { - std::cout << scalar_product[i][j] << " "; + std::clog << scalar_product[i][j] << " "; out << scalar_product[i][j] << " "; } - std::cout << std::endl; + std::clog << std::endl; out << std::endl; } out.close(); - std::cout << "Distance can be found in 'scalar_product.land' file\n"; + std::clog << "Distance can be found in 'scalar_product.land' file\n"; return 0; } diff --git a/src/Persistence_representations/utilities/persistence_landscapes/create_landscapes.cpp b/src/Persistence_representations/utilities/persistence_landscapes/create_landscapes.cpp index 4d772086..fab5c75f 100644 --- a/src/Persistence_representations/utilities/persistence_landscapes/create_landscapes.cpp +++ b/src/Persistence_representations/utilities/persistence_landscapes/create_landscapes.cpp @@ -18,7 +18,7 @@ using Persistence_landscape = Gudhi::Persistence_representations::Persistence_landscape; int main(int argc, char** argv) { - std::cout << "This program creates persistence landscapes files (*.land) of persistence diagrams files (*.pers) " + std::clog << "This program creates persistence landscapes files (*.land) of persistence diagrams files (*.pers) " << "provided as an input.\n" << "The first parameter of this program is a dimension of persistence that will be used in creation of " << "the persistence heat maps." @@ -29,7 +29,7 @@ int main(int argc, char** argv) { << "The remaining parameters are the names of files with persistence diagrams. \n"; if (argc < 3) { - std::cout << "Wrong parameter list, the program will now terminate \n"; + std::clog << "Wrong parameter list, the program will now terminate \n"; return 1; } std::vector filenames; @@ -43,7 +43,7 @@ int main(int argc, char** argv) { } for (size_t i = 0; i != filenames.size(); ++i) { - std::cout << "Creating a landscape based on file : " << filenames[i] << std::endl; + std::clog << "Creating a landscape based on file : " << filenames[i] << std::endl; Persistence_landscape l(filenames[i], dimension); std::stringstream ss; ss << filenames[i] << ".land"; diff --git a/src/Persistence_representations/utilities/persistence_landscapes/plot_landscapes.cpp b/src/Persistence_representations/utilities/persistence_landscapes/plot_landscapes.cpp index 1fe03640..da9b9bba 100644 --- a/src/Persistence_representations/utilities/persistence_landscapes/plot_landscapes.cpp +++ b/src/Persistence_representations/utilities/persistence_landscapes/plot_landscapes.cpp @@ -16,10 +16,10 @@ using Persistence_landscape = Gudhi::Persistence_representations::Persistence_landscape; int main(int argc, char** argv) { - std::cout << "This program creates a gnuplot script from a persistence landscape stored in a file (the file needs " + std::clog << "This program creates a gnuplot script from a persistence landscape stored in a file (the file needs " << "to be created beforehand). Please call the code with the name of a single landscape file.\n"; if (argc != 2) { - std::cout << "Wrong parameter list, the program will now terminate \n"; + std::clog << "Wrong parameter list, the program will now terminate \n"; return 1; } -- cgit v1.2.3