All Classes Functions Friends
Public Member Functions | Static Public Attributes | List of all members
RationalNumber Class Reference
The concrete class RationalNumber inherits from BPASRing and mpq_class (from the GMP library). It overrides BPASRing's pure virtual member functions and inherits mpq_class's arithmetic operations (addition, subtraction, multiplication and division). One can construct a RationalNumber object from a mpq_class object or another RationalNumber object. Further, other operations include gcd and exponentiation (^).
Inheritance diagram for RationalNumber:
BPASRing

Public Member Functions

 RationalNumber (mpq_class a)
 
 RationalNumber (const RationalNumber &a)
 
 RationalNumber (Integer a)
 
 RationalNumber (ComplexRationalNumber a)
 
 RationalNumber (DenseUnivariateIntegerPolynomial a)
 
 RationalNumber (DenseUnivariateRationalPolynomial a)
 
 RationalNumber (SparseUnivariatePolynomial< Integer > a)
 
 RationalNumber (SparseUnivariatePolynomial< RationalNumber > a)
 
 RationalNumber (SparseUnivariatePolynomial< ComplexRationalNumber > a)
 
template<class Ring >
 RationalNumber (SparseUnivariatePolynomial< Ring > a)
 
 RationalNumber (int a, int b)
 
RationalNumberset (int a, int b)
 
RationalNumberoperator= (const RationalNumber &a)
 
bool isZero ()
 
void zero ()
 
bool isOne ()
 
void one ()
 
bool isNegativeOne ()
 
void negativeOne ()
 
int isConstant ()
 
RationalNumber gcd (RationalNumber b)
 
RationalNumber operator^ (int e)
 

Static Public Attributes

static int characteristic
 
static bool isPrimeField
 
static bool isComplexField
 
- Static Public Attributes inherited from BPASRing
static int characteristic
 
static bool isPrimeField
 
static bool isComplexField
 

Member Function Documentation

RationalNumber RationalNumber::gcd ( RationalNumber  b)
inline

GCD(a, b)

Parameters
b,:The other rational number
int RationalNumber::isConstant ( )
inlinevirtual

Is a constant

Parameters

Implements BPASRing.

bool RationalNumber::isNegativeOne ( )
inlinevirtual

Is a -1

Parameters

Implements BPASRing.

bool RationalNumber::isOne ( )
inlinevirtual

Is a 1

Parameters

Implements BPASRing.

bool RationalNumber::isZero ( )
inlinevirtual

Is a zero

Parameters

Implements BPASRing.

void RationalNumber::negativeOne ( )
inlinevirtual

Assign to negative one

Parameters

Implements BPASRing.

void RationalNumber::one ( )
inlinevirtual

Assign to one

Parameters

Implements BPASRing.

RationalNumber RationalNumber::operator^ ( int  e)
inline

Overload operator ^ replace xor operation by exponentiation

Parameters
e,:The exponentiation
void RationalNumber::zero ( )
inlinevirtual

Assign to zero

Parameters

Implements BPASRing.


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