summaryrefslogtreecommitdiff
path: root/src/Persistence_representations/include/gudhi/read_persistence_from_file.h
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-05-31 06:20:04 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-05-31 06:20:04 +0000
commit3a76dcb9f49671b01ae200a13569f47fca57dac0 (patch)
treebafbf8bed128e735682de744640ff4068518038e /src/Persistence_representations/include/gudhi/read_persistence_from_file.h
parent93ee566f6ccdaed6bd00e53a3828dd09a97914e8 (diff)
Fix cpplint and cppcheck
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/persistence_representation_integration@2480 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 9ad6fc7b096fff02a8696515c074ddd92980a8e2
Diffstat (limited to 'src/Persistence_representations/include/gudhi/read_persistence_from_file.h')
-rw-r--r--src/Persistence_representations/include/gudhi/read_persistence_from_file.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Persistence_representations/include/gudhi/read_persistence_from_file.h b/src/Persistence_representations/include/gudhi/read_persistence_from_file.h
index a5c2b286..ad3d4e83 100644
--- a/src/Persistence_representations/include/gudhi/read_persistence_from_file.h
+++ b/src/Persistence_representations/include/gudhi/read_persistence_from_file.h
@@ -28,6 +28,8 @@
#include <sstream>
#include <vector>
#include <algorithm>
+#include <string>
+#include <utility>
namespace Gudhi {
namespace Persistence_representations {
@@ -54,7 +56,7 @@ std::vector<std::pair<double, double> > read_persistence_intervals_in_one_dimens
// checking if the file exist:
if (!in.good()) {
std::cerr << "The file : " << filename << " do not exist. The program will now terminate \n";
- throw "The file from which you are trying to read the persistence landscape do not exist. The program will now terminate \n";
+ throw "The persistence landscape file do not exist. The program will now terminate \n";
}
std::string line;
@@ -85,7 +87,7 @@ std::vector<std::pair<double, double> > read_persistence_intervals_in_one_dimens
while (ss >> number) {
this_line.push_back(number);
}
- number_of_entries_per_line += (int)this_line.size();
+ number_of_entries_per_line += static_cast<int>(this_line.size());
if (dbg) {
std::cerr << "number_of_entries_per_line : " << number_of_entries_per_line
<< ". This number was obtained by analyzing this line : " << line << std::endl;
@@ -93,7 +95,7 @@ std::vector<std::pair<double, double> > read_persistence_intervals_in_one_dimens
if ((number_of_entries_per_line < 2) || (number_of_entries_per_line > 4)) {
std::cerr << "The input file you have provided have wrong number of numerical entries per line. The program "
"will now terminate. \n";
- throw "The input file you have provided have wrong number of numerical entries per line. The program will now terminate. \n";
+ throw "Wrong number of numerical entries per line in the input file. The program will now terminate. \n";
}
}
// In case there is an 'inf' string in this line, we are dealing with this situation in below.