]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bugfix: Compile fixes for Functions::Polynomial<dim> 1075/head
authorMatthias Maier <tamiko@43-1.org>
Fri, 3 Jul 2015 14:55:37 +0000 (16:55 +0200)
committerMatthias Maier <tamiko@43-1.org>
Fri, 3 Jul 2015 14:55:37 +0000 (16:55 +0200)
Change dealii::Vector to std::vector to not have to include vector.h in
function_lib.h. This fixes a compilation error encountered with several
compilers.

Further, fix the corresponding test

include/deal.II/base/function_lib.h
source/base/function_lib.cc
tests/base/functions_12.cc

index 4c023a689d0e77e61dc26ba37626a97ad56fad7b..f0351c62bf2a202eec2e59cea0f3f8629314df17 100644 (file)
@@ -1280,8 +1280,8 @@ namespace Functions
      * $a_{i}\prod_{d=1}^{dim} x_{d}^{\alpha_{i,d}}$. The i-th element of the coefficients
      * vector contains the coefficient $a_{i}$ for the i-th monomial.
      */
-    Polynomial (const Table<2,double> &exponents,
-                const Vector<double>   &coefficients);
+    Polynomial (const Table<2,double>     &exponents,
+                const std::vector<double> &coefficients);
 
     /**
      * Function value at one point.
@@ -1313,7 +1313,7 @@ namespace Functions
     /**
      * The set of coefficients.
      */
-    const Vector<double> coefficients;
+    const std::vector<double> coefficients;
   };
 
 
index 3553ad153f5abf2729b1b7506203e5b1682e31c6..20fcd3f331dbdd268b1c2ab62862d99a55a5a03c 100644 (file)
@@ -2489,8 +2489,8 @@ namespace Functions
 
   template <int dim>
   Polynomial<dim>::
-  Polynomial(const Table<2,double> &exponents,
-             const Vector<double>   &coefficients)
+  Polynomial(const Table<2,double>     &exponents,
+             const std::vector<double> &coefficients)
     :
     Function<dim> (1),
     exponents (exponents),
index 8c19144441aba972d97aaf5ddf656cc176edf575..8cfbcf1f9e4c9389bfb34e2184289a9e1cbf5158 100644 (file)
@@ -30,12 +30,11 @@ void check()
     for (unsigned int d = 0; d < dim; ++d)
       exponents[i][d] = i + d;
 
-  Vector<double> coeffs(n_mon);
+  std::vector<double> coeffs(n_mon);
   for (unsigned int i = 0; i < n_mon; ++i)
     coeffs[i] = std::pow(-1,i)*(i+1);
 
-
-  CustomFunctions::Polynomial<dim> poly(exponents,coeffs);
+  Functions::Polynomial<dim> poly(exponents, coeffs);
 
   Point<dim> p;
   for (unsigned int d=0; d<dim; ++d)

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.