linbox
|
extend Wrapper of ZZ_p from NTL. More...
#include <PIR-ntl-ZZ_p.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 | |
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<> | |
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). | |
integer & | characteristic (integer &c) const |
c := characteristic of this field (zero or prime). | |
long unsigned int | cardinality () const |
c := characteristic of this field (zero or prime). | |
integer & | cardinality (integer &c) const |
c := cardinality of this field (-1 if infinite). | |
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<> | |
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<> | |
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. | |
Static Public Member Functions | |
template<class Element2 > | |
static Element & | init (Element &x, const Element2 &y) |
Init x from y. | |
static Element & | init (Element &x, const Element &y) |
Init from a NTL::ZZ_p. | |
static Element & | init (Element &x, const integer &y) |
I don't know how to init from integer. | |
static integer & | convert (integer &x, const Element &y) |
Convert y to an Element. | |
static Element & | assign (Element &x, const Element &y) |
x = y. | |
static bool | areEqual (const Element &x, const Element &y) |
Test if x == y. | |
static bool | isZero (const Element &x) |
Test if x == 0. | |
static bool | isOne (const Element &x) |
Test if x == 1. | |
static Element & | add (Element &x, const Element &y, const Element &z) |
return x = y + z | |
static Element & | sub (Element &x, const Element &y, const Element &z) |
return x = y - z | |
template<class Int > | |
static Element & | mul (Element &x, const Element &y, const Int &z) |
return x = y * z | |
static Element & | div (Element &x, const Element &y, const Element &z) |
If exists a, such that a * z =y, return x = one of them. | |
static Element & | inv (Element &x, const Element &y) |
If y is a unit, return x = 1 / y, otherwsie, throw an exception. | |
static Element & | neg (Element &x, const Element &y) |
return x = -y; | |
template<class Int > | |
static Element & | axpy (Element &r, const Element &a, const Int &x, const Element &y) |
return r = a x + y | |
static Element & | addin (Element &x, const Element &y) |
return x += y; | |
static Element & | subin (Element &x, const Element &y) |
return x -= y; | |
template<class Int > | |
static Element & | mulin (Element &x, const Int &y) |
return x *= y; | |
static Element & | divin (Element &x, const Element &y) |
If y divides x, return x /= y, otherwise throw an exception. | |
static Element & | invin (Element &x) |
If x is a unit, x = 1 / x, otherwise, throw an exception. | |
static Element & | negin (Element &x) |
return x = -x; | |
template<class Int > | |
static Element & | axpyin (Element &r, const Element &a, const Int &x) |
return r += a x | |
static std::ostream & | write (std::ostream &out, const Element &y) |
out << y; | |
static std::istream & | read (std::istream &in, Element &x) |
read x from istream in | |
static bool | isUnit (const Element &x) |
some PIR function | |
static Element & | gcd (Element &g, const Element &a, const Element &b) |
return g = gcd (a, b) | |
static Element & | gcdin (Element &g, const Element &b) |
return g = gcd (g, b) | |
static Element & | xgcd (Element &g, Element &s, Element &t, const Element &a, const Element &b) |
g = gcd(a, b) = a*s + b*t. | |
static Element & | dxgcd (Element &g, Element &s, Element &t, Element &a1, Element &b1, const Element &a, const Element &b) |
g = gcd(a, b) = a*s + b*t. | |
static bool | isDivisor (const Element &a, const Element &b) |
Test if a | b. | |
static Element & | normal (Element &a, const Element &b) |
a = normalization of b. |
extend Wrapper of ZZ_p from NTL.
Add PIR functions
static Element& div | ( | Element & | x, |
const Element & | y, | ||
const Element & | z | ||
) | [inline, static] |
If exists a, such that a * z =y, return x = one of them.
Otherwise, throw an exception
static bool isUnit | ( | const Element & | x | ) | [inline, static] |
some PIR function
Test if x is a unit.
static Element& xgcd | ( | Element & | g, |
Element & | s, | ||
Element & | t, | ||
const Element & | a, | ||
const Element & | b | ||
) | [inline, static] |
g = gcd(a, b) = a*s + b*t.
and gcd (s, t) is a unit.
static Element& dxgcd | ( | Element & | g, |
Element & | s, | ||
Element & | t, | ||
Element & | a1, | ||
Element & | b1, | ||
const Element & | a, | ||
const Element & | b | ||
) | [inline, static] |
g = gcd(a, b) = a*s + b*t.
and gcd (s, t) is a unit. s * a1 + t * b1 = a unit.
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). |
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.