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 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 { } 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)

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.} points, the element to which { F.} points, and the random element generator to which { F.} 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 { } 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 { } 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: