]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
complete basis of monomials
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 18 Dec 2003 10:02:17 +0000 (10:02 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 18 Dec 2003 10:02:17 +0000 (10:02 +0000)
git-svn-id: https://svn.dealii.org/trunk@8273 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/polynomial.h
deal.II/base/source/polynomial.cc

index 12b0983f6c1dc3d2518ceab348153a1ddeab04cf..5d6312aed4f000674d9f55ac3b2f74f639fbee7e 100644 (file)
@@ -246,6 +246,22 @@ namespace Polynomials
       Monomial(const unsigned int n,
               const double coefficient = 1.);
 
+                                       /**
+                                        * Return a vector of Monomial
+                                        * objects of orders zero
+                                        * through @p{degree}, which
+                                        * then spans the full space of
+                                        * polynomials up to the given
+                                        * degree. This function may be
+                                        * used to initialize the
+                                        * @ref{TensorProductPolynomials}
+                                        * and @ref{PolynomialSpace}
+                                        * classes.
+                                        */
+      static
+      std::vector<Polynomial<number> >
+      generate_complete_basis (const unsigned int degree);
+    
     private:
                                       /**
                                        * Needed by constructor.
index c6b4854c8d6eb1ce697d9283448d5e7c2b9092cf..5f1461512ca8489b01136e073db213c4ca80cace 100644 (file)
@@ -324,6 +324,16 @@ namespace Polynomials
   {}
   
   
+  template <typename number>
+  std::vector<Polynomial<number> >
+  Monomial<number>::generate_complete_basis (const unsigned int degree)
+  {
+    std::vector<Polynomial<number> > v;
+    v.reserve(degree+1);
+    for (unsigned int i=0; i<=degree; ++i)
+      v.push_back (Monomial<number>(i));
+    return v;
+  }
 // ------------------ class LagrangeEquidistant --------------- //
 
   LagrangeEquidistant::LagrangeEquidistant (const unsigned int n,

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.