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

FieldEnvelope Class Template Reference

#include <envelope.h>

Inheritance diagram for FieldEnvelope:

FieldAbstract List of all members.

Detailed Description

template<class Field>
class LinBox::FieldEnvelope< Field >

Field Envelope Template. Derived class used to implement the field archetype to minimize code bloat. This class implements all purely virtual member functions of the abstract base class. This class is used to wrap a \Ref{LinBox} field so that it might be used with the Field archetype.


Public Types

typedef ElementEnvelope< FieldElement
typedef RandIterEnvelope<
Field
RandIter

Public Methods

Object Management
 FieldEnvelope (void)
 FieldEnvelope (const Field &F)
 FieldEnvelope (const FieldEnvelope &E)
FieldAbstractclone () const
FieldAbstractoperator= (const FieldAbstract &F)
ElementAbstractinit (ElementAbstract &x, const integer &y=0) const
integerconvert (integer &x, const ElementAbstract &y) const
ElementAbstractassign (ElementAbstract &x, const ElementAbstract &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.

Object Management bool areEqual (const ElementAbstract &x, const ElementAbstract &y) const
ElementAbstractadd (ElementAbstract &x, const ElementAbstract &y, const ElementAbstract &z) const
ElementAbstractsub (ElementAbstract &x, const ElementAbstract &y, const ElementAbstract &z) const
ElementAbstractmul (ElementAbstract &x, const ElementAbstract &y, const ElementAbstract &z) const
ElementAbstractdiv (ElementAbstract &x, const ElementAbstract &y, const ElementAbstract &z) const
ElementAbstractneg (ElementAbstract &x, const ElementAbstract &y) const
ElementAbstractinv (ElementAbstract &x, const ElementAbstract &y) const
ElementAbstractaxpy (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x, const ElementAbstract &y) const
Inplace Arithmetic Operations
x <- x op y; x <- op x

Arithmetic Operations bool isZero (const ElementAbstract &x) const
bool isOne (const ElementAbstract &x) const
ElementAbstractaddin (ElementAbstract &x, const ElementAbstract &y) const
ElementAbstractsubin (ElementAbstract &x, const ElementAbstract &y) const
ElementAbstractmulin (ElementAbstract &x, const ElementAbstract &y) const
ElementAbstractdivin (ElementAbstract &x, const ElementAbstract &y) const
ElementAbstractnegin (ElementAbstract &x) const
ElementAbstractinvin (ElementAbstract &x) const
ElementAbstractaxpyin (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x) const
Input/Output Operations
Inplace Arithmetic Operations
std::ostream & 
write (std::ostream &os) const
std::istream & read (std::istream &is)
std::ostream & write (std::ostream &os, const ElementAbstract &x) const
std::istream & read (std::istream &is, ElementAbstract &x) const

Protected Attributes

Field _field
 Wrapped field.


Friends

class RandIterEnvelope< Field >


Member Typedef Documentation

typedef ElementEnvelope<Field> Element
 

element type. It is derived from the class ElementAbstract, and it must contain a wrapped field element.

Reimplemented from FieldAbstract.

Reimplemented in RingEnvelope.

typedef RandIterEnvelope<Field> RandIter
 

Random iterator generator type. It is derived from the class RandIterAbstract, and it must contain a wrapped field random iterator generator.

Reimplemented from FieldAbstract.

Reimplemented in RingEnvelope.


Constructor & Destructor Documentation

FieldEnvelope void    [inline]
 

Default constructor. In this implementation, this means copying the field {\tt E.\_field}.

FieldEnvelope const Field   F [inline]
 

Constructor from field to be wrapped.

Parameters:
F  Field object to be wrapped.

FieldEnvelope const FieldEnvelope< Field > &    E [inline]
 

Copy constructor. Constructs FieldEnvelope object by copying the field. This is required to allow field objects to be passed by value into functions. In this implementation, this means copying the field {\tt E.\_field}.

Parameters:
E  FieldEnvelope object.


Member Function Documentation

ElementAbstract& add ElementAbstract   x,
const ElementAbstract   y,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& addin ElementAbstract   x,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

Object Management bool areEqual const ElementAbstract   x,
const ElementAbstract   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

Reimplemented in RingEnvelope.

ElementAbstract& assign ElementAbstract   x,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& axpy ElementAbstract   r,
const ElementAbstract   a,
const ElementAbstract   x,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& axpyin ElementAbstract   r,
const ElementAbstract   a,
const ElementAbstract   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:
r  field element (reference returned).
a  field element.
x  field element.

Reimplemented in RingEnvelope.

integer& cardinality integer   c const [inline, virtual]
 

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

Implements FieldAbstract.

Reimplemented in RingEnvelope.

integer& characteristic integer   c const [inline, virtual]
 

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.

Implements FieldAbstract.

Reimplemented in RingEnvelope.

FieldAbstract* clone   const [inline, virtual]
 

Virtual copy constructor. Required because constructors cannot be virtual. Passes construction on to derived classes. This function is not part of the common object interface.

Returns:
pointer to new object in dynamic memory.

Implements FieldAbstract.

Reimplemented in RingEnvelope.

integer& convert integer   x,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& div ElementAbstract   x,
const ElementAbstract   y,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& divin ElementAbstract   x,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& init ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& inv ElementAbstract   x,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& invin ElementAbstract   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).

Reimplemented in RingEnvelope.

bool isOne const ElementAbstract   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.

Reimplemented in RingEnvelope.

Arithmetic Operations bool isZero const ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& mul ElementAbstract   x,
const ElementAbstract   y,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& mulin ElementAbstract   x,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& neg ElementAbstract   x,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& negin ElementAbstract   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).

Reimplemented in RingEnvelope.

FieldAbstract& operator= const FieldAbstract   F [inline, virtual]
 

Assignment operator. Required by abstract base class.

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

Implements FieldAbstract.

Reimplemented in RingEnvelope.

std::istream& read std::istream &    is,
ElementAbstract   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.

Reimplemented in RingEnvelope.

std::istream& read std::istream &    is [inline, virtual]
 

Read field.

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

Implements FieldAbstract.

Reimplemented in RingEnvelope.

ElementAbstract& sub ElementAbstract   x,
const ElementAbstract   y,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

ElementAbstract& subin ElementAbstract   x,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

std::ostream& write std::ostream &    os,
const ElementAbstract   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.

Reimplemented in RingEnvelope.

Inplace Arithmetic Operations std::ostream& write std::ostream &    os const [inline, virtual]
 

Print field.

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

Implements FieldAbstract.

Reimplemented in RingEnvelope.


Friends And Related Function Documentation

friend class RandIterEnvelope< Field > [friend]
 


Member Data Documentation

Field _field [protected]
 

Wrapped field.


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