linbox  1
Public Types | Public Member Functions
LidiaGfq Class Reference

defines the Galois Field GF(pk). More...

#include <lidia-gfq.h>

Inheritance diagram for LidiaGfq:
FieldInterface

List of all members.

Public Types

typedef LiDIA::gf_element Element
typedef LidiaGfqRandIter
< LidiaGfq
RandIter

Public Member Functions

 LidiaGfq ()
 LidiaGfq (const integer &p, const integer &k=1)
 Constructor of GF(p^k).
 LidiaGfq (const LidiaGfq &F)
 ~LidiaGfq ()
LidiaGfqoperator= (const LidiaGfq &F)
Object management
Elementinit (Element &x, const integer &y=0) const
integerconvert (integer &x, const Element &y) const
Elementassign (Element &x, const Element &y) const
integercardinality (integer &c) const
integercharacteristic (integer &c) const
Arithmetic Operations

x <- y op z; x <- op y These operations require all Elements, including x, to be initialized before the operation is called. Uninitialized field Elements will give undefined results.

bool areEqual (const Element &x, const Element &y) const
Elementadd (Element &x, const Element &y, const Element &z) const
Elementsub (Element &x, const Element &y, const Element &z) const
Elementmul (Element &x, const Element &y, const Element &z) const
Elementdiv (Element &x, const Element &y, const Element &z) const
Elementneg (Element &x, const Element &y) const
Elementinv (Element &x, const Element &y) const
Elementaxpy (Element &r, const Element &a, const Element &x, const Element &y) const
bool isZero (const Element &x) const
bool isOne (const Element &x) const
Elementaddin (Element &x, const Element &y) const
Elementsubin (Element &x, const Element &y) const
Elementmulin (Element &x, const Element &y) const
Elementdivin (Element &x, const Element &y) const
Elementnegin (Element &x) const
Elementinvin (Element &x) const
Elementaxpyin (Element &r, const Element &a, const Element &x) const
Input/Output Operations
std::ostream & write (std::ostream &os) const
std::istream & read (std::istream &is) const
std::ostream & write (std::ostream &os, const Element &e) const
std::istream & read (std::istream &is, Element &e) const

Detailed Description

defines the Galois Field GF(pk).

Inherits from galois_field of LiDIA. p must be prime.


Member Typedef Documentation

typedef LiDIA::gf_element Element

Element type. This type is inherited from the LiDIA class LiDIA::gf_element

typedef LidiaGfqRandIter<LidiaGfq> RandIter

Random element generator which is define in the wrapper LIDIA_randiter


Constructor & Destructor Documentation

LidiaGfq ( )
inline

Default constructor of the field

LidiaGfq ( const integer p,
const integer k = 1 
)
inline

Constructor of GF(p^k).

A GF(p^k) field is constructed through the constructor of LiDIA LiDIA::galois_field We need a double cast to pass integer arguments to the LiDIA constructor

LidiaGfq ( const LidiaGfq F)
inline

Copy constructor

~LidiaGfq ( )
inline

Destructor


Member Function Documentation

LidiaGfq& operator= ( const LidiaGfq F)
inline

Assignment operator. Assigns unparam_field object F to field.

Parameters:
Funparam_field object.
Element& init ( Element x,
const integer y = 0 
) const
inline

Initialization of field Element from an integer. Behaves like C++ allocator construct. This function assumes the output field Element x has already been constructed, but that it is not already initialized. We also need to define the Element over the field. So what we always initialize the Element with the zero field value. If an integer different from zero is passed to the function the Element is initialized to a constant polynom of Z/pZ

Returns:
reference to field Element.
Parameters:
xfield Element to contain output (reference returned).
yinteger.
integer& convert ( integer x,
const Element y 
) const
inline

Conversion of field base Element to an integer. This function assumes the output field base Element x has already been constructed, but that it is not already initialized. As Elements are represented by polynom the convert function return the valuation of polynom in characteristic by the Horner Method. That keeps unicity of each Element.

Returns:
reference to an integer.
Parameters:
xinteger to contain output (reference returned).
yconstant field base Element.
Element& assign ( Element x,
const Element y 
) const
inline

Assignment of one field Element to another. This function assumes both field Elements have already been constructed and initialized.

Returns:
reference to x
Parameters:
xfield Element (reference returned).
yfield Element.
integer& cardinality ( integer c) const
inline

