linbox
|
Derived class used to implement the field archetypeHelps to minimize code bloat. More...
#include <envelope.h>
Public Types | |
typedef ElementEnvelope< Field > | Element |
element type. More... | |
typedef RandIterEnvelope< Field > | RandIter |
Random iterator generator type. More... | |
Public Member Functions | |
Object Management | |
FieldEnvelope (void) | |
Default constructor. More... | |
FieldEnvelope (const Field &F) | |
Constructor from field to be wrapped. More... | |
FieldEnvelope (const FieldEnvelope &E) | |
Copy constructor. More... | |
FieldAbstract * | clone () const |
Virtual copy constructor. More... | |
FieldAbstract & | operator= (const FieldAbstract &F) |
Assignment operator. More... | |
ElementAbstract & | init (ElementAbstract &x) const |
Initialization of field base element from an integer. More... | |
ElementAbstract & | init (ElementAbstract &x, const integer &y) const |
Initialization of field base element from an integer. More... | |
integer & | convert (integer &x, const ElementAbstract &y) const |
Conversion of field base element to a template class T. More... | |
ElementAbstract & | assign (ElementAbstract &x, const ElementAbstract &y) const |
Assignment of one field base element to another. More... | |
integer & | cardinality (integer &c) const |
Cardinality. More... | |
integer & | characteristic (integer &c) const |
Characteristic. 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. | |
bool | areEqual (const ElementAbstract &x, const ElementAbstract &y) const |
Equality of two elements. More... | |
ElementAbstract & | add (ElementAbstract &x, const ElementAbstract &y, const ElementAbstract &z) const |
Addition. More... | |
ElementAbstract & | sub (ElementAbstract &x, const ElementAbstract &y, const ElementAbstract &z) const |
Subtraction. More... | |
ElementAbstract & | mul (ElementAbstract &x, const ElementAbstract &y, const ElementAbstract &z) const |
Multiplication. More... | |
ElementAbstract & | div (ElementAbstract &x, const ElementAbstract &y, const ElementAbstract &z) const |
Division. More... | |
ElementAbstract & | neg (ElementAbstract &x, const ElementAbstract &y) const |
Additive Inverse (Negation). More... | |
ElementAbstract & | inv (ElementAbstract &x, const ElementAbstract &y) const |
Multiplicative Inverse. More... | |
ElementAbstract & | axpy (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x, const ElementAbstract &y) const |
Natural AXPY. More... | |
ElementAbstract & | axmy (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x, const ElementAbstract &y) const |
Natural AXMY. More... | |
ElementAbstract & | maxpy (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 | isZero (const ElementAbstract &x) const |
Zero equality. More... | |
bool | isOne (const ElementAbstract &x) const |
One equality. More... | |
bool | isMOne (const ElementAbstract &x) const |
MOne equality. More... | |
bool | isUnit (const ElementAbstract &x) const |
invertibility. More... | |
ElementAbstract & | addin (ElementAbstract &x, const ElementAbstract &y) const |
Inplace Addition. More... | |
ElementAbstract & | subin (ElementAbstract &x, const ElementAbstract &y) const |
Inplace Subtraction. More... | |
ElementAbstract & | mulin (ElementAbstract &x, const ElementAbstract &y) const |
Inplace Multiplication. More... | |
ElementAbstract & | divin (ElementAbstract &x, const ElementAbstract &y) const |
Inplace Division. More... | |
ElementAbstract & | negin (ElementAbstract &x) const |
Inplace Additive Inverse (Inplace Negation). More... | |
ElementAbstract & | invin (ElementAbstract &x) const |
Inplace Multiplicative Inverse. More... | |
ElementAbstract & | axpyin (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x) const |
Inplace AXPY. More... | |
ElementAbstract & | axmyin (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x) const |
Inplace AXMY. More... | |
ElementAbstract & | maxpyin (ElementAbstract &r, const ElementAbstract &a, const ElementAbstract &x) const |
Inplace MAXPY. More... | |
Input/Output Operations | |
std::ostream & | write (std::ostream &os) const |
Print field. More... | |
std::ostream & | write (std::ostream &os, const ElementAbstract &x) const |
Print field base element. More... | |
std::istream & | read (std::istream &is, ElementAbstract &x) const |
Read field base element. More... | |
Protected Attributes | |
Field | _field |
Wrapped field. | |
Derived class used to implement the field archetype
Helps 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 field so that it might be used with the Field archetype.
typedef ElementEnvelope<Field> Element |
element type.
It is derived from the class ElementAbstract, and it must contain a wrapped field element.
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.
|
inline |
Default constructor.
In this implementation, this means copying the field E._field
.
|
inline |
Constructor from field to be wrapped.
F | Field object to be wrapped. |
|
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 E._field
.
E | FieldEnvelope object. |
|
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.
Implements FieldAbstract.
|
inlinevirtual |
Assignment operator.
Required by abstract base class.
F | constant reference to FieldAbstract object |
Implements FieldAbstract.
|
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.
x | field base element to contain output (reference returned). |
y | integer. |
|
inlinevirtual |
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.
x | field base element to contain output (reference returned). |
y | integer. |
Implements FieldAbstract.
|
inlinevirtual |
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.
x | template class T to contain output (reference returned). |
y | constant field base element. |
Implements FieldAbstract.
|
inline |
Assignment of one field base element to another.
This function assumes both field base elements have already been constructed and initialized.
x | field base element (reference returned). |
y | field base element. |
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.
Implements FieldAbstract.
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.
Implements FieldAbstract.
|
inline |
Equality of two elements.
This function assumes both field base elements have already been constructed and initialized.
x | field base element |
y | field base element |
|
inline |
Addition.
x = y + z This function assumes all the field base elements have already been constructed and initialized.
x | field base element (reference returned). |
y | field base element. |
z | field base element. |
|
inline |
Subtraction.
x = y - z This function assumes all the field base elements have already been constructed and initialized.
x | field base element (reference returned). |
y | field base element. |
z | field base element. |
|
inline |
Multiplication.
x = y * z This function assumes all the field base elements have already been constructed and initialized.
x | field base element (reference returned). |
y | field base element. |
z | field base element. |
|
inline |
Division.
x = y / z This function assumes all the field base elements have already been constructed and initialized.
x | field base element (reference returned). |
y | field base element. |
z | field base element. |
|
inline |
Additive Inverse (Negation).
x = - y This function assumes both field base elements have already been constructed and initialized.
x | field base element (reference returned). |
y | field base element. |
|
inline |
Multiplicative Inverse.
x = 1 / y This function assumes both field base elements have already been constructed and initialized.
x | field base element (reference returned). |
y | field base element. |
|
inline |
Natural AXPY.
r = a * x + y This function assumes all field elements have already been constructed and initialized.
r | field element (reference returned). |
a | field element. |
x | field element. |
y | field element. |
|
inline |
Natural AXMY.
r = a * x - y This function assumes all field elements have already been constructed and initialized.
r | field element (reference returned). |
a | field element. |
x | field element. |
y | field element. |
|
inline |
Natural MAXPY.
r = y - a * x This function assumes all field elements have already been constructed and initialized.
r | field element (reference returned). |
a | field element. |
x | field element. |
y | field element. |
|
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.
x | field base element. |
|
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.
x | field base element. |
|
inline |
MOne equality.
Test if field base element is equal to one. This function assumes the field base element has already been constructed and initialized.
x | field base element. |
|
inline |
invertibility.
Test if field element is a unit. This function assumes the field element has already been constructed and initialized. Purely virtual.
x | field element. |
|
inline |
Inplace Addition.
x += y This function assumes both field base elements have already been constructed and initialized.
x | field base element (reference returned). |
y | field base element. |
|
inline |
Inplace Subtraction.
x -= y This function assumes both field base elements have already been constructed and initialized.
x | field base element (reference returned). |
y | field base element. |
|
inline |
Inplace Multiplication.
x *= y This function assumes both field base elements have already been constructed and initialized.
x | field base element (reference returned). |
y | field base element. |
|
inline |
Inplace Division.
x /= y This function assumes both field base elements have already been constructed and initialized.
x | field base element (reference returned). |
y | field base element. |
|
inline |
Inplace Additive Inverse (Inplace Negation).
x = - x This function assumes the field base element has already been constructed and initialized.
x | field base element (reference returned). |
|
inline |
Inplace Multiplicative Inverse.
x = 1 / x This function assumes the field base elementhas already been constructed and initialized.
x | field base element (reference returned). |
|
inline |
Inplace AXPY.
r += a * x This function assumes all field elements have already been constructed and initialized.
r | field element (reference returned). |
a | field element. |
x | field element. |
|
inline |
Inplace AXMY.
r = a * x - r This function assumes all field elements have already been constructed and initialized.
r | field element (reference returned). |
a | field element. |
x | field element. |
|
inline |
Inplace MAXPY.
r -= a * x This function assumes all field elements have already been constructed and initialized.
r | field element (reference returned). |
a | field element. |
x | field element. |
|
inline |
Print field.
os | output stream to which field is written. |
|
inline |
Print field base element.
This function assumes the field base element has already been constructed and initialized.
os | output stream to which field base element is written. |
x | field base element. |
|
inline |
Read field base element.
This function assumes the field base element has already been constructed and initialized.
is | input stream from which field base element is read. |
x | field base element. |