16 #ifndef dealii__polynomial_h 17 #define dealii__polynomial_h 21 #include <deal.II/base/config.h> 22 #include <deal.II/base/exceptions.h> 23 #include <deal.II/base/subscriptor.h> 24 #include <deal.II/base/point.h> 25 #include <deal.II/base/std_cxx11/shared_ptr.h> 29 DEAL_II_NAMESPACE_OPEN
61 template <
typename number>
88 const unsigned int evaluation_point);
102 number
value (
const number x)
const;
114 void value (
const number x,
115 std::vector<number> &values)
const;
128 void value (
const number x,
129 const unsigned int n_derivatives,
130 number *values)
const;
137 unsigned int degree ()
const;
146 void scale (
const number factor);
163 template <
typename number2>
164 void shift (
const number2 offset);
205 void print(std::ostream &out)
const;
211 template <
class Archive>
212 void serialize (Archive &ar,
const unsigned int version);
220 const number factor);
225 template <
typename number2>
227 const number2
shift);
233 const number factor);
278 template <
typename number>
287 const double coefficient = 1.);
296 std::vector<Polynomial<number> >
303 static std::vector<number>
make_vector(
unsigned int n,
304 const double coefficient);
334 const unsigned int support_point);
345 std::vector<Polynomial<double> >
357 const unsigned int support_point,
358 std::vector<double> &a);
369 std::vector<Polynomial<double> >
404 std::vector<Polynomial<double> >
436 Lobatto (
const unsigned int p = 0);
442 static std::vector<Polynomial<double> >
513 std::vector<Polynomial<double> >
526 static const std::vector<double> &
585 static std::vector<Polynomial<double> >
597 template <
typename number>
601 in_lagrange_product_form (false),
607 template <
typename number>
612 if (in_lagrange_product_form ==
true)
614 return lagrange_support_points.size();
619 return coefficients.size() - 1;
625 template <
typename number>
630 if (in_lagrange_product_form ==
false)
635 const unsigned int m=coefficients.size();
636 number value = coefficients.back();
637 for (
int k=m-2; k>=0; --k)
638 value = value*x + coefficients[k];
644 const unsigned int m = lagrange_support_points.size();
646 for (
unsigned int j=0; j<m; ++j)
647 value *= x-lagrange_support_points[j];
648 value *= lagrange_weight;
655 template <
typename number>
656 template <
class Archive>
664 ar &in_lagrange_product_form;
665 ar &lagrange_support_points;
670 DEAL_II_NAMESPACE_CLOSE
void serialize(Archive &ar, const unsigned int version)
Polynomial< number > & operator*=(const double s)
void scale(const number factor)
void transform_into_standard_form()
bool operator==(const Polynomial< number > &p) const
LagrangeEquidistant(const unsigned int n, const unsigned int support_point)
Polynomial< number > derivative() const
void shift(const number2 offset)
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int p)
unsigned int degree() const
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int degree)
Legendre(const unsigned int p)
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int degree)
Polynomial< number > & operator-=(const Polynomial< number > &p)
std::vector< Polynomial< double > > generate_complete_Lagrange_basis(const std::vector< Point< 1 > > &points)
static void compute_coefficients(const unsigned int n, const unsigned int support_point, std::vector< double > &a)
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int degree)
Monomial(const unsigned int n, const double coefficient=1.)
bool in_lagrange_product_form
number value(const number x) const
void print(std::ostream &out) const
std::vector< double > compute_coefficients(const unsigned int p)
static void multiply(std::vector< number > &coefficients, const number factor)
#define Assert(cond, exc)
Polynomial< number > & operator+=(const Polynomial< number > &p)
HermiteInterpolation(const unsigned int p)
Lobatto(const unsigned int p=0)
static std::vector< Polynomial< number > > generate_complete_basis(const unsigned int degree)
static std::vector< number > make_vector(unsigned int n, const double coefficient)
Hierarchical(const unsigned int p)
std::vector< number > coefficients
Polynomial< number > primitive() const
static void compute_coefficients(const unsigned int p)
static const std::vector< double > & get_coefficients(const unsigned int p)
std::vector< number > lagrange_support_points
static ::ExceptionBase & ExcEmptyObject()
static std::vector< std_cxx11::shared_ptr< const std::vector< double > > > recursive_coefficients
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int p)