diff options
author | mcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-02-15 16:41:04 +0000 |
---|---|---|
committer | mcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-02-15 16:41:04 +0000 |
commit | 69c683e663329d8410ca77c371f877bcc3bef906 (patch) | |
tree | fb18c914cf4056881b2b31875eb6b44e5ce23895 /src/Persistence_representations/include/gudhi/Persistence_intervals.h | |
parent | be131d6f74a9264e15a0b1c1e72fa8967c4518bd (diff) | |
parent | 265484997185f3bf900744406206a2d64ca0a20d (diff) |
integrated kernel code in pers_representation branch
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/kernels@3249 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 58e77263a0da3674e4699cef832b6d357dcf12e2
Diffstat (limited to 'src/Persistence_representations/include/gudhi/Persistence_intervals.h')
-rw-r--r-- | src/Persistence_representations/include/gudhi/Persistence_intervals.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/Persistence_representations/include/gudhi/Persistence_intervals.h b/src/Persistence_representations/include/gudhi/Persistence_intervals.h index 525d58a3..3d04d8b7 100644 --- a/src/Persistence_representations/include/gudhi/Persistence_intervals.h +++ b/src/Persistence_representations/include/gudhi/Persistence_intervals.h @@ -167,10 +167,10 @@ class Persistence_intervals { // this program create a gnuplot script file that allows to plot persistence diagram. std::ofstream out; - std::ostringstream nameSS; - nameSS << filename << "_GnuplotScript"; - std::string nameStr = nameSS.str(); - out.open(nameStr); + std::stringstream gnuplot_script; + gnuplot_script << filename << "_GnuplotScript"; + + out.open(gnuplot_script.str().c_str()); std::pair<double, double> min_max_values = this->get_x_range(); if (min_x == max_x) { @@ -195,8 +195,8 @@ class Persistence_intervals { out.close(); - std::cout << "Gnuplot script to visualize persistence diagram written to the file: " << nameStr << ". Type load '" - << nameStr << "' in gnuplot to visualize." << std::endl; + std::cout << "To visualize, install gnuplot and type the command: gnuplot -persist -e \"load \'" + << gnuplot_script.str().c_str() << "\'\"" << std::endl; } /** @@ -402,9 +402,8 @@ std::vector<double> Persistence_intervals::characteristic_function_of_diagram(do } for (size_t pos = beginIt; pos != endIt; ++pos) { - result[pos] += - ((x_max - x_min) / static_cast<double>(number_of_bins)) * - (this->intervals[i].second - this->intervals[i].first); + result[pos] += ((x_max - x_min) / static_cast<double>(number_of_bins)) * + (this->intervals[i].second - this->intervals[i].first); } if (dbg) { std::cerr << "Result at this stage \n"; |