Polynomials over a fixed ring. More...
#include <polynomi.h>
Classes | |
struct | NewOnePolynomial |
Public Types | |
typedef T | Ring |
typedef T::Element | CoefficientType |
typedef B::DivideByZero | DivideByZero |
typedef B::RandomizationParameter | RandomizationParameter |
Public Member Functions | |
ACCESSORS | |
int | Degree () const |
the zero polynomial will return a degree of -1 | |
unsigned int | CoefficientCount () const |
degree + 1 | |
CoefficientType | GetCoefficient (unsigned int i) const |
return coefficient for x^i | |
CoefficientType | operator[] (unsigned int i) const |
return coefficient for x^i | |
MANIPULATORS | |
ThisType & | operator= (const ThisType &t) |
ThisType & | operator+= (const ThisType &t) |
ThisType & | operator-= (const ThisType &t) |
ThisType & | operator*= (const ThisType &t) |
ThisType & | operator/= (const ThisType &t) |
ThisType & | operator%= (const ThisType &t) |
ThisType & | operator<<= (unsigned int n) |
ThisType & | operator>>= (unsigned int n) |
void | SetCoefficient (unsigned int i, const CoefficientType &value) |
set the coefficient for x^i to value | |
void | Randomize (RandomNumberGenerator &rng, const RandomizationParameter ¶meter) |
void | Negate () |
void | swap (ThisType &t) |
UNARY OPERATORS | |
bool | operator! () const |
ThisType | operator+ () const |
ThisType | operator- () const |
Private Member Functions | |
ACCESSORS | |
int | Degree (const Ring &ring) const |
the zero polynomial will return a degree of -1 | |
unsigned int | CoefficientCount (const Ring &ring) const |
CoefficientType | GetCoefficient (unsigned int i, const Ring &ring) const |
return coefficient for x^i | |
MANIPULATORS | |
void | Randomize (RandomNumberGenerator &rng, const RandomizationParameter ¶meter, const Ring &ring) |
void | SetCoefficient (unsigned int i, const CoefficientType &value, const Ring &ring) |
set the coefficient for x^i to value | |
void | Negate (const Ring &ring) |
void | swap (PolynomialOver< Ring > &t) |
INPUT/OUTPUT | |
std::istream & | Input (std::istream &in, const Ring &ring) |
std::ostream & | Output (std::ostream &out, const Ring &ring) const |
Friends | |
BINARY OPERATORS | |
ThisType | operator>> (ThisType a, unsigned int n) |
ThisType | operator<< (ThisType a, unsigned int n) |
INPUT/OUTPUT | |
std::istream & | operator>> (std::istream &in, ThisType &a) |
std::ostream & | operator<< (std::ostream &out, const ThisType &a) |
CREATORS | |
| |
PolynomialOverFixedRing (unsigned int count=0) | |
creates the zero polynomial | |
PolynomialOverFixedRing (const ThisType &t) | |
copy constructor | |
PolynomialOverFixedRing (const B &t) | |
PolynomialOverFixedRing (const CoefficientType &element) | |
construct constant polynomial | |
template<typename Iterator > | |
PolynomialOverFixedRing (Iterator first, Iterator last) | |
construct polynomial with specified coefficients, starting from coefficient of x^0 | |
PolynomialOverFixedRing (const char *str) | |
convert from string | |
PolynomialOverFixedRing (const byte *encodedPoly, unsigned int byteCount) | |
convert from big-endian byte array | |
PolynomialOverFixedRing (const byte *BEREncodedPoly) | |
convert from Basic Encoding Rules encoded byte array | |
PolynomialOverFixedRing (BufferedTransformation &bt) | |
convert from BER encoded byte array stored in a BufferedTransformation object | |
PolynomialOverFixedRing (RandomNumberGenerator &rng, const RandomizationParameter ¶meter) | |
create a random PolynomialOverFixedRing | |
static const ThisType & | Zero () |
static const ThisType & | One () |
OTHER ARITHMETIC FUNCTIONS | |
| |
ThisType | MultiplicativeInverse () const |
bool | IsUnit () const |
ThisType | Doubled () const |
ThisType | Squared () const |
CoefficientType | EvaluateAt (const CoefficientType &x) const |
static void | Divide (ThisType &r, ThisType &q, const ThisType &a, const ThisType &d) |
calculate r and q such that (a == d*q + r) && (0 <= r < abs(d)) | |
BASIC ARITHMETIC ON POLYNOMIALS | |
| |
bool | Equals (const PolynomialOver< Ring > &t, const Ring &ring) const |
bool | IsZero (const Ring &ring) const |
PolynomialOver< Ring > | Plus (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | Minus (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | Inverse (const Ring &ring) const |
PolynomialOver< Ring > | Times (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | DividedBy (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | Modulo (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | MultiplicativeInverse (const Ring &ring) const |
bool | IsUnit (const Ring &ring) const |
PolynomialOver< Ring > & | Accumulate (const PolynomialOver< Ring > &t, const Ring &ring) |
PolynomialOver< Ring > & | Reduce (const PolynomialOver< Ring > &t, const Ring &ring) |
PolynomialOver< Ring > | Doubled (const Ring &ring) const |
PolynomialOver< Ring > | Squared (const Ring &ring) const |
CoefficientType | EvaluateAt (const CoefficientType &x, const Ring &ring) const |
PolynomialOver< Ring > & | ShiftLeft (unsigned int n, const Ring &ring) |
PolynomialOver< Ring > & | ShiftRight (unsigned int n, const Ring &ring) |
static void | Divide (PolynomialOver< Ring > &r, PolynomialOver< Ring > &q, const PolynomialOver< Ring > &a, const PolynomialOver< Ring > &d, const Ring &ring) |
calculate r and q such that (a == d*q + r) && (0 <= degree of r < degree of d) |
Polynomials over a fixed ring.
Having a fixed ring allows overloaded operators
Definition at line 159 of file polynomi.h.