]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
output function
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 9 Jul 2002 06:33:42 +0000 (06:33 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 9 Jul 2002 06:33:42 +0000 (06:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@6232 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/polynomial.h
deal.II/base/source/polynomial.cc

index 7b3c298cb5088e5a5d77558b70f08c0753b5953c..7e91cf8848c58c264a919002aab85b6bf1f4bef1 100644 (file)
@@ -135,7 +135,12 @@ class Polynomial : public Subscriptor
                                      */
     template <typename number2>
     void shift (const number2 offset);
-    
+
+                                    /**
+                                     * Print coefficients.
+                                     */
+    void print(std::ostream& out) const;
+                                     
                                     /**
                                      * Exception
                                      */
index cb93b56208d09e7adc89ddc584d6cb0947d9c02b..4ab8f8bc816b5a108e7fb29c1b79e2af31526965 100644 (file)
@@ -194,6 +194,16 @@ Polynomial<number>::shift(const number2 offset)
 }
 
 
+template <typename number>
+void
+Polynomial<number>::print(std::ostream& out) const
+{
+  for (int i=degree();i>=0;--i)
+    {
+      out << coefficients[i] << " x^" << i << std::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.