summaryrefslogtreecommitdiff
path: root/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp')
-rw-r--r--src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
index e95bf8ad..01de3dee 100644
--- a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
+++ b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
@@ -29,9 +29,15 @@
using Persistence_landscape_on_grid = Gudhi::Persistence_representations::Persistence_landscape_on_grid;
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.\n";
+ std::cout
+ << "This program computes scalar product of persistence landscapes on grid stored in a file (the file needs to "
+ << "be created beforehand). \n"
+ << "The parameters of this programs are names of files with persistence landscapes on grid.\n";
+
+ if (argc < 3) {
+ std::cout << "Wrong number of parameters, the program will now terminate \n";
+ return 1;
+ }
std::vector<const char*> filenames;
for (int i = 1; i < argc; ++i) {
@@ -63,7 +69,7 @@ int main(int argc, char** argv) {
// and now output the result to the screen and a file:
std::ofstream out;
- out.open("scalar_product");
+ out.open("scalar_product.g_land");
for (size_t i = 0; i != scalar_product.size(); ++i) {
for (size_t j = 0; j != scalar_product.size(); ++j) {
std::cout << scalar_product[i][j] << " ";
@@ -74,5 +80,6 @@ int main(int argc, char** argv) {
}
out.close();
+ std::cout << "Distance can be found in 'scalar_product.g_land' file\n";
return 0;
}