linbox
GMPRationalElement Class Reference

elements of GMP_Rationals. More...

#include <gmp-rational.h>

Public Member Functions

Common Object Interface for LinBox Field elements.

These methods are required of all LinBox field elements.

 GMPRationalElement (void)
 Default constructor. More...
 
 GMPRationalElement (const GMPRationalElement &a)
 Copy constructor. More...
 
 ~GMPRationalElement ()
 Destructor. More...
 
GMPRationalElementoperator= (const GMPRationalElement &a)
 Assignment operator. More...
 
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)
 Constructor. More...
 
 GMPRationalElement (const integer &num, const integer &den)
 Constructor. More...
 
 GMPRationalElement (const integer &num)
 Constructor. More...
 
mpq_ptr get_rep ()
 access representation
 

Detailed Description

elements of GMP_Rationals.

Examples:
examples/qchar.C.

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
_reppointer to ElementAbstract
GMPRationalElement ( const integer num,
const integer den 
)
inline

Constructor.

Initialize from numerator and denominator

Parameters
num,den
GMPRationalElement ( const integer num)
inline

Constructor.

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

Parameters
num

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: