Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ug::Polynomial1D Class Reference

#include <polynomial1d.h>

+ Inheritance diagram for ug::Polynomial1D:

Public Member Functions

size_t degree () const
 
Polynomial1D derivative () const
 returns the derivative of this polynomial as a polynomial
 
Polynomial1Doperator*= (const Polynomial1D &v)
 multiply by a polynomial
 
Polynomial1Doperator*= (number scale)
 multiply by a scalar
 
 Polynomial1D (const std::vector< number > &a)
 Constructor passing coefficients for the polynomial.
 
 Polynomial1D (size_t degree=0)
 Constructor producing zero polynomial of degree 'degree'.
 
number value (const number x) const
 evaluate the value of the polynom at x
 

Protected Member Functions

void set_coefficients (const std::vector< number > &a)
 

Private Attributes

std::vector< numberm_vCoeff
 

Friends

std::ostream & operator<< (std::ostream &outStream, Polynomial1D &v)
 

Detailed Description

base class for one dimensional polynomials This class is used to represent polynomials in one variable. For the evaluation the horner scheme is used. Note that using this representation the computation of higher order derivatives turns out easier than by hard coded implementations.

Constructor & Destructor Documentation

◆ Polynomial1D() [1/2]

ug::Polynomial1D::Polynomial1D ( size_t  degree = 0)
inline

Constructor producing zero polynomial of degree 'degree'.

◆ Polynomial1D() [2/2]

ug::Polynomial1D::Polynomial1D ( const std::vector< number > &  a)
inline

Constructor passing coefficients for the polynomial.

References m_vCoeff.

Member Function Documentation

◆ degree()

size_t ug::Polynomial1D::degree ( ) const
inline

returns the degree of the polynomial. This function returns the degree of the polynomial, i.e. the highest coefficient stored. Note that no checking is performed if the leading coefficient is zero.

References m_vCoeff.

Referenced by ug::BoundedEquidistantLagrange1D::BoundedEquidistantLagrange1D(), derivative(), ug::EquidistantLagrange1D::EquidistantLagrange1D(), operator*=(), operator*=(), ug::EquidistantLagrange1D::position(), ug::TruncatedEquidistantLagrange1D::position(), ug::BoundedEquidistantLagrange1D::position(), and ug::TruncatedEquidistantLagrange1D::TruncatedEquidistantLagrange1D().

◆ derivative()

Polynomial1D ug::Polynomial1D::derivative ( ) const
inline

returns the derivative of this polynomial as a polynomial

References degree(), and m_vCoeff.

◆ operator*=() [1/2]

Polynomial1D & ug::Polynomial1D::operator*= ( const Polynomial1D v)
inline

multiply by a polynomial

References degree(), and m_vCoeff.

◆ operator*=() [2/2]

Polynomial1D & ug::Polynomial1D::operator*= ( number  scale)
inline

multiply by a scalar

References degree(), and m_vCoeff.

◆ set_coefficients()

◆ value()

number ug::Polynomial1D::value ( const number  x) const
inline

evaluate the value of the polynom at x

References m_vCoeff.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  outStream,
Polynomial1D v 
)
friend

Member Data Documentation

◆ m_vCoeff

std::vector<number> ug::Polynomial1D::m_vCoeff
private

The documentation for this class was generated from the following file: