summaryrefslogtreecommitdiff
path: root/src/Gudhi_stat/utilities/persistence_landscapes/create_landscapes.cpp
diff options
context:
space:
mode:
authorpdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-04-12 13:07:58 +0000
committerpdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-04-12 13:07:58 +0000
commit8f4c961a93fe928d06c7776a9e8f5ecd00fab9ca (patch)
tree0222aa7a5db950b15e7b1adf9f75cec2204c55fa /src/Gudhi_stat/utilities/persistence_landscapes/create_landscapes.cpp
parente729d07cc53e4b6a189ebbfbfe4eb5db5449fbe0 (diff)
a few more correction. First of all, bottleneck distance is added (although there is something strange in the results, FG has been pinged about this). Second of all, all the programs in utylites should now read general files (and dimension of persistence to be read is one of the parameteds of files). This still need to be tested and will be tested soon.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/gudhi_stat@2339 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: e60d14f07db223646597230d7f0bd78dd090bc0b
Diffstat (limited to 'src/Gudhi_stat/utilities/persistence_landscapes/create_landscapes.cpp')
-rw-r--r--src/Gudhi_stat/utilities/persistence_landscapes/create_landscapes.cpp17
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() );