Basic Polynomial Algebra Subprograms (BPAS)  v. 1.791
Public Member Functions | Friends | List of all members
Integer Class Reference

An arbitrary-precision Integer. More...

#include <Integer.hpp>

Simplified semantic inheritance diagram for Integer:
- Full inheritance diagram for Integer:
[legend]

Public Member Functions

 Integer ()
 Get a zero integer.
 
 Integer (int a)
 Construct and Integer from an int.
 
 Integer (const mpz_t &a)
 Construct an integer form a GMP mpz_t.
 
 Integer (const mpz_class &a)
 Construct an integer from a GMP mpz_class.
 
 Integer (const Integer &a)
 Copy assignment from another Integer.
 
 Integer (const RationalNumber &a)
 Attempts to construct an Integer from a rational number. More...
 
 Integer (const ComplexRationalNumber &a)
 Attempts to construct an Integer from a complex rational number. More...
 
 Integer (const SmallPrimeField &a)
 Attempts to construct an Integer from a SmallPrimeField. More...
 
 Integer (const BigPrimeField &a)
 Attempts to construct an Integer from a BigPrimeField. More...
 
 Integer (const GeneralizedFermatPrimeField &a)
 Attempts to construct an Integer from a GeneralizedFermatPrimeField. More...
 
 Integer (const DenseUnivariateIntegerPolynomial &a)
 Attempts to construct an Integer from a DenseUnivariateIntegerPolynomial. More...
 
 Integer (const DenseUnivariateRationalPolynomial &a)
 Attempts to construct an Integer from a DenseUnivariateRationalPolynomial. More...
 
 Integer (const SparseUnivariatePolynomial< Integer > &a)
 Attempts to construct an Integer from a SparseUnivariatePolynomial<Integer>. More...
 
 Integer (const SparseUnivariatePolynomial< RationalNumber > &a)
 Attempts to construct an Integer from a SparseUnivariatePolynomial<RationalNumber>. More...
 
 Integer (const SparseUnivariatePolynomial< ComplexRationalNumber > &a)
 Attempts to construct an Integer from a SparseUnivariatePolynomial<ComplexRationalNumber>. More...
 
template<class Ring >
 Integer (const SparseUnivariatePolynomial< Ring > &a)
 Attempts to construct an Integer from a SparseUniveraitePolynomial<Ring> for a generic ring. More...
 
mpz_class & get_mpz_ref ()
 
const mpz_class & get_mpz_ref () const
 
mpz_class get_mpz () const
 
mpz_ptr get_mpz_t ()
 
mpz_srcptr get_mpz_t () const
 
double get_d () const
 
long int get_si () const
 
unsigned long int get_ui () const
 
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...
 
Integer unitCanonical (Integer *u=NULL, Integer *v=NULL) const
 Obtain the unit normal (a.k.a canonical associate) of an element. More...
 
Integeroperator= (const Integer &a)
 Copy assignment.
 
Integer operator+ (const Integer &i) const
 Addition.
 
Integeroperator+= (const Integer &i)
 Addition assignment.
 
Integer operator- (const Integer &i) const
 Subtraction.
 
Integeroperator-= (const Integer &i)
 Subtraction assignment.
 
Integer operator- () const
 Negation.
 
Integer operator* (const Integer &i) const
 Multiplication.
 
Integeroperator*= (const Integer &i)
 Multiplication assignment.
 
Integer operator^ (long long int e) const
 Exponentiation.
 
Integeroperator^= (long long int e)
 Exponentiation assignment.
 
bool operator== (const Integer &i) const
 Equality test,. More...
 
bool operator!= (const Integer &i) const
 Inequality test,. More...
 
bool operator< (const Integer &r) const
 
bool operator<= (const Integer &r) const
 
bool operator> (const Integer &r) const
 
bool operator>= (const Integer &r) const
 
ExpressionTree convertToExpressionTree () const
 Convert this to an expression tree. More...
 
Integer operator/ (const Integer &i) const
 Exact division.
 
Integeroperator/= (const Integer &i)
 Exact division assignment.
 
bool divisible (unsigned long int i)
 
Integer operator% (const Integer &r) const
 Get the remainder of *this and b;. More...
 
Integeroperator%= (const Integer &r)
 Assign *this to be the remainder of *this and b. More...
 
Integer gcd (const Integer &other) const
 Get GCD of *this and other.
 
Factors< IntegersquareFree () const
 Compute squarefree factorization of *this.
 
Integer euclideanSize () const
 Get the euclidean size of *this.
 
Integer euclideanDivision (const Integer &b, Integer *q=NULL) const
 Perform the eucldiean division of *this and b. More...
 
Integer extendedEuclidean (const Integer &b, Integer *s=NULL, Integer *t=NULL) const
 Perform the extended euclidean division on *this and b. More...
 
Integer quotient (const Integer &b) const
 Get the quotient of *this and b.
 
Integer remainder (const Integer &b) const
 Get the remainder of *this and b.
 

Friends

Integer operator+ (int a, const Integer &r)
 
Integer operator- (int a, const Integer &r)
 
Integer operator* (int a, const Integer &r)
 
Integer operator/ (int a, const Integer &r)
 
bool operator< (int a, const Integer &r)
 
bool operator<= (int a, const Integer &r)
 
bool operator> (int a, const Integer &r)
 
bool operator>= (int a, const Integer &r)
 
Integer operator+ (long int a, const Integer &r)
 
Integer operator- (long int a, const Integer &r)
 
