linbox
|
Wrapper of zz_p from NTL. More...
#include <ntl-ZZ_p.h>
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 UnparametricField template class to be used to wrap NTL's | |
NTL_ZZ_p (integer q, size_t e=1) | |
Specialization for NTL::ZZ. | |
NTL_ZZ_p (NTL::ZZ d, size_t e=1) | |
Specialization for NTL::ZZ. | |
NTL_ZZ_p () | |
Specialization for NTL::ZZ. | |
Element & | init (Element &x, const integer &y) const |
Specialization for NTL::ZZ. | |
Element & | init (Element &x, const double &y) const |
Specialization for NTL::ZZ. | |
Element & | init (Element &x, const NTL::ZZ &y) const |
Specialization for NTL::ZZ. | |
Element & | init (Element &x) const |
Specialization for NTL::ZZ. | |
NTL::ZZ & | convert (NTL::ZZ &x, const Element &y) const |
Specialization for NTL::ZZ. | |
integer & | convert (integer &x, const Element &y) const |
Conversion of field element to an integer. | |
double & | convert (double &x, const Element &y) const |
Specialization for NTL::ZZ. | |
template<class ANY > | |
Element & | init (Element &x, const ANY &y) const |
Specialization for NTL::ZZ. | |
template<class ANY > | |
ANY & | convert (ANY &x, const Element &y) const |
Specialization for NTL::ZZ. | |
Element & | pow (Element &res, const Element &x, long exp) const |
Specialization for NTL::ZZ. | |
Element & | powin (Element &x, long exp) const |
Specialization for NTL::ZZ. | |
integer & | cardinality (integer &c) const |
Cardinality. | |
integer | cardinality () const |
Specialization for NTL::ZZ. | |
integer & | characteristic (integer &c) const |
Characteristic. | |
integer | characteristic () const |
Specialization for NTL::ZZ. | |
Element & | inv (Element &x, const Element &y) const |
Multiplicative Inverse. | |
bool | isZero (const Element &x) const |
Zero equality. | |
bool | isOne (const Element &x) const |
One equality. | |
Element & | invin (Element &x) const |
Inplace Multiplicative Inverse. | |
std::ostream & | write (std::ostream &os) const |
Print field. | |
std::ostream & | write (std::ostream &os, const Element &x) const |
Specialization for NTL::ZZ. | |
static integer | getMaxModulus () |
Specialization for NTL::ZZ. |
Wrapper of zz_p from NTL.
Uses nice mod p via floating pt trick.
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
NTL_ZZ_p | ( | NTL::ZZ | d, |
size_t | e = 1 |
||
) | [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
NTL_ZZ_p | ( | ) | [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
Element& init | ( | Element & | x, |
const integer & | y | ||
) | const [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
Element& init | ( | Element & | x, |
const double & | y | ||
) | const [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
Element& init | ( | Element & | x, |
const NTL::ZZ & | y | ||
) | const [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
Element& init | ( | Element & | x | ) | const [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
NTL::ZZ& convert | ( | NTL::ZZ & | x, |
const Element & | y | ||
) | const [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. |
double& convert | ( | double & | x, |
const Element & | y | ||
) | const [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
Element& init | ( | Element & | x, |
const ANY & | y | ||
) | const [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
ANY& convert | ( | ANY & | x, |
const Element & | y | ||
) | const [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
static integer getMaxModulus | ( | ) | [inline, static] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
Reimplemented in PIR_ntl_ZZ_p.
Element& pow | ( | Element & | res, |
const Element & | x, | ||
long | exp | ||
) | const [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
Element& powin | ( | Element & | x, |
long | exp | ||
) | const [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
Cardinality.
Return integer representing cardinality of the field. Returns the modulus of the field, which should be prime.
integer cardinality | ( | ) | const [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
Characteristic.
Return integer representing characteristic of the field. Returns the modulus of the field, which should be prime.
integer characteristic | ( | ) | const [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
Element& inv | ( | Element & | x, |
const Element & | y | ||
) | const [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. |
bool isZero | ( | const Element & | x | ) | const [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. |
bool isOne | ( | const Element & | x | ) | const [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. |
Element& invin | ( | Element & | x | ) | const [inline] |
Inplace Multiplicative Inverse.
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 [inline] |
Print field.
os | output stream to which field is written. |
std::ostream& write | ( | std::ostream & | os, |
const Element & | x | ||
) | const [inline] |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |