Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

GMPRationalElement Class Reference

#include <gmp-rational.h>

List of all members.


Detailed Description

element archetype. Archetype for the element common object interface for \Ref{LinBox}.

This class must contain a default constructor, a copy constructor, an assignment operator, and a destructor. This is to allow field elements to be primitive C++ types such as double and int. The copy constructor is also used to allow elements to be passed by value to a function.


Public Methods

Common Object Interface for LinBox Field elements.
These methods are required of all \Ref{LinBox} field elements.

 GMPRationalElement (void)
 GMPRationalElement (const GMPRationalElement &a)
 ~GMPRationalElement ()
GMPRationalElement & operator= (const GMPRationalElement &a)
Implementation-Specific Methods.
These methods are not required of all LinBox field elements and are included only for this implementation of the archetype.

Common Object Interface GMPRationalElement (mpq_t _rep)
 GMPRationalElement (const integer &num, const integer &den)
 GMPRationalElement (const integer &num)

Friends

class GMPRationalField
class GMPRationalRandIter


Constructor & Destructor Documentation

GMPRationalElement void    [inline]
 

Default constructor. This constructor is required to allow field elements to be primitive C++ types. Because constructor does not know what field the element belongs to, it cannot actually construct the element. In this implementation, the constructor it sets _elem_ptr to the null pointer. Initialization of the element is done through the field function init where the field is known.

GMPRationalElement const GMPRationalElement &    a [inline]
 

Copy constructor. This constructor is required to allow field elements to be primitive C++ types, and to allow field elements to be passed by value into functions. Constructs field element by copying the field element. In this implementation, this means copying the element to which a._elem_ptr points.

Parameters:
a  field element.

~GMPRationalElement   [inline]
 

Destructor. In this implementation, this destroys element by deleting field element to which _elem_ptr points.

Common Object Interface GMPRationalElement mpq_t    _rep [inline]
 

Constructor. Constructs field element from an mpq_t Not part of the interface. Creates new copy of element object in dynamic memory.

Parameters:
elem_ptr  pointer to \Ref{ElementAbstract}

GMPRationalElement const integer   num,
const integer   den
[inline]
 

Constructor Initialize from numerator and denominator

GMPRationalElement const integer   num [inline]
 

Constructor Initalizes from a single integer, (which is assumed to be the numerator, with the denominator being 1)


Member Function Documentation

GMPRationalElement& operator= const GMPRationalElement &    a [inline]
 

Assignment operator. Assigns element a to element. In this implementation, this is done by copying field element to which _elem_ptr points.

Parameters:
a  field element.


Friends And Related Function Documentation

friend class GMPRationalField [friend]
 

friend class GMPRationalRandIter [friend]
 


Generated on Mon Jun 20 09:16:56 2005 for linbox by doxygen1.2.18