31 #ifndef ATBPOLYNOMIAL_HH 32 #define ATBPOLYNOMIAL_HH 64 template<
typename CoeffT>
169 template<
typename DomainT>
185 std::vector<typename traits<CoeffT>::ComplexT>
roots(
186 bool polish =
true,
bool sort =
false);
342 int n,
double sigma = 1.0 / std::sqrt(2.0));
346 void _trimCoefficients();
348 static std::complex<double>& _laguer(
349 const std::vector< std::complex<double> >& a,
350 std::complex<double>& x);
352 std::vector<CoeffT> _coeffs;
353 mutable size_t _degree;
354 mutable bool _degreeCached;
356 static CoeffT
const _zeroCoeff;
362 mutable ptrdiff_t __p1, __p2, __p3;
363 mutable ptrdiff_t __n1, __n2, __n3;
377 template<
typename CoeffT>
390 template<
typename CoeffT>
403 template<
typename CoeffT>
416 template<
typename CoeffT>
428 template<
typename CoeffT>
430 const CoeffT& alpha);
441 template<
typename CoeffT>
454 template<
typename CoeffT>
456 const CoeffT& alpha);
468 template<
typename CoeffT>
469 std::ostream& operator<<(std::ostream& os, const Polynomial<CoeffT>& p);
473 #include "ATBPolynomial.icc" static Polynomial< CoeffT > hermite(int n, double sigma=1.0/std::sqrt(2.0))
Get the normalized Hermite polynomial of given degree.
Polynomial< CoeffT > & operator*=(const Polynomial< CoeffT > &p)
Multiplication assignment operator.
bool operator!=(const Polynomial< CoeffT > &p)
Comparison of the given polynomial with this polynomial.
const CoeffT & coefficient(size_t i) const
Read-Only accessor to the i'th polynomial coefficient.
CoeffT operator()(DomainT x) const
Evaluates the polynomial at position x.
Polynomial< CoeffT > & operator/=(const CoeffT &alpha)
Division assignment operator.
Polynomial< CoeffT > operator-() const
Unary minus operator.
Polynomial< CoeffT > operator/(const Polynomial< CoeffT > &p, const CoeffT &alpha)
Division operator.
The Polynomial class provides arithmetical operations with polynomials as well as a root finding algo...
Query specific information about different data types.
ATBTiming.hh provides the MyDateTime and Timer classes for high accuracy profiling.
bool operator==(const Polynomial< CoeffT > &p)
Comparison of the given polynomial with this polynomial.
Polynomial< CoeffT > derivative(size_t degree=1)
Computes the n'th derivative of this polynomial.
Polynomial< CoeffT > & operator-=(const Polynomial< CoeffT > &p)
Minus assignment operator.
size_t degree() const
Retrieve the degree of the polynomial.
Polynomial< CoeffT > & operator=(const Polynomial< CoeffT > &p)
Copy assignment operator.
Polynomial< CoeffT > operator*(const Polynomial< CoeffT > &p1, const Polynomial< CoeffT > &p2)
Multiplication operator.
Polynomial< CoeffT > & operator+=(const Polynomial< CoeffT > &p)
Plus assignment operator.
Polynomial< CoeffT > operator+(const Polynomial< CoeffT > &p1, const Polynomial< CoeffT > &p2)
Plus operator.
std::vector< typename traits< CoeffT >::ComplexT > roots(bool polish=true, bool sort=false)
Computes and returns the vector of zero crossings of the polynomial.
Polynomial< CoeffT > indefiniteIntegral(size_t degree=1)
Computes the n'th indefinite Integral of this polynomial.
static Polynomial< CoeffT > const & zero()
Get the neutral element for addition of the Polynomial ring.
static Polynomial< CoeffT > const & one()
Get the neutral element for multiplication of the Polynomial ring.
Polynomial()
Default constructor.
Polynomial< CoeffT > pow(const Polynomial< CoeffT > &p, int exponential)
Power operator.