#include <gmp-rational.h>
Inheritance diagram for GMPRationalField:
Common Object Interface for a LinBox Field. | |
typedef GMPRationalElement | Element |
element type. | |
typedef GMPRationalRandIter | RandIter |
Random iterator generator type. | |
const Element | zero |
const Element | one |
const Element | neg_one |
Public Methods | |
Input Output Operations Common Object Interface | GMPRationalField (int p=0, int exp=1) |
integer & | get_num (integer &x, const Element &y) const |
integer & | get_den (integer &x, const Element &y) const |
int | sign (const Element &x) const |
Object Management | |
x <- convert (y) | |
GMPRationalField (const GMPRationalField &F) | |
~GMPRationalField (void) | |
GMPRationalField & | operator= (const GMPRationalField &F) |
Element & | init (Element &x, const integer &y=0) const |
integer & | convert (integer &x, const Element &y=0) const |
Element & | assign (Element &x, const Element &y) const |
integer & | cardinality (integer &c) const |
integer & | characteristic (integer &c) const |
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 elements will give undefined results. | |
Object Management bool | areEqual (const Element &x, const Element &y) const |
Element & | add (Element &x, const Element &y, const Element &z) const |
Element & | sub (Element &x, const Element &y, const Element &z) const |
Element & | mul (Element &x, const Element &y, const Element &z) const |
Element & | div (Element &x, const Element &y, const Element &z) const |
Element & | neg (Element &x, const Element &y) const |
Element & | inv (Element &x, const Element &y) const |
Inplace Arithmetic Operations | |
x <- x op y; x <- op x These operations require all elements, including x, to be initialized before the operation is called. Uninitialized field elements will give undefined results. | |
Arithmetic Operations bool | isZero (const Element &x) const |
bool | isOne (const Element &x) const |
Element & | addin (Element &x, const Element &y) const |
Element & | subin (Element &x, const Element &y) const |
Element & | mulin (Element &x, const Element &y) const |
Element & | axpy (Element &r, const Element &a, const Element &x, const Element &y) const |
Element & | axpyin (Element &r, const Element &a, const Element &x) const |
Element & | divin (Element &x, const Element &y) const |
Element & | negin (Element &x) const |
Element & | invin (Element &x) const |
Input/Output Operations | |
Inplace Arithmetic Operations 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 |
Static Public Methods | |
int | getMaxModulus () |
|
element type.
|
|
Random iterator generator type.
|
|
Copy constructor. Vacuous, since this field is unparametric so there is no need to construct multiple field objects |
|
Destructor. Also vacuous, since there is no de-initialization system |
|
|
|
Addition. x = y + z This function assumes all the field elements have already been constructed and initialized. In this implementation, this means for x, y, and z, _elem_ptr exists and does not point to null.
|
|
Inplace Addition. x += y This function assumes both field elements have already been constructed and initialized. In this implementation, this means for both x and y _elem_ptr exists and does not point to null.
|
|
Equality of two elements. This function assumes both field elements have already been constructed and initialized. In this implementation, this means for both x and y, _elem_ptr exists and does not point to null.
|
|
Assignment of one field element to another. This function assumes both field elements have already been constructed and initialized. In this implementation, this means for both x and y, _elem_ptr exists and does not point to null.
|
|
|
|
|
|
Cardinality. Return integer representing cardinality of the field. Returns a non-negative integer for all fields with finite cardinality, and returns -1 to signify a field of infinite cardinality.
|
|
Characteristic. Return integer representing characteristic of the field. Returns a positive integer to all fields with finite characteristic, and returns 0 to signify a field of infinite characteristic.
|
|
Conversion of field element to an integer. This function assumes the output field element x has already been constructed, but that it is not already initialized. In this implementation, this means the _elem_ptr of y exists, and that it is not the null pointer. Returns floor (numerator (y) / denominator (y))
|
|
Division. x = y / z This function assumes all the field elements have already been constructed and initialized. In this implementation, this means for x, y, and z, _elem_ptr exists and does not point to null.
|
|
Inplace Division. x /= y This function assumes both field elements have already been constructed and initialized. In this implementation, this means for both x and y _elem_ptr exists and does not point to null.
|
|
|
|
|
|
|
|
Initialization of field element from an integer. Behaves like C++ allocator construct. This function assumes the output field element x has already been constructed, but that it is not necessarily already initialized. In this implementation, this means the _elem_ptr of x exists, but that it may be the null pointer.
|
|
Multiplicative Inverse. x = 1 / y This function assumes both field elements have already been constructed and initialized. In this implementation, this means for both x and y _elem_ptr exists and does not point to null.
|
|
Inplace Multiplicative Inverse. x = 1 / x This function assumes the field elementhas already been constructed and initialized. In this implementation, this means the _elem_ptr of x exists and does not point to null.
|
|
One equality. Test if field element is equal to one. This function assumes the field element has already been constructed and initialized. In this implementation, this means the _elem_ptr of x exists and does not point to null.
|
|
Zero equality. Test if field element is equal to zero. This function assumes the field element has already been constructed and initialized. In this implementation, this means the _elem_ptr of x exists and does not point to null.
|
|
Multiplication. x = y * z This function assumes all the field elements have already been constructed and initialized. In this implementation, this means for x, y, and z, _elem_ptr exists and does not point to null.
|
|
Inplace Multiplication. x *= y This function assumes both field elements have already been constructed and initialized. In this implementation, this means for both x and y _elem_ptr exists and does not point to null.
|
|
Additive Inverse (Negation). x = - y This function assumes both field elements have already been constructed and initialized. In this implementation, this means for both x and y _elem_ptr exists and does not point to null.
|
|
Inplace Additive Inverse (Inplace Negation). x = - x This function assumes the field element has already been constructed and initialized. In this implementation, this means the _elem_ptr of x exists and does not point to null.
|
|
Assignment operator. Also vacuous |
|
Read field element. This function assumes the field element has already been constructed and initialized. In this implementation, this means for the _elem_ptr for x exists and does not point to null.
|
|
Read field.
FIXME: Read the same thing written above, and throw an exception if the strings do not match. |
|
|
|
Subtraction. x = y - z This function assumes all the field elements have already been constructed and initialized. In this implementation, this means for x, y, and z, _elem_ptr exists and does not point to null.
|
|
Inplace Subtraction. x -= y This function assumes both field elements have already been constructed and initialized. In this implementation, this means for both x and y _elem_ptr exists and does not point to null.
|
|
Print field element. This function assumes the field element has already been constructed and initialized. In this implementation, this means for the _elem_ptr for x exists and does not point to null.
|
|
Print field.
|
|
|
|
|
|
|