From b7b23c26b855b83d03870cfd90b001fa2dedfd86 Mon Sep 17 00:00:00 2001 From: pdlotko Date: Fri, 9 Dec 2016 14:55:03 +0000 Subject: Fix to Marc's comments. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/gudhi_stat@1841 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: c5be190621dcbb43433c027c78e782916cc6ae93 --- .../compute_distance_of_persistence_vectors.cpp | 16 +++++++++++----- .../compute_scalar_product_of_persistence_vectors.cpp | 8 ++++---- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'src/Gudhi_stat/utilities/persistence_vectors') diff --git a/src/Gudhi_stat/utilities/persistence_vectors/compute_distance_of_persistence_vectors.cpp b/src/Gudhi_stat/utilities/persistence_vectors/compute_distance_of_persistence_vectors.cpp index 7b7faef0..2ca5989e 100644 --- a/src/Gudhi_stat/utilities/persistence_vectors/compute_distance_of_persistence_vectors.cpp +++ b/src/Gudhi_stat/utilities/persistence_vectors/compute_distance_of_persistence_vectors.cpp @@ -43,7 +43,13 @@ int main( int argc , char** argv ) return 1; } - int p = atoi( argv[1] ); + int pp = atoi( argv[1] ); + double p = std::numeric_limits::max(); + if ( pp != -1 ) + { + p = pp; + } + std::vector< const char* > filenames; for ( int i = 2 ; i < argc ; ++i ) @@ -80,17 +86,17 @@ int main( int argc , char** argv ) } //and now output the result to the screen and a file: - ofstream out; + std::ofstream out; out.open( "distance" ); for ( size_t i = 0 ; i != distance.size() ; ++i ) { for ( size_t j = 0 ; j != distance.size() ; ++j ) { - cout << distance[i][j] << " "; + std::cout << distance[i][j] << " "; out << distance[i][j] << " "; } - cout << endl; - out << endl; + std::cout << std::endl; + out << std::endl; } out.close(); diff --git a/src/Gudhi_stat/utilities/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp b/src/Gudhi_stat/utilities/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp index 74172712..78c6ab91 100644 --- a/src/Gudhi_stat/utilities/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp +++ b/src/Gudhi_stat/utilities/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp @@ -70,17 +70,17 @@ int main( int argc , char** argv ) } //and now output the result to the screen and a file: - ofstream out; + std::ofstream out; out.open( "scalar_product" ); for ( size_t i = 0 ; i != scalar_product.size() ; ++i ) { for ( size_t j = 0 ; j != scalar_product.size() ; ++j ) { - cout << scalar_product[i][j] << " "; + std::cout << scalar_product[i][j] << " "; out << scalar_product[i][j] << " "; } - cout << endl; - out << endl; + std::cout << std::endl; + out << std::endl; } out.close(); return 0; -- cgit v1.2.3