Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

GF2 Class Reference

#include <gf2.h>

Inheritance diagram for GF2:

FieldInterface

Public Types

typedef bool Element
typedef GF2RandIter RandIter

Public Member Functions

Object Management
 GF2 (int p=2, int exp=1)
 GF2 (const GF2 &F)
const GF2operator= (const GF2 &F)
Elementinit (Element &x, const integer &y=0) const
BitVector::reference init (BitVector::reference x, const integer &y=0) const
std::_Bit_reference init (std::_Bit_reference x, const integer &y=0) const
integerconvert (integer &x, Element y) const
Elementassign (Element &x, Element y) const
BitVector::reference assign (BitVector::reference x, Element y) const
std::_Bit_reference assign (std::_Bit_reference x, 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 base elements will give undefined results.

bool areEqual (Element x, Element y) const
bool isZero (Element x) const
bool isOne (Element x) const
Input/Output Operations
std::ostream & write (std::ostream &os) const
std::istream & read (std::istream &is)
std::ostream & write (std::ostream &os, Element x) const
std::istream & read (std::istream &is, Element &x) const
std::istream & read (std::istream &is, BitVector::reference x) const
std::istream & read (std::istream &is, std::_Bit_reference x) 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 base elements will give undefined results.

Elementadd (Element &x, Element y, Element z) const
BitVector::reference add (BitVector::reference x, Element y, Element z) const
std::_Bit_reference add (std::_Bit_reference x, Element y, Element z) const
Elementsub (Element &x, Element y, Element z) const
BitVector::reference sub (BitVector::reference x, Element y, Element z) const
std::_Bit_reference sub (std::_Bit_reference x, Element y, Element z) const
Elementmul (Element &x, Element y, Element z) const
BitVector::reference mul (BitVector::reference x, Element y, Element z) const
std::_Bit_reference mul (std::_Bit_reference x, Element y, Element z) const
Elementdiv (Element &x, Element y, Element z) const
BitVector::reference div (BitVector::reference x, Element y, Element z) const
std::_Bit_reference div (std::_Bit_reference x, Element y, Element z) const
Elementneg (Element &x, Element y) const
BitVector::reference neg (BitVector::reference x, Element y) const
std::_Bit_reference neg (std::_Bit_reference x, Element y) const
Elementinv (Element &x, Element y) const
BitVector::reference inv (BitVector::reference x, Element y) const
std::_Bit_reference inv (std::_Bit_reference x, Element y) const
BitVector::reference axpy (BitVector::reference r, Element a, Element x, Element y) const
std::_Bit_reference axpy (std::_Bit_reference r, Element a, Element x, Element y) const
Elementaxpy (Element &r, Element a, Element x, Element y) const
Inplace Arithmetic Operations
x <- x op y; x <- op x

Elementaddin (Element &x, Element y) const
BitVector::reference addin (BitVector::reference x, Element y) const
Elementaddin (std::_Bit_reference x, Element y) const
Elementsubin (Element &x, Element y) const
BitVector::reference subin (BitVector::reference x, Element y) const
Elementsubin (std::_Bit_reference x, Element y) const
Elementmulin (Element &x, Element y) const
BitVector::reference mulin (BitVector::reference x, Element y) const
Elementmulin (std::_Bit_reference x, Element y) const
Elementdivin (Element &x, Element y) const
BitVector::reference divin (BitVector::reference x, Element y) const
std::_Bit_reference divin (std::_Bit_reference x, Element y) const
Elementnegin (Element &x) const
BitVector::reference negin (BitVector::reference x) const
std::_Bit_reference negin (std::_Bit_reference x) const
Elementinvin (Element &x) const
BitVector::reference invin (BitVector::reference x) const
std::_Bit_reference invin (std::_Bit_reference x) const
Elementaxpyin (Element &r, Element a, Element x) const
BitVector::reference axpyin (BitVector::reference r, Element a, Element x) const
Elementaxpyin (std::_Bit_reference r, Element a, Element x) const

Static Public Member Functions

int getMaxModulus ()

Member Typedef Documentation

typedef bool Element
 

Element type

typedef GF2RandIter RandIter
 

Random iterator generator type. It must meet the common object interface of random element generators as given in the the archetype RandIterArchetype.


Constructor & Destructor Documentation

GF2 int  p = 2,
int  exp = 1
[inline]
 

Default constructor.

GF2 const GF2 F  )  [inline]
 

