library of assembled shared sources

http://lass.cocamware.com

lass::num::Polynomial< T > Class Template Reference

an univariate polynomial. More...

#include <polynomial.h>


Public Types

typedef Polynomial< T > TSelf
typedef NumTraits< T > TNumTraits
typedef util::CallTraits< T >
::TValue 
TValue
typedef util::CallTraits< T >
::TParam 
TParam
typedef util::CallTraits< T >
::TReference 
TReference
typedef util::CallTraits< T >
::TConstReference 
TConstReference
typedef std::vector< TValueTCoefficients
typedef TCoefficients::size_type size_type
typedef
TCoefficients::const_iterator 
const_iterator

Public Member Functions

 Polynomial ()
 Polynomial (TParam iScalar)
 Polynomial (const TCoefficients &iCoefficients)
template<typename InputIterator >
 Polynomial (InputIterator iBegin, InputIterator iEnd)
const TCoefficientscoefficients () const
const TValue operator[] (size_t iIndex) const
const TValue at (size_t iIndex) const
const TValue operator() (TParam iX) const
const Polynomial< T > & operator+ () const
const Polynomial< T > operator- () const
Polynomial< T > & operator+= (const Polynomial< T > &iOther)
Polynomial< T > & operator-= (const Polynomial< T > &iOther)
Polynomial< T > & operator*= (const Polynomial< T > &iOther)
Polynomial< T > & operator+= (TParam iScalar)
Polynomial< T > & operator-= (TParam iScalar)
Polynomial< T > & operator*= (TParam iScalar)
Polynomial< T > & operator/= (TParam iScalar)
Polynomial< T > derivative () const
Polynomial< T > integral () const
Polynomial< T > pow (unsigned iPower) const
const size_type size () const
 return size of coefficients.
const const_iterator begin () const
 return iterator to first (lowest) coefficient
const const_iterator end () const
 return iterator to last (highest) coefficient

Static Public Member Functions

static Polynomial< T > one ()
 return constant polynomial 1
static Polynomial< T > x ()
 return linear polynomial x

Private Attributes

TCoefficients a_


Detailed Description

template<typename T>
class lass::num::Polynomial< T >

an univariate polynomial.

Author:
Bram de Greve [BdG]
A polynomial is a mathematical expression involving a sum of powers in one or more variables multiplied by coefficients., Eric W. Weisstein. "Polynomial." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Polynomial.html

Definition at line 67 of file polynomial.h.


Member Typedef Documentation

template<typename T >
typedef Polynomial<T> lass::num::Polynomial< T >::TSelf

Definition at line 71 of file polynomial.h.

template<typename T >
typedef NumTraits<T> lass::num::Polynomial< T >::TNumTraits

Definition at line 72 of file polynomial.h.

template<typename T >
typedef util::CallTraits<T>::TValue lass::num::Polynomial< T >::TValue

Definition at line 73 of file polynomial.h.

template<typename T >
typedef util::CallTraits<T>::TParam lass::num::Polynomial< T >::TParam

Definition at line 74 of file polynomial.h.

template<typename T >
typedef util::CallTraits<T>::TReference lass::num::Polynomial< T >::TReference

Definition at line 75 of file polynomial.h.

template<typename T >
typedef util::CallTraits<T>::TConstReference lass::num::Polynomial< T >::TConstReference

Definition at line 76 of file polynomial.h.

template<typename T >
typedef std::vector<TValue> lass::num::Polynomial< T >::TCoefficients

Definition at line 78 of file polynomial.h.

template<typename T >
typedef TCoefficients::size_type lass::num::Polynomial< T >::size_type

Definition at line 79 of file polynomial.h.

template<typename T >
typedef TCoefficients::const_iterator lass::num::Polynomial< T >::const_iterator

Definition at line 80 of file polynomial.h.


Constructor & Destructor Documentation

template<typename T >
lass::num::Polynomial< T >::Polynomial (  )  [inline]

Definition at line 57 of file polynomial.inl.

template<typename T >
lass::num::Polynomial< T >::Polynomial ( TParam  iScalar  )  [inline, explicit]

Definition at line 63 of file polynomial.inl.

template<typename T >
lass::num::Polynomial< T >::Polynomial ( const TCoefficients iCoefficients  )  [inline, explicit]

Definition at line 71 of file polynomial.inl.

