linbox  1
Public Types
RingEnvelope< Ring > Class Template Reference

implement the ring 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 {LinBox} ring so that it might be used with the Ring archetype. More...

#include <envelope.h>

Inheritance diagram for RingEnvelope< Ring >:
RingAbstract FieldEnvelope< Ring > FieldAbstract FieldAbstract

List of all members.

Public Types

typedef FieldEnvelope< Ring >
::Element 
Element
typedef FieldEnvelope< Ring >
::RandIter 
RandIter

Object Management

class RandIterEnvelope< Ring >
 RingEnvelope (void)
 RingEnvelope (const Ring &F)
 RingEnvelope (const RingEnvelope &E)
FieldAbstractclone () const
RingAbstractoperator= (const RingAbstract &F)
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
ElementAbstractneg (ElementAbstract &x, const ElementAbstract &y) const
ElementAbstractinv (ElementAbstract &x, const ElementAbstract &y) const
ElementAbstractnegin (ElementAbstract &x) const
ElementAbstractinvin (ElementAbstract &x) const
integercardinality (integer &c) const
integercharacteristic (integer &c) const
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
ElementAbstractaxpy (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x, const ElementAbstract &y) const
ElementAbstractaddin (ElementAbstract &x, const ElementAbstract &z) const
ElementAbstractsubin (ElementAbstract &x, const ElementAbstract &z) const
ElementAbstractmulin (ElementAbstract &x, const ElementAbstract &z) const
ElementAbstractdivin (ElementAbstract &x, const ElementAbstract &z) const
ElementAbstractaxpyin (ElementAbstract &r, const ElementAbstract &x, const ElementAbstract &y) const
bool isZero (const ElementAbstract &x) const
bool isOne (const ElementAbstract &x) const
bool isUnit (const ElementAbstract &x) const
bool isZeroDivisor (const ElementAbstract &x) const
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

Detailed Description

template<class Ring>
class LinBox::RingEnvelope< Ring >

implement the ring 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 {LinBox} ring so that it might be used with the Ring archetype.


Member Typedef Documentation

typedef FieldEnvelope<Ring>::Element Element

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

Reimplemented from RingAbstract.

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

Reimplemented from RingAbstract.


Constructor & Destructor Documentation

RingEnvelope ( void  ) [inline]

Default constructor. In this implementation, this means copying the ring { E.}.

RingEnvelope ( const Ring &  F) [inline]

Constructor from ring to be wrapped.

Parameters:
FRing object to be wrapped.
RingEnvelope ( const RingEnvelope< Ring > &  E) [inline]

Copy constructor. Constructs RingEnvelope object by copying the ring. This is required to allow ring objects to be passed by value into functions. In this implementation, this means copying the ring { E.}.

Parameters:
ERingEnvelope object.

Member Function Documentation

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.

Reimplemented from FieldEnvelope< Ring >.

RingAbstract& operator= ( const RingAbstract F) [inline]

Assignment operator. Required by abstract base class.

Returns:
reference to RingAbstract object for self
Parameters:
Fconstant reference to RingAbstract object
FieldAbstract& operator= ( const FieldAbstract F) [inline, virtual]

Assignment operator. Required by abstract base class.

Returns:
reference to RingAbstract object for self
Parameters:
Fconstant reference to RingAbstract object

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& init ( ElementAbstract x,
const integer y = 0 
) const [inline, virtual]

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:
xfield base element to contain output (reference returned).
yinteger.

Reimplemented from FieldEnvelope< Ring >.

integer& convert ( integer x,
const ElementAbstract y 
) const [inline, virtual]

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:
xtemplate class T to contain output (reference returned).
yconstant field base element.

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& assign ( ElementAbstract x,
const ElementAbstract y 
) const [inline, virtual]

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:
xfield base element (reference returned).
yfield base element.

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& neg ( ElementAbstract x,
const ElementAbstract y 
) const [inline, virtual]

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

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

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& inv ( ElementAbstract x,
const ElementAbstract y 
) const [inline, virtual]

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

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

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& negin ( ElementAbstract x) const [inline, virtual]

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:
xfield base element (reference returned).

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& invin ( ElementAbstract x) const [inline, virtual]

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

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

