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 UnparametricField< K >.
Public Types | |
Common Object Interface for a LinBox Field. | |
These methods and member types are required of all LinBox fields. See FieldArchetype for detailed specifications. | |
typedef UnparametricRandIter< K > | RandIter |
Type of random field element generators. | |
Public Member Functions | |
NTL_zz_pX (const integer &p, size_t e=1) | |
Standard LinBox field constructor. | |
NTL_zz_pX (CoeffField cf) | |
Constructor from a coefficient field. | |
template<class ANY > | |
Element & | init (Element &p, const ANY &y) const |
Initialize p to the constant y (p = y*x^0) | |
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. | |
Element & | init (Element &p, const std::vector< Coeff > &v) const |
Initialize p from a vector of coefficients. | |
template<class ANY > | |
std::vector< ANY > & | convert (std::vector< ANY > &v, const Element &p) const |
Convert p to a vector of coefficients. | |
std::vector< Coeff > & | convert (std::vector< Coeff > &v, const Element &p) const |
Convert p to a vector of coefficients. | |
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. | |
Element & | revin (Element &r) |
r is itself reversed. | |
Coeff & | leadCoeff (Coeff &c, const Element &p) const |
Get the leading coefficient of this polynomial. | |
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. | |
integer & | characteristic (integer &c) const |
Get characteristic of the field - same as characteristic of coefficient field. | |
integer & | cardinality (integer &c) const |
Get the cardinality of the field. | |
template<> | |
NTL::zz_p & | inv (NTL::zz_p &x, const NTL::zz_p &y) const |
template<> | |
NTL::zz_p & | invin (NTL::zz_p &x) const |
template<> | |
std::ostream & | write (std::ostream &os) const |
template<> | |
bool | isZero (const NTL::zz_p &x) const |
template<> | |
bool | isOne (const NTL::zz_p &x) const |
Field Object Basics. | |
Element & | inv (Element &x, const Element &y) const |
c := characteristic of this field (zero or prime). | |
Element & | invin (Element &x) const |
c := characteristic of this field (zero or prime). | |
std::ostream & | write (std::ostream &os) const |
c := characteristic of this field (zero or prime). | |
std::ostream & | write (std::ostream &os, const Element &p) const |
c := characteristic of this field (zero or prime). | |
bool | isZero (const Element &x) const |
c := characteristic of this field (zero or prime). | |
bool | isOne (const Element &x) const |
c := characteristic of this field (zero or prime). | |
long unsigned int | characteristic (long unsigned int &p) const |
c := characteristic of this field (zero or prime). | |
long unsigned int | characteristic () const |
c := characteristic of this field (zero or prime). | |
long unsigned int | cardinality () const |
c := characteristic of this field (zero or prime). | |
template<typename Src > | |
Element & | init (Element &x, const Src &s) const |
c := characteristic of this field (zero or prime). | |
std::istream & | read (std::istream &is, Element &x) const |
c := characteristic of this field (zero or prime). | |
std::istream & | read (std::istream &is) const |
c := characteristic of this field (zero or prime). | |
template<typename T > | |
T & | convert (T &x, const Element &y) const |
c := characteristic of this field (zero or prime). | |
class RR. | |
Rational number field. This field is provided as a convenience in a few places. Use with caution because expression swell. This specialization allows the UnparametricField template class to be used to wrap NTL's RR class as a LinBox field. | |
template<> | |
NTL::RR & | inv (NTL::RR &x, const NTL::RR &y) const |
template<> | |
NTL::RR & | invin (NTL::RR &x) const |
template<> | |
std::ostream & | write (std::ostream &os) const |
template<> | |
bool | isZero (const NTL::RR &x) const |
template<> | |
bool | isOne (const NTL::RR &x) const |
template<> | |
NTL::ZZ_p & | inv (NTL::ZZ_p &x, const NTL::ZZ_p &y) const |
template<> | |
NTL::ZZ_p & | invin (NTL::ZZ_p &x) const |
template<> | |
std::ostream & | write (std::ostream &os) const |
template<> | |
bool | isZero (const NTL::ZZ_p &x) const |
template<> | |
bool | isOne (const NTL::ZZ_p &x) const |
Implementation-Specific Methods. | |
These methods are not required of all LinBox fields and are included only for the implementation of this field template. | |
const K & | operator() (void) const |
Constant access operator. | |
K & | operator() (void) |
Access operator. |
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.
Element& init | ( | Element & | p, |
const std::vector< ANY > & | v | ||
) | const [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.
Element& init | ( | Element & | p, |
const std::vector< Coeff > & | v | ||
) | const [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.
std::vector<ANY>& convert | ( | std::vector< ANY > & | v, |
const Element & | p | ||
) | const [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.
std::vector<Coeff>& convert | ( | std::vector< Coeff > & | v, |
const Element & | p | ||
) | const [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.
Element& rev | ( | Element & | r, |
const Element & | p | ||
) | [inline] |
r will be set to the reverse of p.
Element& revin | ( | Element & | r | ) | [inline] |
r is itself reversed.
Coeff& leadCoeff | ( | Coeff & | c, |
const Element & | p | ||
) | const [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.
NTL::zz_p & inv | ( | NTL::zz_p & | x, |
const NTL::zz_p & | y | ||
) | const [inherited] |
x = 1 / y This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
y | field element. |
NTL::RR & inv | ( | NTL::RR & | x, |
const NTL::RR & | y | ||
) | const [inherited] |
x = 1 / y This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
y | field element. |
NTL::ZZ_p & inv | ( | NTL::ZZ_p & | x, |
const NTL::ZZ_p & | y | ||
) | const [inherited] |
x = 1 / y This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
y | field element. |
NTL::zz_p & invin | ( | NTL::zz_p & | x | ) | const [inherited] |
x = 1 / x This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
NTL::RR & invin | ( | NTL::RR & | x | ) | const [inherited] |
x = 1 / x This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
NTL::ZZ_p & invin | ( | NTL::ZZ_p & | x | ) | const [inherited] |
x = 1 / x This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
std::ostream & write | ( | std::ostream & | os | ) | const [inherited] |
os | output stream to which field is written. |
std::ostream & write | ( | std::ostream & | os | ) | const [inherited] |
os | output stream to which field is written. |
std::ostream & write | ( | std::ostream & | os | ) | const [inherited] |
os | output stream to which field is written. |
bool isZero | ( | const NTL::zz_p & | x | ) | const [inherited] |
Test if field element is equal to zero. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsZero function is called.
x | field element. |
bool isZero | ( | const NTL::RR & | x | ) | const [inherited] |
Test if field element is equal to zero. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsZero function is called.
x | field element. |
bool isZero | ( | const NTL::ZZ_p & | x | ) | const [inherited] |
Test if field element is equal to zero. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsZero function is called.
x | field element. |
bool isOne | ( | const NTL::zz_p & | x | ) | const [inherited] |
Test if field element is equal to one. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsOne function is called.
x | field element. |
bool isOne | ( | const NTL::RR & | x | ) | const [inherited] |
Test if field element is equal to one. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsOne function is called.
x | field element. |
bool isOne | ( | const NTL::ZZ_p & | x | ) | const [inherited] |
Test if field element is equal to one. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsOne function is called.
x | field element. |
const K& operator() | ( | void | ) | const [inline, inherited] |
Constant access operator.
K& operator() | ( | void | ) | [inline, inherited] |
Access operator.