Basic Polynomial Algebra Subprograms (BPAS)  v. 1.652
Public Member Functions | Static Public Attributes | List of all members
ComplexRationalNumber Class Reference

An arbitrary-precision complex rational number. More...

#include <ComplexRationalNumber.hpp>

Simplified semantic inheritance diagram for ComplexRationalNumber:
- Full inheritance diagram for ComplexRationalNumber:

Public Member Functions

 ComplexRationalNumber (const mpq_class &_a, const mpq_class &_b=mpq_class(1))
 ComplexRationalNumber (const ComplexRationalNumber &c)
 ComplexRationalNumber (int _a, int _b=1, int _c=0, int _d=1)
 ComplexRationalNumber (const Integer &c)
 ComplexRationalNumber (const RationalNumber &c)
 ComplexRationalNumber (const SmallPrimeField &c)
 ComplexRationalNumber (const BigPrimeField &c)
 ComplexRationalNumber (const GeneralizedFermatPrimeField &c)
 ComplexRationalNumber (const DenseUnivariateIntegerPolynomial &c)
 ComplexRationalNumber (const DenseUnivariateRationalPolynomial &c)
 ComplexRationalNumber (const SparseUnivariatePolynomial< Integer > &c)
 ComplexRationalNumber (const SparseUnivariatePolynomial< RationalNumber > &c)
 ComplexRationalNumber (const SparseUnivariatePolynomial< ComplexRationalNumber > &c)
template<class Ring >
 ComplexRationalNumber (const SparseUnivariatePolynomial< Ring > &c)
ComplexRationalNumberoperator= (const ComplexRationalNumber &c)
 Copy assignment.
ComplexRationalNumberoperator= (const mpq_class &k)
ComplexRationalNumberoperator= (int k)
ComplexRationalNumbersetRealPart (const RationalNumber &r)
ComplexRationalNumbersetRealPart (const mpq_class &k)
ComplexRationalNumbersetRealPart (int k)
ComplexRationalNumbersetImaginaryPart (const RationalNumber &r)
ComplexRationalNumbersetImaginaryPart (const mpq_class &k)
ComplexRationalNumbersetImaginaryPart (int k)
ComplexRationalNumberset (const RationalNumber &ka, const RationalNumber &kb)
ComplexRationalNumberset (const mpq_class &ka, const mpq_class &kb)
ComplexRationalNumberset (const mpq_class &ka, int kb)
ComplexRationalNumberset (int ka, const mpq_class &kb)
ComplexRationalNumberset (int ka, int kb)
bool isZero () const
 Is a zero. More...
void zero ()
 Assign to zero. More...
bool isOne () const
 Is a 1. More...
void one ()
 Assign to one. More...
bool isNegativeOne () const
 Is a -1. More...
void negativeOne ()
 Assign to negative one. More...
int isConstant () const
 Is a constant. More...
ComplexRationalNumber unitCanonical (ComplexRationalNumber *u=NULL, ComplexRationalNumber *v=NULL) const
 Obtain the unit normal (a.k.a canonical associate) of an element. More...
bool operator== (const ComplexRationalNumber &c) const
 Equality test,. More...
bool operator== (const mpq_class &k) const
bool operator== (int k) const
bool operator!= (const ComplexRationalNumber &c) const
 Inequality test,. More...
bool operator!= (const mpq_class &k) const
bool operator!= (int k) const
ComplexRationalNumber operator+ (const ComplexRationalNumber &c) const
ComplexRationalNumberoperator+= (const ComplexRationalNumber &c)
 Addition assignment.
ComplexRationalNumber operator- (const ComplexRationalNumber &c) const
ComplexRationalNumberoperator-= (const ComplexRationalNumber &c)
 Subtraction assignment.
ComplexRationalNumber operator- () const
ComplexRationalNumber operator* (const ComplexRationalNumber &c) const
ComplexRationalNumberoperator*= (const ComplexRationalNumber &c)
 Multiplication assignment.
ComplexRationalNumberoperator*= (const mpq_class &c)
ComplexRationalNumberoperator*= (int c)
ComplexRationalNumber operator^ (long long int e) const
 Overload operator ^ replace xor operation by exponentiation. More...
ComplexRationalNumberoperator^= (long long int e)
 Exponentiation assignment.
ExpressionTree convertToExpressionTree () const
 Convert this to an expression tree. More...
ComplexRationalNumber operator/ (const ComplexRationalNumber &c) const
 Exact division.
ComplexRationalNumberoperator/= (const ComplexRationalNumber &c)
 Exact division assignment.
ComplexRationalNumber operator% (const ComplexRationalNumber &c) const
 Get the remainder of *this and b;.
ComplexRationalNumberoperator%= (const ComplexRationalNumber &c)
 Assign *this to be the remainder of *this and b.
ComplexRationalNumber gcd (const ComplexRationalNumber &c) const
 GCD(a, b) More...
Factors< ComplexRationalNumbersquareFree () const
 Compute squarefree factorization of *this.
ComplexRationalNumber euclideanSize () const
 Get the euclidean size of *this.
ComplexRationalNumber euclideanDivision (const ComplexRationalNumber &b, ComplexRationalNumber *q=NULL) const
 Perform the eucldiean division of *this and b. More...
ComplexRationalNumber extendedEuclidean (const ComplexRationalNumber &b, ComplexRationalNumber *s=NULL, ComplexRationalNumber *t=NULL) const
 Perform the extended euclidean division on *this and b. More...
ComplexRationalNumber quotient (const ComplexRationalNumber &b) const
 Get the quotient of *this and b.
ComplexRationalNumber remainder (const ComplexRationalNumber &b) const
 Get the remainder of *this and b.
ComplexRationalNumber inverse () const
 Get the inverse of *this.
RationalNumber realPart () const
RationalNumber imaginaryPart () const
ComplexRationalNumber conjugate () const
void print (std::ostream &out) const
 Print the Ring element. More...

Static Public Attributes

static mpz_class characteristic
static RingProperties properties

Detailed Description

An arbitrary-precision complex rational number.

Member Function Documentation

◆ convertToExpressionTree()

ExpressionTree ComplexRationalNumber::convertToExpressionTree ( ) const

Convert this to an expression tree.

returns an expression tree describing *this.

Implements ExpressionTreeConvert.

◆ euclideanDivision()

ComplexRationalNumber ComplexRationalNumber::euclideanDivision ( const ComplexRationalNumber b,
ComplexRationalNumber q = NULL 
) const

Perform the eucldiean division of *this and b.

Returns the remainder. If q is not NULL, then returns the quotient in q.

Implements BPASEuclideanDomain< ComplexRationalNumber >.

◆ extendedEuclidean()

ComplexRationalNumber ComplexRationalNumber::extendedEuclidean ( const ComplexRationalNumber b,
ComplexRationalNumber s = NULL,
ComplexRationalNumber t = NULL 
) const

Perform the extended euclidean division on *this and b.

Returns the GCD. If s and t are not NULL, returns the bezout coefficients in them.

Implements BPASEuclideanDomain< ComplexRationalNumber >.

◆ gcd()

ComplexRationalNumber ComplexRationalNumber::gcd ( const ComplexRationalNumber c) const

GCD(a, b)

bThe other rational number

Implements BPASGCDDomain< ComplexRationalNumber >.

◆ isConstant()

int ComplexRationalNumber::isConstant ( ) const

Is a constant.


◆ isNegativeOne()

bool ComplexRationalNumber::isNegativeOne ( ) const

Is a -1.


◆ isOne()

bool ComplexRationalNumber::isOne ( ) const

Is a 1.


Implements BPASRing< ComplexRationalNumber >.

◆ isZero()

bool ComplexRationalNumber::isZero ( ) const

Is a zero.


Implements BPASRing< ComplexRationalNumber >.

◆ negativeOne()

void ComplexRationalNumber::negativeOne ( )

Assign to negative one.


◆ one()

void ComplexRationalNumber::one ( )

Assign to one.


Implements BPASRing< ComplexRationalNumber >.

◆ operator!=()

bool ComplexRationalNumber::operator!= ( const ComplexRationalNumber ) const

Inequality test,.

returns true iff not equal.

Implements BPASRing< ComplexRationalNumber >.

◆ operator==()

bool ComplexRationalNumber::operator== ( const ComplexRationalNumber ) const

Equality test,.

returns true iff equal

Implements BPASRing< ComplexRationalNumber >.

◆ operator^()

ComplexRationalNumber ComplexRationalNumber::operator^ ( long long int  e) const

Overload operator ^ replace xor operation by exponentiation.

eThe exponentiation

Implements BPASRing< ComplexRationalNumber >.

◆ print()

void ComplexRationalNumber::print ( std::ostream &  ostream) const

Print the Ring element.

Derived classes may override this to get custom printing that may be more expressive (and prettier) than expression tree printing.

Reimplemented from BPASRing< ComplexRationalNumber >.

◆ unitCanonical()

ComplexRationalNumber ComplexRationalNumber::unitCanonical ( ComplexRationalNumber u = NULL,
ComplexRationalNumber v = NULL 
) const

Obtain the unit normal (a.k.a canonical associate) of an element.

If either parameters u, v, are non-NULL then the units are returned such that b = ua, v = u^-1. Where b is the unit normal of a, and is the returned value.

Implements BPASRing< ComplexRationalNumber >.

◆ zero()

void ComplexRationalNumber::zero ( )

Assign to zero.


Implements BPASRing< ComplexRationalNumber >.

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