Cardinality. Return integer representing cardinality of the field. Returns p^k.

Returns:
constant reference to integer representing cardinality of the field.
integer& characteristic ( integer c) const
inline

Characteristic. Return integer representing characteristic of the field. Returns p.

Returns:
constant reference to integer representing characteristic of the field.
bool areEqual ( const Element x,
const Element y 
) const
inline

Equality of two Elements. This function assumes both field Elements have already been constructed and initialized.

Returns:
boolean true if equal, false if not.
Parameters:
xfield Element
yfield Element
Element& add ( Element x,
const Element y,
const Element z 
) const
inline

Addition. x = y + z This function assumes all the field Elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield Element (reference returned).
yfield Element.
zfield Element.
Element& sub ( Element x,
const Element y,
const Element z 
) const
inline

Subtraction. x = y - z This function assumes all the field Elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield Element (reference returned).
yfield Element.
zfield Element.
Element& mul ( Element x,
const Element y,
const Element z 
) const
inline

Multiplication. x = y * z This function assumes all the field Elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield Element (reference returned).
yfield Element.
zfield Element.
Element& div ( Element x,
const Element y,
const Element z 
) const
inline

Division. x = y / z This function assumes all the field Elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield Element (reference returned).
yfield Element.
zfield Element.
Element& neg ( Element x,
const Element y 
) const
inline

Additive Inverse (Negation). x = - y This function assumes both field Elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield Element (reference returned).
yfield Element.
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.

Returns:
reference to x.
Parameters:
xfield Element (reference returned).
yfield Element.
Element& axpy ( Element r,
const Element a,
const Element x,
const Element y 
) const
inline

Natural AXPY. r = a * x + y This function assumes all field Elements have already been constructed and initialized.

Returns:
reference to r.
Parameters:
rfield Element (reference returned).
afield Element.
xfield Element.
yfield Element.
bool isZero ( const Element x) const
inline

Zero equality. Test if field Element is equal to zero of field. This function assumes the field Element has already been constructed and initialized.

Returns:
boolean true if equals zero of field, false if not.
Parameters:
xfield Element.
bool isOne ( const Element x) const
inline

One equality. Test if field Element is equal to one of field. This function assumes the field Element has already been constructed and initialized.

Returns:
boolean true if equals one of field, false if not.
Parameters:
xfield Element.
Element& addin ( Element x,
const Element y 
) const
inline

Inplace Addition. x += y This function assumes both field Elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield Element (reference returned).
yfield Element.
Element& subin ( Element x,
const Element y 
) const
inline

Inplace Subtraction. x -= y This function assumes both field Elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield Element (reference returned).
yfield Element.
Element& mulin ( Element x,
const Element y 
) const
inline

Inplace Multiplication. x *= y This function assumes both field Elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield Element (reference returned).
yfield Element.
Element& divin ( Element x,
const Element y 
) const
inline

Inplace Division. x /= y This function assumes both field Elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield Element (reference returned).
yfield Element.
Element& negin ( Element x) const
inline

Inplace Additive Inverse (Inplace Negation). x = - x This function assumes the field Element has already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield Element (reference returned).
Element& invin ( Element x) const
inline

Inplace Multiplicative Inverse. x = 1 / x This function assumes the field Elementhas already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield Element (reference returned).
Element& axpyin ( Element r,
const Element a,
const Element x 
) const
inline

Inplace AXPY. r += a * x This function assumes all field Elements have already been constructed and initialized.

Returns:
reference to r.
Parameters:
rfield Element (reference returned).
afield Element.
xfield Element.
std::ostream& write ( std::ostream &  os) const
inline

Print field.

Returns:
output stream to which field is written.
Parameters:
osoutput stream to which field is written.
std::istream& read ( std::istream &  is) const
inline

Read field.

Returns:
input stream from which field is read.
Parameters:
isinput stream from which field is read.
std::ostream& write ( std::ostream &  os,
const Element e 
) const
inline

Print field Element like a polynom.

Returns:
output stream to which field Element is written.
Parameters:
osoutput stream to which field Element is written.
xfield Element.
std::istream& read ( std::istream &  is,
Element e 
) const
inline

Read field Element.

Returns:
input stream from which field Element is read.
Parameters:
isinput stream from which field Element is read.
xfield Element.

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