linbox
|
Wrapper of zz_p from NTL. More...
#include <ntl-zz_p.h>
Public Member Functions | |
Element & | init (Element &x, const NTL::ZZ &y) const |
Specialization for NTL::ZZ. More... | |
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... | |
integer & | cardinality (integer &c) const |
Cardinality. More... | |
integer & | characteristic (integer &c) const |
Characteristic. More... | |
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... | |
NTL_ZZ_p | |
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 | |
NTL_ZZ_p (integer q, size_t e=1) | |
NTL_ZZ_p (NTL::ZZ d, size_t e=1) | |
NTL_ZZ_p () | |
NULL constructor. | |
Wrapper of zz_p from NTL.
Uses nice mod p via floating pt trick.
|
inline |
d,e |
|
inline |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
|
inline |
Specialization for NTL::ZZ.
x | NTL::ZZ to contain output (reference returned). |
y | constant reference to field element. |
Conversion of field element to an integer.
This function assumes the output field element x has already been constructed, but that it is not already initialized. This done by converting to a std::string : inefficient but correct.
x | reference to integer to contain output (reference returned). |
y | constant reference to field element. |
Cardinality.
Return integer representing cardinality of the field. Returns the modulus of the field, which should be prime.
Characteristic.
Return integer representing characteristic of the field. Returns the modulus of the field, which should be prime.
|
inline |
Multiplicative Inverse.
x = 1 / y This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
y | field element. |
|
inline |
Zero equality.
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. |
|
inline |
One equality.
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. |
|
inline |
MOne equality.
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 IsMOne function is called.
x | field element. |
|
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)
x | field element. |
|
inline |
Inplace Multiplicative Inverse.
x = 1 / x This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
|
inline |
Print field.
os | output stream to which field is written. |
|
inline |
Print field.
os | output stream to which field is written. |
x |