Copy constructor. Constructs Modular object by copying the field. This is required to allow field objects to be passed by value into functions.

Parameters:
F Modular object.


Member Function Documentation

const GF2& operator= const GF2 F  )  [inline]
 

Assignment operator Required by the archetype

Parameters:
F constant reference to Modular object
Returns:
reference to Modular object for self

Element& init Element x,
const integer y = 0
const [inline]
 

Initialization of field base element from an integer. Behaves like C++ allocator construct. This function assumes the output field base element x has already been constructed, but that it is not already initialized. This is not a specialization of the template function because such a specialization is not allowed inside the class declaration.

Returns:
reference to field base element.
Parameters:
x field base element to contain output (reference returned).
y integer.

BitVector::reference init BitVector::reference  x,
const integer y = 0
const [inline]
 

std::_Bit_reference init std::_Bit_reference  x,
const integer y = 0
const [inline]
 

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

Conversion of field base element to a template class T. This function assumes the output field base element x has already been constructed, but that it is not already initialized.

Returns:
reference to template class T.
Parameters:
x template class T to contain output (reference returned).
y constant field base element.

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

Assignment of one field base element to another. This function assumes both field base elements have already been constructed and initialized.

Returns:
reference to x
Parameters:
x field base element (reference returned).
y field base element.

BitVector::reference assign BitVector::reference  x,
Element  y
const [inline]
 

std::_Bit_reference assign std::_Bit_reference  x,
Element  y
const [inline]
 

integer& cardinality integer c  )  const [inline]
 

Cardinality. Return integer representing cardinality of the domain. Returns a non-negative integer for all domains with finite cardinality, and returns -1 to signify a domain of infinite cardinality.

Returns:
integer representing cardinality of the domain

integer& characteristic integer c  )  const [inline]
 

Characteristic. Return integer representing characteristic of the domain. Returns a positive integer to all domains with finite characteristic, and returns 0 to signify a domain of infinite characteristic.

Returns:
integer representing characteristic of the domain.

bool areEqual Element  x,
Element  y
const [inline]
 

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

Returns:
boolean true if equal, false if not.
Parameters:
x field base element
y field base element

bool isZero Element  x  )  const [inline]
 

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

Returns:
boolean true if equals zero, false if not.
Parameters:
x field base element.

bool isOne Element  x  )  const [inline]
 

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

Returns:
boolean true if equals one, false if not.
Parameters:
x field base element.

std::ostream& write std::ostream &  os  )  const [inline]
 

Print field.

Returns:
output stream to which field is written.
Parameters:
os output stream to which field is written.

std::istream& read std::istream &  is  )  [inline]
 

Read field.

Returns:
input stream from which field is read.
Parameters:
is input stream from which field is read.

std::ostream& write std::ostream &  os,
Element  x
const [inline]
 

Print field base element. This function assumes the field base element has already been constructed and initialized.

Returns:
output stream to which field base element is written.
Parameters:
os output stream to which field base element is written.
x field base element.

std::istream& read std::istream &  is,
Element x
const [inline]
 

Read field base element. This function assumes the field base element has already been constructed and initialized.

Returns:
input stream from which field base element is read.
Parameters:
is input stream from which field base element is read.
x field base element.

std::istream& read std::istream &  is,
BitVector::reference  x
const [inline]
 

std::istream& read std::istream &  is,
std::_Bit_reference  x
const [inline]
 

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

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

Returns:
reference to x.
Parameters:
x field base element (reference returned).
y field base element.
z field base element.

BitVector::reference add BitVector::reference  x,
Element  y,
Element  z
const [inline]
 

std::_Bit_reference add std::_Bit_reference  x,
Element  y,
Element  z
const [inline]
 

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

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

Returns:
reference to x.
Parameters:
x field base element (reference returned).
y field base element.
z field base element.

BitVector::reference sub BitVector::reference  x,
Element  y,
Element  z
const [inline]
 

std::_Bit_reference sub std::_Bit_reference  x,
Element  y,
Element  z
const [inline]
 

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

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

Returns:
reference to x.
Parameters:
x field base element (reference returned).
y field base element.
z field base element.

BitVector::reference mul BitVector::reference  x,
Element  y,
Element  z
const [inline]
 

std::_Bit_reference mul std::_Bit_reference  x,
Element  y,
Element  z
const [inline]
 

Element& div Element x,
Element  y,
Element  z
const [inline]
 

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

Returns:
reference to x.
Parameters:
x field base element (reference returned).
y field base element.
z field base element.

BitVector::reference div BitVector::reference  x,
Element  y,
Element  z
const [inline]
 

std::_Bit_reference div std::_Bit_reference  x,
Element  y,
Element  z
const [inline]
 

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

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

Returns:
reference to x.
Parameters:
x field base element (reference returned).
y field base element.

BitVector::reference neg BitVector::reference  x,
Element  y
const [inline]
 

std::_Bit_reference neg std::_Bit_reference  x,
Element  y
const [inline]
 

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

Multiplicative Inverse. x = 1 / y This function assumes both field base elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
x field base element (reference returned).
y field base element.

BitVector::reference inv BitVector::reference  x,
Element  y
const [inline]
 

std::_Bit_reference inv std::_Bit_reference  x,
Element  y
const [inline]
 

BitVector::reference axpy BitVector::reference  r,
Element  a,
Element  x,
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:
r field element (reference returned).
a field element.
x field element.
y field element.

std::_Bit_reference axpy std::_Bit_reference  r,
Element  a,
Element  x,
Element  y
const [inline]
 

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

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

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

Returns:
reference to x.
Parameters:
x field base element (reference returned).
y field base element.

BitVector::reference addin BitVector::reference  x,
Element  y
const [inline]
 

Element& addin std::_Bit_reference  x,
Element  y
const [inline]
 

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

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

Returns:
reference to x.
Parameters:
x field base element (reference returned).
y field base element.

BitVector::reference subin BitVector::reference  x,
Element  y
const [inline]
 

Element& subin std::_Bit_reference  x,
Element  y
const [inline]
 

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

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

Returns:
reference to x.
Parameters:
x field base element (reference returned).
y field base element.

BitVector::reference mulin BitVector::reference  x,
Element  y
const [inline]
 

Element& mulin std::_Bit_reference  x,
Element  y
const [inline]
 

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

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

Returns:
reference to x.
Parameters:
x field base element (reference returned).
y field base element.

BitVector::reference divin BitVector::reference  x,
Element  y
const [inline]
 

std::_Bit_reference divin std::_Bit_reference  x,
Element  y
const [inline]
 

Element& negin Element x  )  const [inline]
 

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

Returns:
reference to x.
Parameters:
x field base element (reference returned).

BitVector::reference negin BitVector::reference  x  )  const [inline]
 

std::_Bit_reference negin std::_Bit_reference  x  )  const [inline]
 

Element& invin Element x  )  const [inline]
 

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

Returns:
reference to x.
Parameters:
x field base element (reference returned).

BitVector::reference invin BitVector::reference  x  )  const [inline]
 

std::_Bit_reference invin std::_Bit_reference  x  )  const [inline]
 

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

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

Returns:
reference to r.
Parameters:
r field element (reference returned).
a field element.
x field element.

BitVector::reference axpyin BitVector::reference  r,
Element  a,
Element  x
const [inline]
 

Element& axpyin std::_Bit_reference  r,
Element  a,
Element  x
const [inline]
 

int getMaxModulus  )  [inline, static]
 


Generated on Fri Jul 8 10:29:51 2005 for linbox by doxygen 1.3.7