]> https://gitweb.dealii.org/ - dealii.git/commitdiff
print in dFMatrix fuer streams
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 17 Aug 1998 09:20:10 +0000 (09:20 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 17 Aug 1998 09:20:10 +0000 (09:20 +0000)
git-svn-id: https://svn.dealii.org/trunk@498 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/dfmatrix.h
deal.II/lac/source/dfmatrix.cc

index 104513ee17a37feb2256d0e768069e42341c67e6..b0268a65e1c148cb48e76919ca3c6cf7c8acf3b6 100644 (file)
@@ -400,7 +400,7 @@ class dFMatrix
                                     /**
                                      * Output of the matrix in user-defined format.
                                      */
-    void print (FILE* fp, const char* format = 0) const;
+    void print (ostream& s, int width=5, int precision=2) const;
 
                                     /**
                                      * Print the matrix in the usual format,
index 34b785541abdacc202835cf2ab164090ff0f4b53..f90ee9eec4334e3d0cfca5ebc0209835b5b6f273 100644 (file)
@@ -624,14 +624,13 @@ double dFMatrix::matrix_scalar_product (const dVector &u, const dVector &v) cons
 
 
 
-void dFMatrix::print (FILE* f, const char* format) const
+void dFMatrix::print (ostream& s, int w, int p) const
 {
-  if (!format) format = " %5.2f";
   unsigned int i,j;
   for (i=0;i<m();i++)
     {
-      for (j=0;j<n();j++) fprintf(f, format, el(i,j));
-      fprintf(f, "\n");
+      for (j=0;j<n();j++) s << setw(w) << setprecision(p) << el(i,j);
+      s << endl;
     }
 }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.