From 8db4a6aa6e7c1f0584d35607d79ddaa46bdc070b Mon Sep 17 00:00:00 2001 From: Ralf Hartmann Date: Mon, 18 Dec 2000 13:37:02 +0000 Subject: [PATCH] Fix bug. git-svn-id: https://svn.dealii.org/trunk@3557 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/source/polynomial.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/deal.II/base/source/polynomial.cc b/deal.II/base/source/polynomial.cc index d55a8a8629..74bc8b2cf4 100644 --- a/deal.II/base/source/polynomial.cc +++ b/deal.II/base/source/polynomial.cc @@ -39,8 +39,9 @@ void Polynomial::value (const double x, vector &values) const { Assert (values.size() > 0, ExcEmptyArray()); - const unsigned int m=coefficients.size(); - + const unsigned int values_size=values.size(); + + // if we only need the value, then // call the other function since // that is significantly faster @@ -48,7 +49,7 @@ void Polynomial::value (const double x, // and free memory, which is really // expensive compared to all the // other operations!) - if (m == 1) + if (values_size == 1) { values[0] = value(x); return; @@ -57,9 +58,10 @@ void Polynomial::value (const double x, // if there are derivatives needed, // then do it properly by the // full Horner scheme + const unsigned int m=coefficients.size(); vector a(coefficients); unsigned int j_faculty=1; - for (unsigned int j=0; j=static_cast(j); --k) a[k]+=x*a[k+1]; -- 2.39.5