From: Guido Kanschat Date: Mon, 7 Sep 2009 16:40:50 +0000 (+0000) Subject: add a constructor for a zero polynomial of degree n X-Git-Tag: v8.0.0~7165 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e33419feb046eb01bf6e6ab18ddcd21f7fd08561;p=dealii.git add a constructor for a zero polynomial of degree n git-svn-id: https://svn.dealii.org/trunk@19408 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/polynomial.h b/deal.II/base/include/base/polynomial.h index 0dfaf086c6..330a6c411f 100644 --- a/deal.II/base/include/base/polynomial.h +++ b/deal.II/base/include/base/polynomial.h @@ -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 class Polynomial : public Subscriptor @@ -68,6 +68,12 @@ namespace Polynomials */ Polynomial (const std::vector &coefficients); + /** + * Constructor creating a zero + * polynomial of degree @p n. + */ + Polynomial (const unsigned int n); + /** * Default constructor creating * an illegal object. diff --git a/deal.II/base/source/polynomial.cc b/deal.II/base/source/polynomial.cc index a460dc75be..df38a18697 100644 --- a/deal.II/base/source/polynomial.cc +++ b/deal.II/base/source/polynomial.cc @@ -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 + Polynomial::Polynomial (const unsigned int n) + : + coefficients(n+1, 0.) + {} + + + template void Polynomial::value (const number x,