|
Arbitrary precision integers modulus a positive integer.
While NTL allows any integer to serve as the modulus, only prime moduli yield fields. Therefore, while arthmetic operations may be valid for any modulus, only prime moduli are supported in this implementation. The primality of the modulus will not be checked, so it is the programmer's responsibility to supply a prime modulus. These specializations allow the Givaro::ZRing template class to be used to wrap NTL's ZZ_p class as a LinBox field.
|
| NTL_ZZ_p (integer q, size_t e=1) |
|
| NTL_ZZ_p (NTL::ZZ d, size_t e=1) |
|
| NTL_ZZ_p () |
| NULL constructor.
|
|
Element & | init (Element &x, const integer &y) const |
|
Element & | init (Element &x, const double &y) const |
|
Element & | init (Element &x, const NTL::ZZ &y) const |
| Specialization for NTL::ZZ. More...
|
|
Element & | init (Element &x) const |
|
Element & | init (Element &x, const Element &y) const |
|
template<class ANY > |
Element & | init (Element &x, const ANY &y) const |
|
NTL::ZZ & | convert (NTL::ZZ &x, const Element &y) const |
| Specialization for NTL::ZZ. More...
|
|
integer & | convert (integer &x, const Element &y) const |
| Conversion of field element to an integer. More...
|
|
double & | convert (double &x, const Element &y) const |
|
template<class ANY > |
ANY & | convert (ANY &x, const Element &y) const |
|
Element & | pow (Element &res, const Element &x, long exp) const |
|
Element & | powin (Element &x, long exp) const |
|
integer & | cardinality (integer &c) const |
| Cardinality. More...
|
|
integer | cardinality () const |
|
integer & | characteristic (integer &c) const |
| Characteristic. More...
|
|
size_t & | characteristic (size_t &c) const |
|
integer | characteristic () const |
|
Element & | inv (Element &x, const Element &y) const |
| Multiplicative Inverse. More...
|
|
bool | isZero (const Element &x) const |
| Zero equality. More...
|
|
bool | isOne (const Element &x) const |
| One equality. More...
|
|
bool | isMOne (const Element &x) const |
| MOne equality. More...
|
|
bool | isUnit (const Element &x) const |
| Unit test. More...
|
|
Element & | invin (Element &x) const |
| Inplace Multiplicative Inverse. More...
|
|
std::ostream & | write (std::ostream &os) const |
| Print field. More...
|
|
std::ostream & | write (std::ostream &os, const Element &x) const |
| Print field. More...
|
|
static integer | maxCardinality () |
|
Wrapper of zz_p from NTL.
Uses nice mod p via floating pt trick.
bool isUnit |
( |
const Element & |
x | ) |
const |
|
inline |
Unit test.
Test if field element is invertible. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's InvModStatus function is called. inline long InvModStatus(ZZ& x, const ZZ& a, const ZZ& n) // if gcd(a,n) = 1, then ReturnValue = 0, x = a^{-1} mod n // otherwise, ReturnValue = 1, x = gcd(a, n)
- Returns
- boolean true if invertible, false if not.
- Parameters
-