]> https://gitweb.dealii.org/ - dealii.git/commitdiff
show_transform yields good results again
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 18 Dec 2000 14:28:55 +0000 (14:28 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 18 Dec 2000 14:28:55 +0000 (14:28 +0000)
git-svn-id: https://svn.dealii.org/trunk@3559 0785d39b-7218-0410-832d-ea1e28bc413d

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

index da6040d3c6c9cedbc71c6b7e6f8f65a158291130..2ec43d9dff90e97efe0ef4f76a134b297389cd4d 100644 (file)
@@ -49,6 +49,11 @@ class Polynomial : public Subscriptor
                                      */
     Polynomial (const vector<double> &coefficients);
 
+                                     /**
+                                     * Default-Constructor.
+                                     */
+    Polynomial ();
+    
                                     /**
                                      * Return the value of this
                                      * polynomial at the given point.
@@ -83,6 +88,11 @@ class Polynomial : public Subscriptor
                                      */
     DeclException0 (ExcEmptyArray);
     
+                                    /**
+                                     * Exception
+                                     */
+    DeclException0 (ExcVoidPolynomial);
+    
   protected:
 
                                     /**
@@ -99,14 +109,14 @@ class Polynomial : public Subscriptor
 
 
 /**
- * Class of Lagrange polynomials with equidistant interpolation
- * points. The polynomial of order @p{n} has got @p{n+1} interpolation
+ * Lagrange polynomials with equidistant interpolation
+ * points in [0,1]. The polynomial of degree @p{n} has got @p{n+1} interpolation
  * points. The interpolation points are sorted in ascending
  * order. This order gives an index to each interpolation point.  A
- * Lagrangian polynomial equals 1 at one interpolation point that is
- * then called `support point', and 0 at all other interpolation
- * points. For example, if the order is 3, and the support point is 1,
- * then the polynomial represented by this object is of cubic and its
+ * Lagrangian polynomial equals to 1 at its `support point',
+ * and 0 at all other interpolation
+ * points. For example, if the degree is 3, and the support point is 1,
+ * then the polynomial represented by this object is cubic and its
  * value is 1 at the point @p{x=1/3}, and zero at the point @p{x=0},
  * @p{x=2/3}, and @p{x=1}.
  *
@@ -127,6 +137,12 @@ class LagrangeEquidistant: public Polynomial
     LagrangeEquidistant (const unsigned int n,
                         const unsigned int support_point);
 
+                                     /**
+                                     * Default-constructor.
+                                     */
+    LagrangeEquidistant ();
+    
+
                                     /**
                                      * Exception
                                      */
@@ -142,11 +158,7 @@ class LagrangeEquidistant: public Polynomial
                                      * @p{Polynomial}. This function
                                      * is @p{static} to allow to be
                                      * called in the
-                                     * constructor. This in turn
-                                     * enables us to have the
-                                     * @p{coefficients} of the base
-                                     * class to be a @p{const}
-                                     * vector.
+                                     * constructor.
                                      */
     static 
     vector<double> 
index 74bc8b2cf452b246cfa4ba4a7cbbb84374fb86f8..110b4486056522c5a878607162b9fa32d1d32f52 100644 (file)
@@ -21,8 +21,16 @@ Polynomial::Polynomial (const vector<double> &a):
 
 
 
+Polynomial::Polynomial ()
+  :
+  coefficients(0)
+{}
+
+
+
 double Polynomial::value (const double x) const
 {
+  Assert (coefficients.size() > 0, ExcVoidPolynomial());
   const unsigned int m=coefficients.size();
 
                                   // Horner scheme
@@ -38,6 +46,7 @@ double Polynomial::value (const double x) const
 void Polynomial::value (const double    x,
                        vector<double> &values) const
 {
+  Assert (coefficients.size() > 0, ExcVoidPolynomial());
   Assert (values.size() > 0, ExcEmptyArray());
   const unsigned int values_size=values.size();
   
@@ -83,6 +92,11 @@ LagrangeEquidistant::LagrangeEquidistant (const unsigned int n,
 
 
 
+LagrangeEquidistant::LagrangeEquidistant ()
+{}
+
+
+
 vector<double> 
 LagrangeEquidistant::compute_coefficients (const unsigned int n,
                                           const unsigned int support_point)

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.