linbox
|
Ring (in fact, a unique factorization domain) of polynomial with coefficients in class NTL_zz_p (integers mod a wordsize prime). More...
#include <ntl-lzz_px.h>
Inherits NTL_zz_pX_Initialiser, and UnparametricOperations< NTL::zz_pX >.
Public Member Functions | |
NTL_zz_pX (const integer &p, size_t e=1) | |
Standard LinBox field constructor. More... | |
NTL_zz_pX (CoeffField cf) | |
Constructor from a coefficient field. | |
Element & | init (Element &p, const Coeff &y) const |
Initialize p to the constant y (p = y*x^0) | |
template<class ANY > | |
Element & | init (Element &p, const std::vector< ANY > &v) const |
Initialize p from a vector of coefficients. More... | |
Element & | init (Element &p, const std::vector< Coeff > &v) const |
Initialize p from a vector of coefficients. More... | |
template<class ANY > | |
std::vector< ANY > & | convert (std::vector< ANY > &v, const Element &p) const |
Convert p to a vector of coefficients. More... | |
std::vector< Coeff > & | convert (std::vector< Coeff > &v, const Element &p) const |
Convert p to a vector of coefficients. More... | |
bool | isZero (const Element &x) const |
Test if an element equals zero. | |
bool | isOne (const Element &x) const |
Test if an element equals one. | |
const CoeffField & | getCoeffField () const |
The LinBox field for coefficients. | |
size_t | deg (const Element &p) const |
Get the degree of a polynomial Unlike NTL, deg(0)=0. | |
Element & | rev (Element &r, const Element &p) |
r will be set to the reverse of p. More... | |
Element & | revin (Element &r) |
r is itself reversed. More... | |
Coeff & | leadCoeff (Coeff &c, const Element &p) const |
Get the leading coefficient of this polynomial. More... | |
Coeff & | getCoeff (Coeff &c, const Element &p, size_t i) const |
Get the coefficient of x^i in a given polynomial. | |
Element & | setCoeff (Element &p, size_t i, const Coeff &c) const |
Set the coefficient of x^i in a given polynomial. | |
Element & | quo (Element &res, const Element &a, const Element &b) const |
Get the quotient of two polynomials. | |
Element & | quoin (Element &a, const Element &b) const |
a = quotient of a, b | |
Element & | rem (Element &res, const Element &a, const Element &b) const |
Get the remainder under polynomial division. | |
Element & | remin (Element &a, const Element &b) const |
a = remainder of a,b | |
void | quorem (Element &q, Element &r, const Element &a, const Element &b) const |
Get the quotient and remainder under polynomial division. | |
Element & | gcdin (Element &a, const Element &b) const |
Get the greatest commonn divisor of two polynomials. | |
Element & | lcmin (Element &a, const Element &b) const |
Get the least common multiple of two polynomials. | |
integer & | characteristic (integer &c) const |
Get characteristic of the field - same as characteristic of coefficient field. More... | |
integer & | cardinality (integer &c) const |
Get the cardinality of the field. More... | |
std::ostream & | write (std::ostream &os) const |
Write a description of the field. | |
template<class ANY > | |
ANY & | convert (ANY &x, const Element &y) const |
Conversion to scalar types doesn't make sense and should not be used. More... | |
Ring (in fact, a unique factorization domain) of polynomial with coefficients in class NTL_zz_p (integers mod a wordsize prime).
All the same functions as any other ring, with the addition of: Coeff (type), CoeffField (type), getCoeffField, setCoeff, getCoeff, leadCoeff, deg
Standard LinBox field constructor.
The paramters here (prime, exponent) are only used to initialize the coefficient field.
|
inline |
Initialize p from a vector of coefficients.
The vector should be ordered the same way NTL does it: the front of the vector corresponds to the trailing coefficients, and the back of the vector corresponds to the leading coefficients. That is, v[i] = coefficient of x^i.
|
inline |
Initialize p from a vector of coefficients.
The vector should be ordered the same way NTL does it: the front of the vector corresponds to the trailing coefficients, and the back of the vector corresponds to the leading coefficients. That is, v[i] = coefficient of x^i.
|
inline |
Convert p to a vector of coefficients.
The vector will be ordered the same way NTL does it: the front of the vector corresponds to the trailing coefficients, and the back of the vector corresponds to the leading coefficients. That is, v[i] = coefficient of x^i.
|
inline |
Convert p to a vector of coefficients.
The vector will be ordered the same way NTL does it: the front of the vector corresponds to the trailing coefficients, and the back of the vector corresponds to the leading coefficients. That is, v[i] = coefficient of x^i.
|
inline |
r will be set to the reverse of p.
|
inline |
r is itself reversed.
|
inline |
Get the leading coefficient of this polynomial.
Get characteristic of the field - same as characteristic of coefficient field.
Get the cardinality of the field.
Since the cardinality is infinite, by convention we return -1.
|
inline |
Conversion to scalar types doesn't make sense and should not be used.
Use getCoeff or leadCoeff to get the scalar values of specific coefficients, and then convert them using coeffField() if needed.