]> https://gitweb.dealii.org/ - dealii.git/commitdiff
extra argument for formatting
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 16 May 2000 14:22:42 +0000 (14:22 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 16 May 2000 14:22:42 +0000 (14:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@2870 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/sparse_matrix.h
deal.II/lac/include/lac/sparse_matrix.templates.h

index c2258cc8d74db8ebf6c2a9bc8f9ffa55d9510834..e4cd14b2f724ec60c07ba3e52fbe9482df43e00e 100644 (file)
@@ -589,6 +589,12 @@ class SparseMatrix : public Subscriptor
                                      * an empty value may be
                                      * specified.
                                      *
+                                     * Finally, the whole matrix can
+                                     * be multiplied with a common
+                                     * denominator to produce more
+                                     * readable output, even
+                                     * integers.
+                                     *
                                      * This function
                                      * may produce {\bf large} amounts of
                                      * output if applied to a large matrix!
@@ -598,7 +604,8 @@ class SparseMatrix : public Subscriptor
                          const unsigned int presicion=3,
                          bool scientific=true,
                          unsigned int width=0,
-                         const char * zero_string = " ") const;
+                         const char * zero_string = " ",
+                         const double denominator = 1.) const;
     
                                     /**
                                      * Exception
index e11a1193e24b881b8b630ea82f1ae6b907b36140..2268ff33b93c9fec813f155be7387fc2feab5636 100644 (file)
@@ -920,7 +920,8 @@ void SparseMatrix<number>::print_formatted (ostream &out,
                                            const unsigned int precision,
                                            bool scientific,
                                            unsigned int width,
-                                           const char* zero_string) const
+                                           const char* zero_string,
+                                           const double denominator) const
 {
   Assert (cols != 0, ExcMatrixNotInitialized());
   Assert (val != 0, ExcMatrixNotInitialized());
@@ -942,7 +943,7 @@ void SparseMatrix<number>::print_formatted (ostream &out,
       for (unsigned int j=0; j<n(); ++j)
        if ((*cols)(i,j) != SparsityPattern::invalid_entry)
          out << setw(width)
-             << val[cols->operator()(i,j)] << ' ';
+             << val[cols->operator()(i,j)] * denominator << ' ';
        else
          out << setw(width) << zero_string << ' ';
       out << 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.