linbox  1
RingArchetype Class Reference

specification and archetypic instance for the ring interfaceThe {RingArchetype} and its encapsulated element class contain pointers to the {RingAbstract} and its encapsulated ring element, respectively. {RingAbstract} then uses virtual member functions to define operations on its encapsulated ring element. This ring element has no knowledge of the ring properties being used on it which means the ring object must supply these operations. More...

#include <archetype.h>

Inheritance diagram for RingArchetype:
FieldArchetype FieldInterface

List of all members.

Public Types

Common Object Interface for a LinBox Ring.

These methods are required of all {LinBox} rings.

typedef FieldArchetype::Element Element
 element type.
typedef FieldArchetype::RandIter RandIter
 Random iterator generator type.
- Public Types inherited from FieldArchetype

Public Member Functions

Object Management
 RingArchetype (const RingArchetype &F)
bool isUnit (const Element &x) const
 Invertibility test. Test if ring element is invertible. This function assumes the ring element has already been constructed and initialized. In this implementation, this means the { _elem_ptr} of x exists and does not point to null.
bool isZeroDivisor (const Element &x) const
 RingArchetype (RingAbstract *ring_ptr, ElementAbstract *elem_ptr, RandIterAbstract *randIter_ptr=0)
template<class Ring_qcq >
 RingArchetype (Ring_qcq *f)
- Public Member Functions inherited from FieldArchetype
 FieldArchetype (const FieldArchetype &F)
 Copy constructor.
 ~FieldArchetype (void)
 Destructor.
FieldArchetypeoperator= (const FieldArchetype &F)
 Assignment operator.
Elementinit (Element &x, const integer &n=0) const
 Initialization of field element from an integer.
integerconvert (integer &n, const Element &y=0) const
 Conversion of field element to an integer.
Elementassign (Element &x, const Element &y) const
 Assignment of one field element to another.
integercardinality (integer &c) const
 Cardinality.
integercharacteristic (integer &c) const
 Characteristic.
bool areEqual (const Element &x, const Element &y) const
 Equality of two elements.
Elementadd (Element &x, const Element &y, const Element &z) const
 Addition, x <– y + z.
Elementsub (Element &x, const Element &y, const Element &z) const
 Subtraction, x <– y - z.
Elementmul (Element &x, const Element &y, const Element &z) const
 Multiplication, x <– y * z.
Elementdiv (Element &x, const Element &y, const Element &z) const
Elementneg (Element &x, const Element &y) const
 Additive Inverse (Negation), x <– - y.
Elementinv (Element &x, const Element &y) const
 Multiplicative Inverse, x <– 1 / y.
Elementaxpy (Element &r, const Element &a, const Element &x, const Element &y) const
 Field element AXPY, r <– a * x + y.
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
std::ostream & write (std::ostream &os) const
std::istream & read (std::istream &is)
std::ostream & write (std::ostream &os, const Element &x) const
std::istream & read (std::istream &is, Element &x) const
 FieldArchetype (FieldAbstract *field_ptr, ElementAbstract *elem_ptr, RandIterAbstract *randIter_ptr=0)
template<class Field_qcq >
 FieldArchetype (Field_qcq *f)

Additional Inherited Members

- Protected Member Functions inherited from FieldArchetype
template<class Field_qcq >
void constructor (FieldAbstract *trait, Field_qcq *field_ptr)
template<class Field_qcq >
void constructor (void *trait, Field_qcq *field_ptr)
 FieldArchetype ()
- Protected Attributes inherited from FieldArchetype
FieldAbstract_field_ptr
ElementAbstract_elem_ptr
RandIterAbstract_randIter_ptr

Detailed Description

specification and archetypic instance for the ring interface

The {RingArchetype} and its encapsulated element class contain pointers to the {RingAbstract} and its encapsulated ring element, respectively. {RingAbstract} then uses virtual member functions to define operations on its encapsulated ring element. This ring element has no knowledge of the ring properties being used on it which means the ring object must supply these operations.

It does not contain elements zero and one because they can be created whenever necessary, although it might be beneficial from an efficiency stand point to include them. However, because of archetype use three, the elements themselves cannot be contained, but rather pointers to them.


Constructor & Destructor Documentation

RingArchetype ( const RingArchetype F)
inline

Copy constructor.

Constructs RingArchetype 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 to which { F._ring_ptr} points, the element to which { F._elem_ptr} points, and the random element generator to which { F._randIter_ptr} points.

Parameters:
F{ RingArchetype} object.
RingArchetype ( RingAbstract ring_ptr,
ElementAbstract elem_ptr,
RandIterAbstract randIter_ptr = 0 
)
inline

Constructor. Constructs ring from pointer to {RingAbstract} and its encapsulated element and random element generator. Not part of the interface. Creates new copies of ring, element, and random iterator generator objects in dynamic memory.

Parameters:
ring_ptrpointer to {RingAbstract}.
elem_ptrpointer to {ElementAbstract}, which is the encapsulated element of {RingAbstract}.
randIter_ptrpointer to {RandIterAbstract}, which is the encapsulated random iterator generator of {RingAbstract}.
RingArchetype ( Ring_qcq *  f)
inline

Constructor. Constructs ring from ANYTHING matching the interface using the enveloppe as a {RingAbstract} and its encapsulated element and random element generator if needed.

Parameters:
ring_ptrpointer to ring matching the interface
elem_ptrpointer to element matching the interface
randIter_ptrpointer to random matching the interface

Member Function Documentation

bool isUnit ( const Element x) const
inline

Invertibility test. Test if ring element is invertible. This function assumes the ring element has already been constructed and initialized. In this implementation, this means the { _elem_ptr} of x exists and does not point to null.

Returns:
boolean true if equals zero, false if not.
Parameters:
xring element.
bool isZeroDivisor ( const Element x) const
inline

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

In this implementation, this means the { _elem_ptr} of x exists and does not point to null.

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

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