linbox
Public Types | Protected Attributes
RingEnvelope< Ring > Class Template Reference

implement the ring archetype to minimize code bloat. More...

#include <envelope.h>

+ Inheritance diagram for RingEnvelope< Ring >:
+ Collaboration diagram for RingEnvelope< Ring >:

Public Types

typedef FieldEnvelope< Ring >::Element Element
 element type. More...
 
typedef FieldEnvelope< Ring >::RandIter RandIter
 Random iterator generator type. More...
 

Public Member Functions

Object Management
ElementAbstractinit (ElementAbstract &x) const
 Initialization of field base element from an integer. More...
 
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.

ElementAbstractaxmy (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x, const ElementAbstract &y) const
 Natural AXMY. More...
 
ElementAbstractmaxpy (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x, const ElementAbstract &y) const
 Natural MAXPY. More...
 
Inplace Arithmetic Operations

x <- x op y; x <- op x

bool isMOne (const ElementAbstract &x) const
 MOne equality. More...
 
ElementAbstractaxmyin (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x) const
 Inplace AXMY. More...
 
ElementAbstractmaxpyin (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x) const
 Inplace MAXPY. More...
 

Protected Attributes

Ring _field
 Wrapped field.
 

Object Management

class RandIterEnvelope< Ring >
 Default constructor. More...
 
 RingEnvelope (void)
 Default constructor. More...
 
 RingEnvelope (const Ring &F)
 Constructor from ring to be wrapped. More...
 
 RingEnvelope (const RingEnvelope &E)
 Copy constructor. More...
 
FieldAbstractclone () const
 Virtual copy constructor. More...
 
RingAbstractoperator= (const RingAbstract &F)
 Assignment operator. More...
 
FieldAbstractoperator= (const FieldAbstract &F)
 Assignment operator. More...
 
ElementAbstractinit (ElementAbstract &x, const integer &y=0) const
 Default constructor. More...
 
integerconvert (integer &x, const ElementAbstract &y) const
 Default constructor. More...
 
ElementAbstractassign (ElementAbstract &x, const ElementAbstract &y) const
 Default constructor. More...
 
ElementAbstractneg (ElementAbstract &x, const ElementAbstract &y) const
 Default constructor. More...
 
ElementAbstractinv (ElementAbstract &x, const ElementAbstract &y) const
 Default constructor. More...
 
ElementAbstractnegin (ElementAbstract &x) const
 Default constructor. More...
 
ElementAbstractinvin (ElementAbstract &x) const
 Default constructor. More...
 
integercardinality (integer &c) const
 Default constructor. More...
 
integercharacteristic (integer &c) const
 Default constructor. More...
 
bool areEqual (const ElementAbstract &x, const ElementAbstract &y) const
 Default constructor. More...
 
ElementAbstractadd (ElementAbstract &x, const ElementAbstract &y, const ElementAbstract &z) const
 Default constructor. More...
 
ElementAbstractsub (ElementAbstract &x, const ElementAbstract &y, const ElementAbstract &z) const
 Default constructor. More...
 
ElementAbstractmul (ElementAbstract &x, const ElementAbstract &y, const ElementAbstract &z) const
 Default constructor. More...
 
ElementAbstractdiv (ElementAbstract &x, const ElementAbstract &y, const ElementAbstract &z) const
 Default constructor. More...
 
ElementAbstractaxpy (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x, const ElementAbstract &y) const
 Default constructor. More...
 
ElementAbstractaddin (ElementAbstract &x, const ElementAbstract &z) const
 Default constructor. More...
 
ElementAbstractsubin (ElementAbstract &x, const ElementAbstract &z) const
 Default constructor. More...
 
ElementAbstractmulin (ElementAbstract &x, const ElementAbstract &z) const
 Default constructor. More...
 
ElementAbstractdivin (ElementAbstract &x, const ElementAbstract &z) const
 Default constructor. More...
 
ElementAbstractaxpyin (ElementAbstract &r, const ElementAbstract &x, const ElementAbstract &y) const
 Default constructor. More...
 
bool isZero (const ElementAbstract &x) const
 Default constructor. More...
 
bool isOne (const ElementAbstract &x) const
 Default constructor. More...
 
bool isUnit (const ElementAbstract &x) const
 Invertibility test. More...
 
bool isZeroDivisor (const ElementAbstract &x) const
 Divisibility of zero test. More...
 
std::ostream & write (std::ostream &os) const
 Default constructor. More...
 
std::istream & read (std::istream &is)
 Default constructor. More...
 
std::ostream & write (std::ostream &os, const ElementAbstract &x) const
 Default constructor. More...
 
std::istream & read (std::istream &is, ElementAbstract &x) const
 Default constructor. More...
 

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

◆ Element

typedef FieldEnvelope<Ring>::Element Element

element type.

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

◆ RandIter

Random iterator generator type.

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

Constructor & Destructor Documentation

◆ RingEnvelope() [1/3]

RingEnvelope ( void  )
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ RingEnvelope() [2/3]

RingEnvelope ( const Ring &  F)
inline

Constructor from ring to be wrapped.

Parameters
FRing object to be wrapped.

◆ RingEnvelope() [3/3]

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._field.

Parameters
ERingEnvelope object.

Member Function Documentation

◆ clone()

FieldAbstract* clone ( ) const
inlinevirtual

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.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

FieldAbstract& operator= ( const FieldAbstract F)
inlinevirtual

Assignment operator.

Required by abstract base class.

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

Implements FieldAbstract.

◆ init() [1/2]

ElementAbstract& init ( ElementAbstract x,
const integer y = 0 
) const
inlinevirtual

Default constructor.

In this implementation, this means copying the ring E._field.

Implements FieldAbstract.

◆ convert()

integer& convert ( integer x,
const ElementAbstract y 
) const
inlinevirtual

Default constructor.

In this implementation, this means copying the ring E._field.

Implements FieldAbstract.

◆ assign()

ElementAbstract& assign ( ElementAbstract x,
const ElementAbstract y 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ neg()

ElementAbstract& neg ( ElementAbstract x,
const ElementAbstract y 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ inv()

ElementAbstract& inv ( ElementAbstract x,
const ElementAbstract y 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ negin()

ElementAbstract& negin ( ElementAbstract x) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ invin()

ElementAbstract& invin ( ElementAbstract x) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ cardinality()

integer& cardinality ( integer c) const
inlinevirtual

Default constructor.

In this implementation, this means copying the ring E._field.

Implements FieldAbstract.

◆ characteristic()

integer& characteristic ( integer c) const
inlinevirtual

Default constructor.

In this implementation, this means copying the ring E._field.

Implements FieldAbstract.

◆ areEqual()

bool areEqual ( const ElementAbstract x,
const ElementAbstract y 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ add()

ElementAbstract& add ( ElementAbstract x,
const ElementAbstract y,
const ElementAbstract z 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ sub()

ElementAbstract& sub ( ElementAbstract x,
const ElementAbstract y,
const ElementAbstract z 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ mul()

ElementAbstract& mul ( ElementAbstract x,
const ElementAbstract y,
const ElementAbstract z 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ div()

ElementAbstract& div ( ElementAbstract x,
const ElementAbstract y,
const ElementAbstract z 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ axpy()

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

Default constructor.

In this implementation, this means copying the ring E._field.

◆ addin()

ElementAbstract& addin ( ElementAbstract x,
const ElementAbstract z 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ subin()

ElementAbstract& subin ( ElementAbstract x,
const ElementAbstract z 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ mulin()

ElementAbstract& mulin ( ElementAbstract x,
const ElementAbstract z 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ divin()

ElementAbstract& divin ( ElementAbstract x,
const ElementAbstract z 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ axpyin()

ElementAbstract& axpyin ( ElementAbstract r,
const ElementAbstract x,
const ElementAbstract y 
) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ isZero()

bool isZero ( const ElementAbstract x) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ isOne()

bool isOne ( const ElementAbstract x) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ isUnit()

bool isUnit ( const ElementAbstract x) const
inlinevirtual

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.

◆ isZeroDivisor()

bool isZeroDivisor ( const ElementAbstract x) const
inlinevirtual

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.

◆ write() [1/2]

std::ostream& write ( std::ostream &  os) const
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ read() [1/2]

std::istream& read ( std::istream &  is)
inline

Default constructor.

In this implementation, this means copying the ring E._field.

◆ write() [2/2]

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

Default constructor.

In this implementation, this means copying the ring E._field.

◆ read() [2/2]

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

Default constructor.

In this implementation, this means copying the ring E._field.

◆ init() [2/2]

ElementAbstract& init ( ElementAbstract x) const
inlineinherited

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.

◆ axmy()

ElementAbstract& axmy ( ElementAbstract r,
const ElementAbstract a,
const ElementAbstract x,
const ElementAbstract y 
) const
inlineinherited

Natural AXMY.

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.

◆ maxpy()

ElementAbstract& maxpy ( ElementAbstract r,
const ElementAbstract a,
const ElementAbstract x,
const ElementAbstract y 
) const
inlineinherited

Natural MAXPY.

r = y - 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.
yfield element.

◆ isMOne()

bool isMOne ( const ElementAbstract x) const
inlineinherited

MOne 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.

◆ axmyin()

ElementAbstract& axmyin ( ElementAbstract r,
const ElementAbstract a,
const ElementAbstract x 
) const
inlineinherited

Inplace AXMY.

r = a * x - r 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.

◆ maxpyin()

ElementAbstract& maxpyin ( ElementAbstract r,
const ElementAbstract a,
const ElementAbstract x 
) const
inlineinherited

Inplace MAXPY.

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.

Friends And Related Function Documentation

◆ RandIterEnvelope< Ring >

friend class RandIterEnvelope< Ring >
friend

Default constructor.

In this implementation, this means copying the ring E._field.


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