Integer operator* (long int a, const Integer &r)
 
Integer operator/ (long int a, const Integer &r)
 
Integer abs (const Integer &i)
 
bool operator< (long int a, const Integer &r)
 
bool operator<= (long int a, const Integer &r)
 
bool operator> (long int a, const Integer &r)
 
bool operator>= (long int a, const Integer &r)
 

Detailed Description

An arbitrary-precision Integer.

Constructor & Destructor Documentation

◆ Integer() [1/11]

Integer::Integer ( const RationalNumber a)
explicit

Attempts to construct an Integer from a rational number.

If the conversion is not exact, causes an error.

◆ Integer() [2/11]

Integer::Integer ( const ComplexRationalNumber a)
explicit

Attempts to construct an Integer from a complex rational number.

If the conversion is not exact, causes an error.

◆ Integer() [3/11]

Integer::Integer ( const SmallPrimeField a)
explicit

Attempts to construct an Integer from a SmallPrimeField.

If the conversion is not exact, causes an error.

◆ Integer() [4/11]

Integer::Integer ( const BigPrimeField a)
explicit

Attempts to construct an Integer from a BigPrimeField.

If the conversion is not exact, causes an error.

◆ Integer() [5/11]

Integer::Integer ( const GeneralizedFermatPrimeField a)
explicit

Attempts to construct an Integer from a GeneralizedFermatPrimeField.

If the conversion is not exact, causes an error.

◆ Integer() [6/11]

Integer::Integer ( const DenseUnivariateIntegerPolynomial a)
explicit

Attempts to construct an Integer from a DenseUnivariateIntegerPolynomial.

If the conversion is not exact, causes an error.

◆ Integer() [7/11]

Integer::Integer ( const DenseUnivariateRationalPolynomial a)
explicit

Attempts to construct an Integer from a DenseUnivariateRationalPolynomial.

If the conversion is not exact, causes an error.

◆ Integer() [8/11]

Integer::Integer ( const SparseUnivariatePolynomial< Integer > &  a)
explicit

Attempts to construct an Integer from a SparseUnivariatePolynomial<Integer>.

If the conversion is not exact, causes an error.

◆ Integer() [9/11]

Integer::Integer ( const SparseUnivariatePolynomial< RationalNumber > &  a)
explicit

Attempts to construct an Integer from a SparseUnivariatePolynomial<RationalNumber>.

If the conversion is not exact, causes an error.

◆ Integer() [10/11]

Integer::Integer ( const SparseUnivariatePolynomial< ComplexRationalNumber > &  a)
explicit

Attempts to construct an Integer from a SparseUnivariatePolynomial<ComplexRationalNumber>.

If the conversion is not exact, causes an error.

◆ Integer() [11/11]

template<class Ring >
Integer::Integer ( const SparseUnivariatePolynomial< Ring > &  a)
explicit

Attempts to construct an Integer from a SparseUniveraitePolynomial<Ring> for a generic ring.

If the conversion is not exact, causes an error.

Member Function Documentation

◆ convertToExpressionTree()

ExpressionTree Integer::convertToExpressionTree ( ) const
inlinevirtual

Convert this to an expression tree.

returns an expression tree describing *this.

Implements ExpressionTreeConvert.

◆ euclideanDivision()

Integer Integer::euclideanDivision ( const Integer b,
Integer q = NULL 
) const
virtual

Perform the eucldiean division of *this and b.

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

Implements BPASEuclideanDomain< Integer >.

◆ extendedEuclidean()

Integer Integer::extendedEuclidean ( const Integer b,
Integer s = NULL,
Integer t = NULL 
) const
virtual

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< Integer >.

◆ isConstant()

int Integer::isConstant ( ) const
inline

Is a constant.

Parameters

◆ isNegativeOne()

bool Integer::isNegativeOne ( ) const
inline

Is a -1.

Parameters

◆ isOne()

bool Integer::isOne ( ) const
inlinevirtual

Is a 1.

Parameters

Implements BPASRing< Integer >.

◆ isZero()

bool Integer::isZero ( ) const
inlinevirtual

Is a zero.

Parameters

Implements BPASRing< Integer >.

◆ negativeOne()

void Integer::negativeOne ( )
inline

Assign to negative one.

Parameters

◆ one()

void Integer::one ( )
inlinevirtual

Assign to one.

Parameters

Implements BPASRing< Integer >.

◆ operator!=()

bool Integer::operator!= ( const Integer i) const
inlinevirtual

Inequality test,.

returns true iff not equal.

Implements BPASRing< Integer >.

◆ operator%()

Integer Integer::operator% ( const Integer b) const
inlinevirtual

Get the remainder of *this and b;.

Parameters
bthe divisor
Returns
the remainder

Implements BPASEuclideanDomain< Integer >.

◆ operator%=()

Integer& Integer::operator%= ( const Integer b)
inlinevirtual

Assign *this to be the remainder of *this and b.

Parameters
bthe divisor
Returns
this after assignment.

Implements BPASEuclideanDomain< Integer >.

◆ operator==()

bool Integer::operator== ( const Integer i) const
inlinevirtual

Equality test,.

returns true iff equal

Implements BPASRing< Integer >.

◆ unitCanonical()

Integer Integer::unitCanonical ( Integer u = NULL,
Integer v = NULL 
) const
virtual

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< Integer >.

◆ zero()

void Integer::zero ( )
inlinevirtual

Assign to zero.

Parameters

Implements BPASRing< Integer >.


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