[PPL-devel] [GIT] ppl/ppl(floating_point): Added a proposed implementation for ascii_dump()

Fabio Bossi bossi at cs.unipr.it
Thu Dec 2 13:34:32 CET 2010


Module: ppl/ppl
Branch: floating_point
Commit: 31db7495cb05e632726d12b881a4d7ed5b062a7a
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=31db7495cb05e632726d12b881a4d7ed5b062a7a

Author: Fabio Bossi <bossi at cs.unipr.it>
Date:   Thu Dec  2 12:18:22 2010 +0100

Added a proposed implementation for ascii_dump()
and ascii_load().

---

 src/Linear_Form.inlines.hh |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/src/Linear_Form.inlines.hh b/src/Linear_Form.inlines.hh
index 43ca4e6..f799fc4 100644
--- a/src/Linear_Form.inlines.hh
+++ b/src/Linear_Form.inlines.hh
@@ -194,13 +194,36 @@ Linear_Form<C>::swap(Linear_Form& y) {
 template <typename C>
 inline void
 Linear_Form<C>::ascii_dump(std::ostream& s) const {
-  // FIXME: to be written.
+  // FIXME: the following commented code does not compile.
+  /*
+  using namespace IO_Operators;
+  const char separator = ' ';
+  dimension_type space = space_dimension();
+  s << space << "\n";
+  for (int i = 0; i <= space; ++i)
+    s << vec[i] << separator;
+  s << "\n";
+  */
 }
 
 template <typename C>
 inline bool
 Linear_Form<C>::ascii_load(std::istream& s) {
-  // FIXME: to be written.
+  // FIXME: the following commented code does not compile.
+  /*
+  using namespace IO_Operators;
+  dimension_type new_dim;
+  if (!(s >> new_dim))
+    return false;
+  vec.resize(new_dim + 1, zero);
+  for (int i = 0; i <= new_dim; ++i) {
+    if (!(s >> vec[i]))
+      return false;
+  }
+
+  PPL_ASSERT(OK());
+  return true;
+  */
   return false;
 }
 




More information about the PPL-devel mailing list