linbox  1
GMPRationalElement Class Reference

elements of GMP_Rationals. More...

#include <gmp-rational.h>

List of all members.

Public Member Functions

Common Object Interface for LinBox Field elements.

These methods are required of all LinBox} field elements.

 GMPRationalElement (void)
 GMPRationalElement (const GMPRationalElement &a)
 ~GMPRationalElement ()
GMPRationalElementoperator= (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.

 GMPRationalElement (mpq_t _rep)
 GMPRationalElement (const integer &num, const integer &den)
 GMPRationalElement (const integer &num)
mpq_ptr get_rep ()

Detailed Description

elements of GMP_Rationals.


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:
afield element.
~GMPRationalElement ( ) [inline]

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

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_ptrpointer to 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:
afield element.

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