diff options
author | pdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-09-24 19:31:43 +0000 |
---|---|---|
committer | pdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-09-24 19:31:43 +0000 |
commit | 48a10aa15e5ccde24f39837b2a0f0776b6ac21b7 (patch) | |
tree | 9a4a2d650db20e6a458f350edb60751ef9b1413b /src/Gudhi_stat/example | |
parent | 5719bcccd6b09eadcae8de8d9b8f1aa4983c56b3 (diff) |
after tests of utilities for scalar products.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/gudhi_stat@1556 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 529fc7963626fdab93284c27a3b6f03457d80c5c
Diffstat (limited to 'src/Gudhi_stat/example')
5 files changed, 16 insertions, 19 deletions
diff --git a/src/Gudhi_stat/example/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp b/src/Gudhi_stat/example/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp index a7359a02..d90e78e1 100644 --- a/src/Gudhi_stat/example/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp +++ b/src/Gudhi_stat/example/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp @@ -61,7 +61,7 @@ int main( int argc , char** argv ) Persistence_heat_maps av; av.compute_average( maps ); - av.print_to_file( "average" ); + av.print_to_file( "average.mps" ); for ( size_t i = 0 ; i != filenames.size() ; ++i ) { diff --git a/src/Gudhi_stat/example/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp b/src/Gudhi_stat/example/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp index 8164a93e..10d6f04c 100644 --- a/src/Gudhi_stat/example/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp +++ b/src/Gudhi_stat/example/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp @@ -38,7 +38,7 @@ int main( int argc , char** argv ) { std::cout << "This program compute dsitance of persistence landscapes stored in a file (the file needs to be created beforehand). \n"; std::cout << "The first parameter of a program is an interger p. The program compute L^p distance of the two landscapes. For L^infty distance choose p = -1. \n"; - std::cout << "The remaining parameters of this programs are names of files with persistence landscapes."; + std::cout << "The remaining parameters of this programs are names of files with persistence landscapes.\n"; if ( argc < 3 ) { @@ -46,7 +46,7 @@ int main( int argc , char** argv ) return 1; } - int p = atoi( argv[3] ); + int p = atoi( argv[1] ); std::vector< const char* > filenames; for ( int i = 2 ; i < argc ; ++i ) diff --git a/src/Gudhi_stat/example/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp b/src/Gudhi_stat/example/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp index 82fe207e..cd529f10 100644 --- a/src/Gudhi_stat/example/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp +++ b/src/Gudhi_stat/example/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp @@ -37,7 +37,7 @@ using namespace Gudhi::Gudhi_stat; int main( int argc , char** argv ) { std::cout << "This program compute scalar product of persistence landscapes stored in a file (the file needs to be created beforehand). \n"; - std::cout << "The parameters of this programs are names of files with persistence landscapes."; + std::cout << "The parameters of this programs are names of files with persistence landscapes.\n"; std::vector< const char* > filenames; for ( int i = 1 ; i < argc ; ++i ) diff --git a/src/Gudhi_stat/example/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp b/src/Gudhi_stat/example/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp index 152a1616..14a25918 100644 --- a/src/Gudhi_stat/example/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp +++ b/src/Gudhi_stat/example/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp @@ -40,9 +40,10 @@ int main( int argc , char** argv ) std::cout << "This program creates persistence landscape on grid of diagrams provided as an input.\n"; std::cout << "The first parameter of a program is an integer, a size of a grid.\n"; std::cout << "The second and third parameters are min and max of the grid. If you want those numbers to be computed based on the data, set them both to -1 \n"; - std::cout << "The remoaning parameters are the names of files with persistence diagrams. \n"; + std::cerr << "The fourth parameter is an integer, the standard deviation of a gaussian kernel expressed in a number of pixels \n"; + std::cout << "The remaining parameters are the names of files with persistence diagrams. \n"; - if ( argc < 4 ) + if ( argc < 5 ) { std::cout << "Wrong parameter list, the program will now terminate \n"; return 1; @@ -51,24 +52,26 @@ int main( int argc , char** argv ) size_t size_of_grid = (size_t)atoi( argv[1] ); double min_ = atof( argv[2] ); double max_ = atof( argv[3] ); + size_t stdiv = atof( argv[4] ); std::vector< const char* > filenames; - for ( int i = 4 ; i < argc ; ++i ) + for ( int i = 5 ; i < argc ; ++i ) { filenames.push_back( argv[i] ); } - std::cout << "Creating persistence heat maps...\n"; - std::vector< std::vector<double> > filter = create_Gaussian_filter(10,1); + std::vector< std::vector<double> > filter = create_Gaussian_filter(stdiv,1); for ( size_t i = 0 ; i != filenames.size() ; ++i ) { - Persistence_heat_maps l( filenames[i] , filter, constant_function, false , size_of_grid , min_ , max_ ); + std::cout << "Creating a heat map based on a file : " << filenames[i] << std::endl; + Persistence_heat_maps l( filenames[i] , filter, constant_function, false , size_of_grid , min_ , max_ ); + std::stringstream ss; - ss << filenames[i] << ".land"; + ss << filenames[i] << ".mps"; l.print_to_file( ss.str().c_str() ); } std::cout << "Done \n"; diff --git a/src/Gudhi_stat/example/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp b/src/Gudhi_stat/example/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp index d163aba6..b85a502b 100644 --- a/src/Gudhi_stat/example/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp +++ b/src/Gudhi_stat/example/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp @@ -38,13 +38,7 @@ int main( int argc , char** argv ) { std::cout << "This program plot persistence landscape stored in a file (the file needs to be created beforehand). Please call the code with the name of a landsape file \n"; Persistence_heat_maps l; - l.load_from_file( argv[1] ); - - std::stringstream ss; - ss << argv[1] << "_gnuplot_script"; - l.plot( ss.str().c_str() ); - - std::cout << "Done \n"; - + l.load_from_file( argv[1] ); + l.plot( argv[1] ); return 0; } |