From ac1af387c5af82bbe0dca0a23cbbfab9aec94892 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Mon, 18 Dec 2000 14:28:55 +0000 Subject: [PATCH] show_transform yields good results again git-svn-id: https://svn.dealii.org/trunk@3559 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/polynomial.h | 34 +++++++++++++++++--------- deal.II/base/source/polynomial.cc | 14 +++++++++++ 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/deal.II/base/include/base/polynomial.h b/deal.II/base/include/base/polynomial.h index da6040d3c6..2ec43d9dff 100644 --- a/deal.II/base/include/base/polynomial.h +++ b/deal.II/base/include/base/polynomial.h @@ -49,6 +49,11 @@ class Polynomial : public Subscriptor */ Polynomial (const vector &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 diff --git a/deal.II/base/source/polynomial.cc b/deal.II/base/source/polynomial.cc index 74bc8b2cf4..110b448605 100644 --- a/deal.II/base/source/polynomial.cc +++ b/deal.II/base/source/polynomial.cc @@ -21,8 +21,16 @@ Polynomial::Polynomial (const vector &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 &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 LagrangeEquidistant::compute_coefficients (const unsigned int n, const unsigned int support_point) -- 2.39.5