summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-09-25 19:05:38 +0000
committerpdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-09-25 19:05:38 +0000
commit23e3211c569229709a75f735724c4d3d4ffdbc23 (patch)
tree07f4a5da8d4c3272759ea7286635316acd341bd0 /src
parent8716c180924d7751f0467fe409294604a19fc02a (diff)
the same for landscapes on a grid. Be careful, we still have a problem with scalar product!!!
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/gudhi_stat@1559 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 12056d1024edecc295772352751e4762777a6a67
Diffstat (limited to 'src')
-rw-r--r--src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp2
-rw-r--r--src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp6
-rw-r--r--src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp2
-rw-r--r--src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp5
-rw-r--r--src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp5
5 files changed, 13 insertions, 7 deletions
diff --git a/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp b/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
index 497e2c7c..7c3b8db2 100644
--- a/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
+++ b/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
@@ -61,7 +61,7 @@ int main( int argc , char** argv )
Persistence_landscape_on_grid av;
av.compute_average( lands );
- av.print_to_file( "average" );
+ av.print_to_file( "average.g_land" );
for ( size_t i = 0 ; i != filenames.size() ; ++i )
{
diff --git a/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp b/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
index 355b7976..20cb52c9 100644
--- a/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
+++ b/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
@@ -37,8 +37,8 @@ using namespace Gudhi::Gudhi_stat;
int main( int argc , char** argv )
{
std::cout << "This program compute dsitance of persistence landscapes on grid 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 on grid. For L^infty distance choose p = -1. \n";
- std::cout << "The remaining parameters of this programs are names of files with persistence landscapes on grid.";
+ std::cout << "The first parameter of a program is an interger p. The program compute L^p distance of the the landscapes on grid. For L^infty distance choose p = -1. \n";
+ std::cout << "The remaining parameters of this programs are names of files with persistence landscapes on grid.\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_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp b/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
index 4f6f2f5a..056710ff 100644
--- a/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
+++ b/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.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 on grid 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 on grid.";
+ std::cout << "The parameters of this programs are names of files with persistence landscapes on grid.\n";
std::vector< const char* > filenames;
for ( int i = 1 ; i < argc ; ++i )
diff --git a/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp b/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
index 096f1036..2ac74eb3 100644
--- a/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
+++ b/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
@@ -39,7 +39,7 @@ 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::cout << "The remaining parameters are the names of files with persistence diagrams. \n";
if ( argc < 4 )
{
@@ -60,6 +60,7 @@ int main( int argc , char** argv )
std::cout << "Creating persistence landscapes...\n";
for ( size_t i = 0 ; i != filenames.size() ; ++i )
{
+ std::cout << "Creating persistence landscape on a grid based on a file : " << filenames[i] << std::endl;
Persistence_landscape_on_grid l;
if ( (min_ != -1) || (max_ != -1) )
{
@@ -71,7 +72,7 @@ int main( int argc , char** argv )
l = Persistence_landscape_on_grid( filenames[i] , size_of_grid );
}
std::stringstream ss;
- ss << filenames[i] << ".land";
+ ss << filenames[i] << ".g_land";
l.print_to_file( ss.str().c_str() );
}
std::cout << "Done \n";
diff --git a/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp b/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
index 21d2c014..54b8367b 100644
--- a/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
+++ b/src/Gudhi_stat/example/utilities/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
@@ -37,6 +37,11 @@ using namespace Gudhi::Gudhi_stat;
int main( int argc , char** argv )
{
std::cout << "This program plot persistence landscape on grid stored in a file (the file needs to be created beforehand). Please call the code with the name of a landsape on grid file \n";
+ if ( argc == 1 )
+ {
+ std::cout << "Wrong parameters of a program call, the program will now terminate \n";
+ return 1;
+ }
Persistence_landscape_on_grid l;
l.load_landscape_from_file( argv[1] );