[PPL-devel] [GIT] ppl/ppl(master): Made ascii_load more restrictive.
Abramo Bagnara
abramo.bagnara at gmail.com
Tue Mar 31 22:37:25 CEST 2009
Module: ppl/ppl
Branch: master
Commit: 1826e6cd378ec51530b262c7f65a489b1341bdf8
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=1826e6cd378ec51530b262c7f65a489b1341bdf8
Author: Abramo Bagnara <abramo.bagnara at gmail.com>
Date: Tue Mar 31 20:18:44 2009 +0200
Made ascii_load more restrictive.
---
src/DB_Matrix.templates.hh | 5 ++---
src/OR_Matrix.templates.hh | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/DB_Matrix.templates.hh b/src/DB_Matrix.templates.hh
index e25a0e2..ba98212 100644
--- a/src/DB_Matrix.templates.hh
+++ b/src/DB_Matrix.templates.hh
@@ -232,9 +232,8 @@ DB_Matrix<T>::ascii_load(std::istream& s) {
DB_Matrix& x = *this;
for (dimension_type i = 0; i < nrows; ++i)
for (dimension_type j = 0; j < nrows; ++j) {
- Result r = input(x[i][j], s, ROUND_UP);
- // FIXME(0.10.1): V_CVT_STR_UNK is probably not the only possible error.
- if (!s || r == V_CVT_STR_UNK)
+ Result r = input(x[i][j], s, ROUND_CHECK);
+ if (r != V_EQ || is_minus_infinity(x[i][j]))
return false;
}
diff --git a/src/OR_Matrix.templates.hh b/src/OR_Matrix.templates.hh
index decf583..da03cda 100644
--- a/src/OR_Matrix.templates.hh
+++ b/src/OR_Matrix.templates.hh
@@ -92,9 +92,8 @@ OR_Matrix<T>::ascii_load(std::istream& s) {
row_reference_type r_i = *i;
const dimension_type rs = i.row_size();
for (dimension_type j = 0; j < rs; ++j) {
- Result r = input(r_i[j], s, ROUND_UP);
- // FIXME(0.10.1): V_CVT_STR_UNK is probably not the only possible error.
- if (!s || r == V_CVT_STR_UNK)
+ Result r = input(r_i[j], s, ROUND_CHECK);
+ if (r != V_EQ || is_minus_infinity(r_i[j]))
return false;
}
}
More information about the PPL-devel
mailing list