Reimplemented from FieldEnvelope< Ring >.

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

Reimplemented from FieldEnvelope< Ring >.

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.

Reimplemented from FieldEnvelope< Ring >.

bool areEqual ( const ElementAbstract x,
const ElementAbstract y 
) const [inline, virtual]

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:
xfield base element
yfield base element

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& add ( ElementAbstract x,
const ElementAbstract y,
const ElementAbstract z 
) const [inline, virtual]

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

Returns:
reference to x.
Parameters:
xfield base element (reference returned).
yfield base element.
zfield base element.

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& sub ( ElementAbstract x,
const ElementAbstract y,
const ElementAbstract z 
) const [inline, virtual]

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

Returns:
reference to x.
Parameters:
xfield base element (reference returned).
yfield base element.
zfield base element.

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& mul ( ElementAbstract x,
const ElementAbstract y,
const ElementAbstract z 
) const [inline, virtual]

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

Returns:
reference to x.
Parameters:
xfield base element (reference returned).
yfield base element.
zfield base element.

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& div ( ElementAbstract x,
const ElementAbstract y,
const ElementAbstract z 
) const [inline, virtual]

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

Returns:
reference to x.
Parameters:
xfield base element (reference returned).
yfield base element.
zfield base element.

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& axpy ( ElementAbstract r,
const ElementAbstract a,
const ElementAbstract x,
const ElementAbstract y 
) const [inline, virtual]

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.

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& addin ( ElementAbstract x,
const ElementAbstract y 
) const [inline, virtual]

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

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

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& subin ( ElementAbstract x,
const ElementAbstract y 
) const [inline, virtual]

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

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

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& mulin ( ElementAbstract x,
const ElementAbstract y 
) const [inline, virtual]

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

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

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& divin ( ElementAbstract x,
const ElementAbstract y 
) const [inline, virtual]

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

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

Reimplemented from FieldEnvelope< Ring >.

ElementAbstract& axpyin ( ElementAbstract r,
const ElementAbstract a,
const ElementAbstract x 
) const [inline, virtual]

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.

Reimplemented from FieldEnvelope< Ring >.

bool isZero ( const ElementAbstract x) const [inline, virtual]

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:
xfield base element.

Reimplemented from FieldEnvelope< Ring >.

bool isOne ( const ElementAbstract x) const [inline, virtual]

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:
xfield base element.

Reimplemented from FieldEnvelope< Ring >.

bool isUnit ( const ElementAbstract x) const [inline, virtual]

Invertibility test. Test if ring element is invertible. This function assumes the ring element has already been constructed and initialized.

Returns:
boolean true if equals zero, false if not.
Parameters:
xring element.

Implements RingAbstract.

bool isZeroDivisor ( const ElementAbstract x) const [inline, virtual]

Divisibility of zero test. Test if ring element is a zero divisor. This function assumes the ring element has already been constructed and initialized.

Returns:
boolean true if divides zero, false if not.
Parameters:
xring element.

Implements RingAbstract.

std::ostream& write ( std::ostream &  os) const [inline, virtual]

Print field.

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

Reimplemented from FieldEnvelope< Ring >.

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

Read field.

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

Reimplemented from FieldEnvelope< Ring >.

std::ostream& write ( std::ostream &  os,
const ElementAbstract x 
) const [inline, virtual]

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:
osoutput stream to which field base element is written.
xfield base element.

Reimplemented from FieldEnvelope< Ring >.

std::istream& read ( std::istream &  is,
ElementAbstract x 
) const [inline, virtual]

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:
isinput stream from which field base element is read.
xfield base element.

Reimplemented from FieldEnvelope< Ring >.


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