linbox
|
Abstract parameterized field of "fuzzy" doubles. More...
#include <param-fuzzy.h>
Public Types | |
typedef double | Element |
element type. More... | |
typedef ParamFuzzyRandIter | RandIter |
Random iterator generator type. More... | |
Public Member Functions | |
Object Management | |
ParamFuzzy (const double &value=.000000001) | |
Constructor from an integer. More... | |
ParamFuzzy (const ParamFuzzy &F) | |
Copy constructor. More... | |
ParamFuzzy & | operator= (const ParamFuzzy &F) |
Assignment operator. More... | |
Element & | init (Element &x, const integer &y=0) const |
Initialization of field base element from an integer. More... | |
Element & | init (Element &x, const double &y) const |
init (from double) More... | |
integer & | convert (integer &x, const Element &y) const |
Conversion of field base element to a template class T. More... | |
double & | convert (double &x, const Element &y) const |
convert (double) More... | |
Element & | assign (Element &x, const Element &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 Element &x, const Element &y) const |
Equality of two elements. More... | |
Element & | add (Element &x, const Element &y, const Element &z) const |
Addition. More... | |
Element & | sub (Element &x, const Element &y, const Element &z) const |
Subtraction. More... | |
Element & | mul (Element &x, const Element &y, const Element &z) const |
Multiplication. More... | |
Element & | div (Element &x, const Element &y, const Element &z) const |
Division. More... | |
Element & | neg (Element &x, const Element &y) const |
Additive Inverse (Negation). More... | |
Element & | inv (Element &x, const Element &y) const |
Multiplicative Inverse. More... | |
Element & | axpy (Element &r, const Element &a, const Element &x, const Element &y) const |
Natural AXPY. More... | |
Inplace Arithmetic Operations | |
x <- x op y; x <- op x | |
bool | isZero (const Element &x) const |
Zero equality. More... | |
bool | isOne (const Element &x) const |
One equality. More... | |
bool | isMOne (const Element &x) const |
Zero equality. More... | |
bool | isUnit (const Element &x) const |
Zero equality. More... | |
Element & | addin (Element &x, const Element &y) const |
Inplace Addition. More... | |
Element & | subin (Element &x, const Element &y) const |
Inplace Subtraction. More... | |
Element & | mulin (Element &x, const Element &y) const |
Inplace Multiplication. More... | |
Element & | divin (Element &x, const Element &y) const |
Inplace Division. More... | |
Element & | negin (Element &x) const |
Inplace Additive Inverse (Inplace Negation). More... | |
Element & | invin (Element &x) const |
Inplace Multiplicative Inverse. More... | |
Element & | axpyin (Element &r, const Element &a, const Element &x) const |
Inplace AXPY. More... | |
Input/Output Operations | |
std::ostream & | write (std::ostream &os) const |
Print field. More... | |
std::istream & | read (std::istream &is) |
Read field. More... | |
std::ostream & | write (std::ostream &os, const Element &x) const |
Print field base element. More... | |
std::istream & | read (std::istream &is, Element &x) const |
Read field base element. More... | |
Abstract parameterized field of "fuzzy" doubles.
Field has (non-static, non-negative) member to contain "fuzz value" of field. Doubles within this fuzz value are considered to be equal.
typedef double Element |
element type.
It must meet the common object interface of elements as given in the the archetype ElementArchetype.
typedef ParamFuzzyRandIter RandIter |
Random iterator generator type.
It must meet the common object interface of random element generators as given in the the archetype RandIterArchetype.
|
inline |
Constructor from an integer.
Sets the fuzz value of the field throug the static member of the element type.
value | constant reference to double fuzz value |
|
inline |
Copy constructor.
Constructs ParamFuzzy object by copying the field. This is required to allow field objects to be passed by value into functions.
F | ParamFuzzy object. |
|
inline |
Assignment operator.
F | constant reference to ParamFuzzy object |
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. |
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. |
|
inline |
convert (double)
x,y |
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.
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.
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 |
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. |
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. |
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. |
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. |
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. |
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. |
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 |
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 |
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 |
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. |
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. |
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. |
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. |
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. |
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). |
Inplace Multiplicative Inverse.
x = 1 / x This function assumes the field base elementhas already been constructed and initialized.
x | field base element (reference returned). |
Inplace AXPY.
r += a * x This function assumes all field elements have already been constructed and initialized. Purely virtual
r | field element (reference returned). |
a | field element. |
x | field element. |
|
inline |
Print field.
os | output stream to which field is written. |
|
inline |
Read field.
is | input stream from which field is read. |
|
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. |