atlas  0.6
atlas::polynomials Namespace Reference

Classes

class  Polynomial
Polynomials with coefficients in |C|. More...

class  Safe_Poly

Typedefs

typedef size_t Degree

Functions

template<typename C >
std::ostream & operator<< (std::ostream &strm, const Polynomial< C > &P)

template<typename C >
bool compare (const Polynomial< C > &p, const Polynomial< C > &q)
Polynomial comparison: whether p < q. More...

template<typename C >
void safeAdd (C &a, C b)
a += b. More...

template<typename C >
void safeDivide (C &a, C b)
a /= b. More...

template<typename C >
void safeProd (C &a, C b)
a *= b. More...

template<typename C >
void safeSubtract (C &a, C b)
a -= b. More...

template<typename C >
void printMonomial (std::ostream &strm, C c, polynomials::Degree d, const char *x)

Variables

const Degree MinusOne = ~ Degree(0)

Typedef Documentation

 typedef size_t atlas::polynomials::Degree

Function Documentation

template<typename C >
 bool atlas::polynomials::compare ( const Polynomial< C > & p, const Polynomial< C > & q )

Polynomial comparison: whether p < q.

Explanation: p < q if deg(p) < deg(q), or if degrees are equal, and the comparison holds for coefficients, in lex-order starting from the top.

template<typename C >
 std::ostream & atlas::polynomials::operator<< ( std::ostream & strm, const Polynomial< C > & P )
template<typename C >
 void atlas::polynomials::printMonomial ( std::ostream & strm, C c, polynomials::Degree d, const char * x )
template<typename C >
 void atlas::polynomials::safeAdd ( C & a, C b )

a += b.

Throws a NumericOverflow exception in case of overflow.

template<typename C >
 void atlas::polynomials::safeDivide ( C & a, C b )

a /= b.

Throws a NumericOverflow exception in case of nondivisibility.

template<typename C >
 void atlas::polynomials::safeProd ( C & a, C b )

a *= b.

Throws a NumericOverflow exception in case of overflow.

template<typename C >
 void atlas::polynomials::safeSubtract ( C & a, C b )

a -= b.

Throws a NumericUnderflow exception in case of underflow.

Variable Documentation

 const Degree atlas::polynomials::MinusOne = ~ Degree(0)