Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

PIR_ntl_ZZ_p Class Reference

#include <PIR-ntl-ZZ_p.h>

Inheritance diagram for PIR_ntl_ZZ_p:

UnparametricField< NTL::ZZ_p > FieldInterface List of all members.

Detailed Description

extend Wrapper of ZZ_p from NTL. Add PIR functions


Public Types

typedef NTL::ZZ_p Element

Public Methods

template<class Element2>  PIR_ntl_ZZ_p (const Element2 &d)
 PIR_ntl_ZZ_p (const NTL::ZZ &d)
 PIR_ntl_ZZ_p (const integer &d, int exp=1)
std::istream & read (std::istream &in)

Static Public Methods

integercardinality (integer &c)
NTL::ZZ & cardinality (NTL::ZZ &c)
integercharacteristic (integer &c)
std::ostream & write (std::ostream &out)
template<class Element2> Elementinit (Element &x, const Element2 &y)
 Init x from y.

Elementinit (Element &x, const Element &y)
 Init from a NTL::ZZ_p.

Elementinit (Element &x, const integer &y)
 I don't know how to init from integer.

integerconvert (integer &x, const Element &y)
 Convert y to an Element.

Elementassign (Element &x, const Element &y)
 x = y.

bool areEqual (const Element &x,const Element &y)
 Test if x == y.

bool isZero (const Element &x)
 Test if x == 0.

bool isOne (const Element &x)
 Test if x == 1.

Elementadd (Element &x, const Element &y, const Element &z)
 return x = y + z

Elementsub (Element &x, const Element &y, const Element &z)
 return x = y - z

template<class Int> Elementmul (Element &x, const Element &y, const Int &z)
 return x = y * z

Elementdiv (Element &x, const Element &y, const Element &z)
 If exists a, such that a * z =y, return x = one of them. Otherwise, throw an exception.

Elementinv (Element &x, const Element &y)
 If y is a unit, return x = 1 / y, otherwsie, throw an exception.

Elementneg (Element &x, const Element &y)
 return x = -y;

template<class Int> Elementaxpy (Element &r, const Element &a, const Int &x, const Element &y)
 return r = a x + y

Elementaddin (Element &x, const Element &y)
 return x += y;

Elementsubin (Element &x, const Element &y)
 return x -= y;

template<class Int> Elementmulin (Element &x, const Int &y)
 return x *= y;

Elementdivin (Element &x, const Element &y)
 If y divides x, return x /= y, otherwise throw an exception.

Elementinvin (Element &x)
 If x is a unit, x = 1 / x, otherwise, throw an exception.

Elementnegin (Element &x)
 return x = -x;

template<class Int> Elementaxpyin (Element &r, const Element &a, const Int &x)
 return r += a x

std::ostream & write (std::ostream &out, const Element &y)
 out << y;

std::istream & read (std::istream &in, Element &x)
 read x from istream in

bool isUnit (const Element &x)
 Test if x is a unit.

Elementgcd (Element &g, const Element &a, const Element &b)
 return g = gcd (a, b)

Elementgcdin (Element &g, const Element &b)
 return g = gcd (g, b)

Elementxgcd (Element &g, Element &s, Element &t, const Element &a, const Element &b)
 g = gcd(a, b) = a*s + b*t. and gcd (s, t) is a unit.

Elementdxgcd (Element &g, Element &s, Element &t, Element &a1, Element &b1, const Element &a, const Element &b)
 g = gcd(a, b) = a*s + b*t. and gcd (s, t) is a unit. s * a1 + t * b1 = a unit.

bool isDivisor (const Element &a, const Element &b)
 Test if a | b.

Elementnormal (Element &a, const Element &b)
 a = normalization of b.

ElementnormalIn (Element &a)
integer getMaxModulus ()


Member Typedef Documentation

typedef NTL::ZZ_p Element
 

The field's element type. Type K must provide a default constructor, a copy constructor, a destructor, and an assignment operator.

Reimplemented from UnparametricField< NTL::ZZ_p >.


Constructor & Destructor Documentation

PIR_ntl_ZZ_p const Element2 &    d [inline]
 

PIR_ntl_ZZ_p const NTL::ZZ &    d [inline]
 

PIR_ntl_ZZ_p const integer   d,
int    exp = 1
[inline]
 


Member Function Documentation

Element& add Element   x,
const Element   y,
const Element   z
[inline, static]
 

return x = y + z

Element& addin Element   x,
const Element   y
[inline, static]
 

return x += y;

bool areEqual const Element   x,
const Element   y
[inline, static]
 

Test if x == y.

Element& assign Element   x,
const Element   y
[inline, static]
 

x = y.

Element& axpy Element   r,
const Element   a,
const Int &    x,
const Element   y
[inline, static]
 

return r = a x + y

Element& axpyin Element   r,
const Element   a,
const Int &    x
[inline, static]
 

return r += a x

NTL::ZZ& cardinality NTL::ZZ &    c [inline, static]
 

integer& cardinality integer   c [inline, static]
 

integer& characteristic integer   c [inline, static]
 

integer& convert integer   x,
const Element   y
[inline, static]
 

Convert y to an Element.

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.

Element& divin Element   x,
const Element   y
[inline, static]
 

If y divides x, return x /= y, otherwise throw an exception.

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.

Element& gcd Element   g,
const Element   a,
const Element   b
[inline, static]
 

return g = gcd (a, b)

Element& gcdin Element   g,
const Element   b
[inline, static]
 

return g = gcd (g, b)

integer getMaxModulus   [inline, static]
 

Element& init Element   x,
const integer   y
[inline, static]
 

I don't know how to init from integer.

Element& init Element   x,
const Element   y
[inline, static]
 

Init from a NTL::ZZ_p.

Element& init Element   x,
const Element2 &    y
[inline, static]
 

Init x from y.

Element& inv Element   x,
const Element   y
[inline, static]
 

If y is a unit, return x = 1 / y, otherwsie, throw an exception.

Element& invin Element   x [inline, static]
 

If x is a unit, x = 1 / x, otherwise, throw an exception.

bool isDivisor const Element   a,
const Element   b
[inline, static]
 

Test if a | b.

bool isOne const Element   x [inline, static]
 

Test if x == 1.

bool isUnit const Element   x [inline, static]
 

Test if x is a unit.

bool isZero const Element   x [inline, static]
 

Test if x == 0.

Element& mul Element   x,
const Element   y,
const Int &    z
[inline, static]
 

return x = y * z

Element& mulin Element   x,
const Int &    y
[inline, static]
 

return x *= y;

Element& neg Element   x,
const Element   y
[inline, static]
 

return x = -y;

Element& negin Element   x [inline, static]
 

return x = -x;

Element& normal Element   a,
const Element   b
[inline, static]
 

a = normalization of b.

Element& normalIn Element   a [inline, static]
 

std::istream& read std::istream &    in,
Element   x
[inline, static]
 

read x from istream in

std::istream& read std::istream &    in [inline]
 

Element& sub Element   x,
const Element   y,
const Element   z
[inline, static]
 

return x = y - z

Element& subin Element   x,
const Element   y
[inline, static]
 

return x -= y;

std::ostream& write std::ostream &    out,
const Element   y
[inline, static]
 

out << y;

std::ostream& write std::ostream &    out [inline, 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.


Generated on Mon Jun 20 09:16:55 2005 for linbox by doxygen1.2.18