linbox
Public Member Functions | Static Public Member Functions
PIR_ntl_ZZ_p Class Reference

extend Wrapper of ZZ_p from NTL. More...

#include <pir-ntl-zz_p.h>

+ Inheritance diagram for PIR_ntl_ZZ_p:
+ Collaboration diagram for PIR_ntl_ZZ_p:

Public Member Functions

template<class Element2 >
Element & init (Element &x, const Element2 &y) const
 Init x from y.
 
Element & init (Element &x, const Element &y) const
 Init from a NTL::ZZ_p.
 
Element & init (Element &x, const integer &y) const
 I don't know how to init from integer.
 
integerconvert (integer &x, const Element &y) const
 Convert y to an Element.
 
Element & assign (Element &x, const Element &y) const
 x = y.
 
bool areEqual (const Element &x, const Element &y) const
 Test if x == y.
 
bool isZero (const Element &x) const
 Test if x == 0.
 
bool isOne (const Element &x) const
 Test if x == 1.
 
Element & add (Element &x, const Element &y, const Element &z) const
 return x = y + z
 
Element & sub (Element &x, const Element &y, const Element &z) const
 return x = y - z
 
template<class Int >
Element & mul (Element &x, const Element &y, const Int &z) const
 return x = y * z
 
Element & div (Element &x, const Element &y, const Element &z) const
 If exists a, such that a * z =y, return x = one of them. More...
 
Element & inv (Element &x, const Element &y) const
 If y is a unit, return x = 1 / y, otherwsie, throw an exception.
 
Element & neg (Element &x, const Element &y) const
 return x = -y;
 
template<class Int >
const Element & axpy (Element &r, const Element &a, const Int &x, const Element &y) const
 return r = a x + y
 
Element & addin (Element &x, const Element &y) const
 return x += y;
 
Element & subin (Element &x, const Element &y) const
 return x -= y;
 
template<class Int >
Element & mulin (Element &x, const Int &y) const
 return x *= y;
 
const Element & divin (Element &x, const Element &y) const
 If y divides x, return x /= y, otherwise throw an exception.
 
Element & invin (Element &x) const
 If x is a unit, x = 1 / x, otherwise, throw an exception.
 
Element & negin (Element &x) const
 return x = -x;
 
template<class Int >
Element & axpyin (Element &r, const Element &a, const Int &x) const
 return r += a x
 
std::ostream & write (std::ostream &out, const Element &y) const
 out << y;
 
bool isUnit (const Element &x) const
 some PIR function More...
 
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...
 

Static Public Member Functions

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. More...
 
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. More...
 
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.
 

Detailed Description

extend Wrapper of ZZ_p from NTL.

Add PIR functions

Examples:
examples/smith.C.

Member Function Documentation

◆ div()

Element& div ( Element &  x,
const Element &  y,
const Element &  z 
) const
inline

If exists a, such that a * z =y, return x = one of them.

Otherwise, throw an exception

◆ isUnit()

bool isUnit ( const Element &  x) const
inline

some PIR function

Test if x is a unit.

◆ xgcd()

static Element& xgcd ( Element &  g,
Element &  s,
Element &  t,
const Element &  a,
const Element &  b 
)
inlinestatic

g = gcd(a, b) = a*s + b*t.

and gcd (s, t) is a unit.

◆ dxgcd()

static Element& dxgcd ( Element &  g,
Element &  s,
Element &  t,
Element &  a1,
Element &  b1,
const Element &  a,
const Element &  b 
)
inlinestatic

g = gcd(a, b) = a*s + b*t.

and gcd (s, t) is a unit. s * a1 + t * b1 = a unit.

◆ init()

Element& init ( Element &  x,
const NTL::ZZ &  y 
) const
inlineinherited

Specialization for NTL::ZZ.

Returns
reference to field element.
Parameters
xfield element to contain output (reference returned)
yNTL::ZZ.

◆ convert()

NTL::ZZ& convert ( NTL::ZZ &  x,
const Element &  y 
) const
inlineinherited

Specialization for NTL::ZZ.

Returns
reference to NTL::ZZ
Parameters
xNTL::ZZ to contain output (reference returned).
yconstant reference to field element.

The documentation for this class was generated from the following file: