mt2  8bbb7ce09375b7fc0edeb89e1fe1dbb76bbd0555
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Polynomial< CoeffType > Class Template Reference

#include <polynomial.hpp>

Public Member Functions

 Polynomial ()=default
 
 Polynomial (const Polynomial &)=default
 
Polynomialoperator= (const Polynomial &)=default
 
 Polynomial (Polynomial &&)=default
 
Polynomialoperator= (Polynomial &&)=default
 
 ~Polynomial ()=default
 
 Polynomial (const CoeffType &coeff)
 
 Polynomial (const std::vector< CoeffType > &coeffs)
 
void SetCoefficient (std::size_t degree, CoeffType coefficient)
 
CoeffType GetCoefficient (std::size_t degree) const
 
CoeffType LeadingCoefficient () const
 
std::size_t Degree () const
 
void TruncateToDegree (std::size_t degree)
 
bool IsZero () const
 
 operator std::vector< CoeffType > () const
 
template<typename ArgType >
auto operator() (const ArgType &x) const -> decltype(CoeffType(0)*x)
 
Polynomialoperator+= (const Polynomial &p)
 
Polynomialoperator-= (const Polynomial &p)
 
Polynomialoperator*= (const Polynomial &p)
 
Polynomialoperator/= (const Polynomial &p)
 
Polynomialoperator%= (const Polynomial &p)
 
Polynomial operator- () const
 
Polynomial operator+ () const
 
bool operator!= (const Polynomial &p)
 
bool operator== (const Polynomial &p)
 

Private Member Functions

void Shrink ()
 

Private Attributes

std::vector< CoeffType > coeffs_
 

Detailed Description

template<typename CoeffType>
class Polynomial< CoeffType >

Definition at line 27 of file polynomial.hpp.

Constructor & Destructor Documentation

template<typename CoeffType>
Polynomial< CoeffType >::Polynomial ( )
default
template<typename CoeffType>
Polynomial< CoeffType >::Polynomial ( const Polynomial< CoeffType > &  )
default
template<typename CoeffType>
Polynomial< CoeffType >::Polynomial ( Polynomial< CoeffType > &&  )
default
template<typename CoeffType>
Polynomial< CoeffType >::~Polynomial ( )
default
template<typename CoeffType>
Polynomial< CoeffType >::Polynomial ( const CoeffType &  coeff)
inline

Definition at line 36 of file polynomial.hpp.

References Polynomial< CoeffType >::Shrink().

template<typename CoeffType>
Polynomial< CoeffType >::Polynomial ( const std::vector< CoeffType > &  coeffs)
inline

Definition at line 41 of file polynomial.hpp.

References Polynomial< CoeffType >::Shrink().

Member Function Documentation

template<typename CoeffType>
std::size_t Polynomial< CoeffType >::Degree ( ) const
inline
template<typename CoeffType>
CoeffType Polynomial< CoeffType >::GetCoefficient ( std::size_t  degree) const
inline

Definition at line 58 of file polynomial.hpp.

References Polynomial< CoeffType >::coeffs_.

template<typename CoeffType>
bool Polynomial< CoeffType >::IsZero ( ) const
inline
template<typename CoeffType>
CoeffType Polynomial< CoeffType >::LeadingCoefficient ( ) const
inline
template<typename CoeffType>
Polynomial< CoeffType >::operator std::vector< CoeffType > ( ) const
inline

Definition at line 82 of file polynomial.hpp.

References Polynomial< CoeffType >::coeffs_.

template<typename CoeffType>
bool Polynomial< CoeffType >::operator!= ( const Polynomial< CoeffType > &  p)
inline

Definition at line 182 of file polynomial.hpp.

References Polynomial< CoeffType >::coeffs_.

template<typename CoeffType>
Polynomial& Polynomial< CoeffType >::operator%= ( const Polynomial< CoeffType > &  p)
inline
template<typename CoeffType>
template<typename ArgType >
auto Polynomial< CoeffType >::operator() ( const ArgType &  x) const -> decltype(CoeffType(0)*x)
inline

Definition at line 87 of file polynomial.hpp.

References Polynomial< CoeffType >::coeffs_.

template<typename CoeffType>
Polynomial& Polynomial< CoeffType >::operator*= ( const Polynomial< CoeffType > &  p)
inline
template<typename CoeffType>
Polynomial Polynomial< CoeffType >::operator+ ( ) const
inline

Definition at line 178 of file polynomial.hpp.

template<typename CoeffType>
Polynomial& Polynomial< CoeffType >::operator+= ( const Polynomial< CoeffType > &  p)
inline
template<typename CoeffType>
Polynomial Polynomial< CoeffType >::operator- ( ) const
inline

Definition at line 170 of file polynomial.hpp.

References Polynomial< CoeffType >::coeffs_.

template<typename CoeffType>
Polynomial& Polynomial< CoeffType >::operator-= ( const Polynomial< CoeffType > &  p)
inline
template<typename CoeffType>
Polynomial& Polynomial< CoeffType >::operator/= ( const Polynomial< CoeffType > &  p)
inline
template<typename CoeffType>
Polynomial& Polynomial< CoeffType >::operator= ( const Polynomial< CoeffType > &  )
default
template<typename CoeffType>
Polynomial& Polynomial< CoeffType >::operator= ( Polynomial< CoeffType > &&  )
default
template<typename CoeffType>
bool Polynomial< CoeffType >::operator== ( const Polynomial< CoeffType > &  p)
inline

Definition at line 186 of file polynomial.hpp.

References Polynomial< CoeffType >::coeffs_.

template<typename CoeffType>
void Polynomial< CoeffType >::SetCoefficient ( std::size_t  degree,
CoeffType  coefficient 
)
inline
template<typename CoeffType>
void Polynomial< CoeffType >::Shrink ( )
inlineprivate
template<typename CoeffType>
void Polynomial< CoeffType >::TruncateToDegree ( std::size_t  degree)
inline

Member Data Documentation

template<typename CoeffType>
std::vector<CoeffType> Polynomial< CoeffType >::coeffs_
private

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