]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix small bug in the Horner scheme that produced wrong results only very scarce.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Wed, 10 Jan 2001 17:04:43 +0000 (17:04 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Wed, 10 Jan 2001 17:04:43 +0000 (17:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@3634 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/polynomial.cc

index 110b4486056522c5a878607162b9fa32d1d32f52..419ebe72bef980c23901033eef68726ef0bac5e3 100644 (file)
@@ -2,7 +2,7 @@
 //      $Id$   
 //    Version: $Name$
 //
-//    Copyright (C) 2000 by the deal.II authors
+//    Copyright (C) 2000, 2001 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -72,7 +72,7 @@ void Polynomial::value (const double    x,
   unsigned int j_faculty=1;
   for (unsigned int j=0; j<values_size; ++j)
     {      
-      for (int k=m-1; k>=static_cast<int>(j); --k)
+      for (int k=m-2; k>=static_cast<int>(j); --k)
        a[k]+=x*a[k+1];
       values[j]=j_faculty*a[j];
 

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.