]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add a constructor for a zero polynomial of degree n
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 7 Sep 2009 16:40:50 +0000 (16:40 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 7 Sep 2009 16:40:50 +0000 (16:40 +0000)
git-svn-id: https://svn.dealii.org/trunk@19408 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 0dfaf086c6b9c5c841d2ac68b9b266b22431a8a1..330a6c411fcc4010a4f00ea002d9172392e43814 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -43,7 +43,7 @@ namespace Polynomials
  * happens through the Horner scheme which provides both numerical
  * stability and a minimal number of numerical operations.
  *
- * @author Ralf Hartmann, Guido Kanschat, 2000, 2006
+ * @author Ralf Hartmann, Guido Kanschat, 2000, 2006, 2009
  */
   template <typename number>
   class Polynomial : public Subscriptor
@@ -68,6 +68,12 @@ namespace Polynomials
                                         */
       Polynomial (const std::vector<number> &coefficients);
 
+                                      /**
+                                       * Constructor creating a zero
+                                       * polynomial of degree @p n.
+                                       */
+      Polynomial (const unsigned int n);
+      
                                       /**
                                        * Default constructor creating
                                        * an illegal object.
index a460dc75be1b13a2488bce062c81a76eec66ca68..df38a18697f194c651238dcf6e6db64d4b83f7c2 100644 (file)
@@ -2,7 +2,7 @@
 //      $Id$   
 //    Version: $Name$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -52,6 +52,14 @@ namespace Polynomials
 
 
 
+  template <typename number>
+  Polynomial<number>::Polynomial (const unsigned int n)
+                  :
+                  coefficients(n+1, 0.)
+  {}
+
+
+
   template <typename number>
   void
   Polynomial<number>::value (const number         x,

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.