]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Small change for optimisation.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Fri, 4 May 2001 12:50:14 +0000 (12:50 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Fri, 4 May 2001 12:50:14 +0000 (12:50 +0000)
git-svn-id: https://svn.dealii.org/trunk@4541 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/polynomial.cc

index df160e31619b571482385d1e82cb57ff37d87476..cdbd297222ffd47cf93651fe884b9ecb927170ef 100644 (file)
@@ -83,7 +83,8 @@ Polynomial<number>::value (const number         x,
                                   // differentiate the polynomial
                                   // more often than the highest
                                   // power is
-  for (unsigned int j=0; j<std::min(values_size, m); ++j)
+  const unsigned int min_valuessize_m=std::min(values_size, m);
+  for (unsigned int j=0; j<min_valuessize_m; ++j)
     {
       for (int k=m-2; k>=static_cast<int>(j); --k)
        a[k]+=x*a[k+1];
@@ -93,7 +94,7 @@ Polynomial<number>::value (const number         x,
     }
 
                                   // fill higher derivatives by zero
-  for (unsigned int j=std::min(values_size,m); j<values_size; ++j)
+  for (unsigned int j=min_valuessize_m; j<values_size; ++j)
     values[j] = 0;
 }
 

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.