summaryrefslogtreecommitdiff
path: root/src/Persistence_representations/include/gudhi/Persistence_intervals.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Persistence_representations/include/gudhi/Persistence_intervals.h')
-rw-r--r--src/Persistence_representations/include/gudhi/Persistence_intervals.h17
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";