diff options
Diffstat (limited to 'src/Gudhi_stat/utilities/persistence_landscapes')
-rw-r--r-- | src/Gudhi_stat/utilities/persistence_landscapes/create_landscapes.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/Gudhi_stat/utilities/persistence_landscapes/create_landscapes.cpp b/src/Gudhi_stat/utilities/persistence_landscapes/create_landscapes.cpp index 5485bf2a..f36e313a 100644 --- a/src/Gudhi_stat/utilities/persistence_landscapes/create_landscapes.cpp +++ b/src/Gudhi_stat/utilities/persistence_landscapes/create_landscapes.cpp @@ -32,9 +32,19 @@ using namespace Gudhi::Gudhi_stat; int main( int argc , char** argv ) { - std::cout << "This program creates persistence landscapes of diagrams provided as an input. Please call this program with the names of files with persistence diagrams \n"; + std::cout << "This program creates persistence landscapes of diagrams provided as an input. \n"; + std::cout << "The first parameter of the program is the dimension of persistence to be used to construct persistence landscapes. If your file contains "; + std::cout << "the information about dimension of persistence pairs, please provide here the dimension of persistence pairs you want to use. If your input files consist only "; + std::cout << "of birth-death pairs, please set this first parameter to -1 \n"; + std::cout << "The remaining parameters of the program are the names of files with persistence diagrams. \n"; std::vector< const char* > filenames; - for ( int i = 1 ; i < argc ; ++i ) + int dim = atoi(argv[1]); + unsigned dimension = std::numeric_limits<unsigned>::max(); + if ( (dim != -1) && (dim >= 0) ) + { + dimension = (unsigned)dim; + } + for ( int i = 2 ; i < argc ; ++i ) { filenames.push_back( argv[i] ); } @@ -42,8 +52,7 @@ int main( int argc , char** argv ) std::cout << "Creating persistence landscapes...\n"; for ( size_t i = 0 ; i != filenames.size() ; ++i ) { - //std::vector< std::pair< double , double > > pers = read_standard_file( filename ); - Persistence_landscape l( filenames[i] , 1 ); + Persistence_landscape l( filenames[i] , dimension ); std::stringstream ss; ss << filenames[i] << ".land"; l.print_to_file( ss.str().c_str() ); |