template<typename T >
template<typename InputIterator >
lass::num::Polynomial< T >::Polynomial ( InputIterator  iBegin,
InputIterator  iEnd 
) [inline]

Definition at line 79 of file polynomial.inl.


Member Function Documentation

template<typename T >
const Polynomial< T >::TCoefficients & lass::num::Polynomial< T >::coefficients (  )  const [inline]

template<typename T >
const Polynomial< T >::TValue lass::num::Polynomial< T >::operator[] ( size_t  iIndex  )  const [inline]

Definition at line 97 of file polynomial.inl.

References lass::num::Polynomial< T >::a_, and LASS_ASSERT.

template<typename T >
const Polynomial< T >::TValue lass::num::Polynomial< T >::at ( size_t  iIndex  )  const [inline]

template<typename T >
const Polynomial< T >::TValue lass::num::Polynomial< T >::operator() ( TParam  iX  )  const [inline]

template<typename T >
const Polynomial< T > & lass::num::Polynomial< T >::operator+ (  )  const [inline]

Definition at line 132 of file polynomial.inl.

template<typename T >
const Polynomial< T > lass::num::Polynomial< T >::operator- (  )  const [inline]

Definition at line 140 of file polynomial.inl.

References lass::num::Polynomial< T >::a_.

template<typename T >
Polynomial< T > & lass::num::Polynomial< T >::operator+= ( const Polynomial< T > &  iOther  )  [inline]

template<typename T >
Polynomial< T > & lass::num::Polynomial< T >::operator-= ( const Polynomial< T > &  iOther  )  [inline]

template<typename T >
Polynomial< T > & lass::num::Polynomial< T >::operator*= ( const Polynomial< T > &  iOther  )  [inline]

template<typename T >
Polynomial< T > & lass::num::Polynomial< T >::operator+= ( TParam  iScalar  )  [inline]

Definition at line 208 of file polynomial.inl.

References lass::num::Polynomial< T >::a_.

template<typename T >
Polynomial< T > & lass::num::Polynomial< T >::operator-= ( TParam  iScalar  )  [inline]

Definition at line 224 of file polynomial.inl.

References lass::num::Polynomial< T >::a_.

template<typename T >
Polynomial< T > & lass::num::Polynomial< T >::operator*= ( TParam  iScalar  )  [inline]

Definition at line 240 of file polynomial.inl.

References lass::num::Polynomial< T >::a_.

template<typename T >
Polynomial< T > & lass::num::Polynomial< T >::operator/= ( TParam  iScalar  )  [inline]

Definition at line 253 of file polynomial.inl.

References lass::num::Polynomial< T >::a_.

template<typename T >
Polynomial< T > lass::num::Polynomial< T >::derivative (  )  const [inline]

template<typename T >
Polynomial< T > lass::num::Polynomial< T >::integral (  )  const [inline]

template<typename T >
Polynomial< T > lass::num::Polynomial< T >::pow ( unsigned  iPower  )  const [inline]

Definition at line 303 of file polynomial.inl.

Referenced by lass::num::PolynomialQuotient< T >::pow().

template<typename T >
const Polynomial< T >::size_type lass::num::Polynomial< T >::size (  )  const [inline]

return size of coefficients.

Definition at line 318 of file polynomial.inl.

References lass::num::Polynomial< T >::a_.

template<typename T >
const Polynomial< T >::const_iterator lass::num::Polynomial< T >::begin (  )  const [inline]

return iterator to first (lowest) coefficient

Definition at line 328 of file polynomial.inl.

References lass::num::Polynomial< T >::a_.

template<typename T >
const Polynomial< T >::const_iterator lass::num::Polynomial< T >::end (  )  const [inline]

return iterator to last (highest) coefficient

Definition at line 338 of file polynomial.inl.

References lass::num::Polynomial< T >::a_.

template<typename T >
Polynomial< T > lass::num::Polynomial< T >::one (  )  [inline, static]

return constant polynomial 1

Definition at line 348 of file polynomial.inl.

template<typename T >
Polynomial< T > lass::num::Polynomial< T >::x (  )  [inline, static]

return linear polynomial x

Definition at line 359 of file polynomial.inl.

References lass::num::Polynomial< T >::coefficients().

Referenced by lass::num::Polynomial< T >::operator()().


Field Documentation

template<typename T >
TCoefficients lass::num::Polynomial< T >::a_ [private]


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

Generated on Mon Nov 10 14:22:10 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo