cvc4-1.4
CVC4::Integer Class Reference

#include <integer_cln_imp.h>

Public Member Functions

 Integer ()
 Constructs a rational with the value 0.
 
 Integer (const char *sp, unsigned base=10) throw (std::invalid_argument)
 Constructs a Integer from a C string.
 
 Integer (const std::string &s, unsigned base=10) throw (std::invalid_argument)
 
 Integer (const Integer &q)
 
 Integer (signed int z)
 
 Integer (unsigned int z)
 
 Integer (signed long int z)
 
 Integer (unsigned long int z)
 
 ~Integer ()
 
Integeroperator= (const Integer &x)
 
bool operator== (const Integer &y) const
 
Integer operator- () const
 
bool operator!= (const Integer &y) const
 
bool operator< (const Integer &y) const
 
bool operator<= (const Integer &y) const
 
bool operator> (const Integer &y) const
 
bool operator>= (const Integer &y) const
 
Integer operator+ (const Integer &y) const
 
Integeroperator+= (const Integer &y)
 
Integer operator- (const Integer &y) const
 
Integeroperator-= (const Integer &y)
 
Integer operator* (const Integer &y) const
 
Integeroperator*= (const Integer &y)
 
Integer bitwiseOr (const Integer &y) const
 
Integer bitwiseAnd (const Integer &y) const
 
Integer bitwiseXor (const Integer &y) const
 
Integer bitwiseNot () const
 
Integer multiplyByPow2 (uint32_t pow) const
 Return this*(2^pow).
 
bool isBitSet (uint32_t i) const
 
Integer setBit (uint32_t i) const
 
Integer oneExtend (uint32_t size, uint32_t amount) const
 
uint32_t toUnsignedInt () const
 
Integer extractBitRange (uint32_t bitCount, uint32_t low) const
 See CLN Documentation.
 
Integer floorDivideQuotient (const Integer &y) const
 Returns the floor(this / y)
 
Integer floorDivideRemainder (const Integer &y) const
 Returns r == this - floor(this/y)*y.
 
Integer ceilingDivideQuotient (const Integer &y) const
 Returns the ceil(this / y)
 
Integer ceilingDivideRemainder (const Integer &y) const
 Returns the ceil(this / y)
 
Integer euclidianDivideQuotient (const Integer &y) const
 Returns the quoitent according to Boute's Euclidean definition.
 
Integer euclidianDivideRemainder (const Integer &y) const
 Returns the remainfing according to Boute's Euclidean definition.
 
Integer exactQuotient (const Integer &y) const
 If y divides *this, then exactQuotient returns (this/y)
 
Integer modByPow2 (uint32_t exp) const
 
Integer divByPow2 (uint32_t exp) const
 
Integer pow (unsigned long int exp) const
 Raise this Integer to the power exp.
 
Integer gcd (const Integer &y) const
 Return the greatest common divisor of this integer with another.
 
Integer lcm (const Integer &y) const
 Return the least common multiple of this integer with another.
 
bool divides (const Integer &y) const
 Return true if *this exactly divides y.
 
Integer abs () const
 Return the absolute value of this integer.
 
std::string toString (int base=10) const
 
int sgn () const
 
bool strictlyPositive () const
 
bool strictlyNegative () const
 
bool isZero () const
 
bool isOne () const
 
bool isNegativeOne () const
 
bool fitsSignedInt () const
 fits the C "signed int" primitive
 
bool fitsUnsignedInt () const
 fits the C "unsigned int" primitive
 
int getSignedInt () const
 
unsigned int getUnsignedInt () const
 
long getLong () const
 
unsigned long getUnsignedLong () const
 
size_t hash () const
 Computes the hash of the node from the first word of the numerator, the denominator.
 
bool testBit (unsigned n) const
 Returns true iff bit n is set.
 
unsigned isPow2 () const
 Returns k if the integer is equal to 2^(k-1)
 
size_t length () const
 If x != 0, returns the unique n s.t.
 
 Integer ()
 Constructs a rational with the value 0.
 
 Integer (const char *s, unsigned base=10)
 Constructs a Integer from a C string.
 
 Integer (const std::string &s, unsigned base=10)
 
 Integer (const Integer &q)
 
 Integer (signed int z)
 
 Integer (unsigned int z)
 
 Integer (signed long int z)
 
 Integer (unsigned long int z)
 
 ~Integer ()
 
Integeroperator= (const Integer &x)
 
bool operator== (const Integer &y) const
 
Integer operator- () const
 
bool operator!= (const Integer &y) const
 
bool operator< (const Integer &y) const
 
bool operator<= (const Integer &y) const
 
bool operator> (const Integer &y) const
 
bool operator>= (const Integer &y) const
 
Integer operator+ (const Integer &y) const
 
Integeroperator+= (const Integer &y)
 
Integer operator- (const Integer &y) const
 
Integeroperator-= (const Integer &y)
 
Integer operator* (const Integer &y) const
 
Integeroperator*= (const Integer &y)
 
Integer bitwiseOr (const Integer &y) const
 
Integer bitwiseAnd (const Integer &y) const
 
Integer bitwiseXor (const Integer &y) const
 
Integer bitwiseNot () const
 
Integer multiplyByPow2 (uint32_t pow) const
 Return this*(2^pow).
 
Integer setBit (uint32_t i) const
 Returns the Integer obtained by setting the ith bit of the current Integer to 1.
 
bool isBitSet (uint32_t i) const
 
Integer oneExtend (uint32_t size, uint32_t amount) const
 Returns the integer with the binary representation of size bits extended with amount 1's.
 
uint32_t toUnsignedInt () const
 
Integer extractBitRange (uint32_t bitCount, uint32_t low) const
 See GMP Documentation.
 
Integer floorDivideQuotient (const Integer &y) const
 Returns the floor(this / y)
 
Integer floorDivideRemainder (const Integer &y) const
 Returns r == this - floor(this/y)*y.
 
Integer ceilingDivideQuotient (const Integer &y) const
 Returns the ceil(this / y)
 
Integer ceilingDivideRemainder (const Integer &y) const
 Returns the ceil(this / y)
 
Integer euclidianDivideQuotient (const Integer &y) const
 Returns the quoitent according to Boute's Euclidean definition.
 
Integer euclidianDivideRemainder (const Integer &y) const
 Returns the remainfing according to Boute's Euclidean definition.
 
Integer exactQuotient (const Integer &y) const
 If y divides *this, then exactQuotient returns (this/y)
 
Integer modByPow2 (uint32_t exp) const
 Returns y mod 2^exp.
 
Integer divByPow2 (uint32_t exp) const
 Returns y / 2^exp.
 
int sgn () const
 
bool strictlyPositive () const
 
bool strictlyNegative () const
 
bool isZero () const
 
bool isOne () const
 
bool isNegativeOne () const
 
Integer pow (unsigned long int exp) const
 Raise this Integer to the power exp.
 
Integer gcd (const Integer &y) const
 Return the greatest common divisor of this integer with another.
 
Integer lcm (const Integer &y) const
 Return the least common multiple of this integer with another.
 
bool divides (const Integer &y) const
 All non-zero integers z, z.divide(0) ! zero.divides(zero)
 
Integer abs () const
 Return the absolute value of this integer.
 
std::string toString (int base=10) const
 
bool fitsSignedInt () const
 
bool fitsUnsignedInt () const
 
signed int getSignedInt () const
 
unsigned int getUnsignedInt () const
 
long getLong () const
 
unsigned long getUnsignedLong () const
 
size_t hash () const
 Computes the hash of the node from the first word of the numerator, the denominator.
 
bool testBit (unsigned n) const
 Returns true iff bit n is set.
 
unsigned isPow2 () const
 Returns k if the integer is equal to 2^(k-1)
 
size_t length () const
 If x != 0, returns the smallest n s.t.
 

Static Public Member Functions

static void floorQR (Integer &q, Integer &r, const Integer &x, const Integer &y)
 Computes a floor quoient and remainder for x divided by y.
 
static void euclidianQR (Integer &q, Integer &r, const Integer &x, const Integer &y)
 Computes a quoitent and remainder according to Boute's Euclidean definition.
 
static void extendedGcd (Integer &g, Integer &s, Integer &t, const Integer &a, const Integer &b)
 
static const Integermin (const Integer &a, const Integer &b)
 Returns a reference to the minimum of two integers.
 
static const Integermax (const Integer &a, const Integer &b)
 Returns a reference to the maximum of two integers.
 
static void floorQR (Integer &q, Integer &r, const Integer &x, const Integer &y)
 Computes a floor quotient and remainder for x divided by y.
 
static void euclidianQR (Integer &q, Integer &r, const Integer &x, const Integer &y)
 Computes a quoitent and remainder according to Boute's Euclidean definition.
 
static void extendedGcd (Integer &g, Integer &s, Integer &t, const Integer &a, const Integer &b)
 
static const Integermin (const Integer &a, const Integer &b)
 Returns a reference to the minimum of two integers.
 
static const Integermax (const Integer &a, const Integer &b)
 Returns a reference to the maximum of two integers.
 

Friends

class CVC4::Rational
 

Detailed Description

Definition at line 34 of file integer_gmp_imp.h.

Constructor & Destructor Documentation

◆ Integer() [1/16]

CVC4::Integer::Integer ( )
inline

Constructs a rational with the value 0.

Definition at line 63 of file integer_cln_imp.h.

◆ Integer() [2/16]

CVC4::Integer::Integer ( const char * sp,
unsigned base = 10 )
throw (std::invalid_argument )
inlineexplicit

Constructs a Integer from a C string.

Throws std::invalid_argument if the string is not a valid rational. For more information about what is a valid rational string, see GMP's documentation for mpq_set_str().

Definition at line 71 of file integer_cln_imp.h.

◆ Integer() [3/16]

CVC4::Integer::Integer ( const std::string & s,
unsigned base = 10 )
throw (std::invalid_argument )
inlineexplicit

Definition at line 75 of file integer_cln_imp.h.

◆ Integer() [4/16]

CVC4::Integer::Integer ( const Integer & q)
inline

Definition at line 79 of file integer_cln_imp.h.

◆ Integer() [5/16]

CVC4::Integer::Integer ( signed int z)
inline

Definition at line 81 of file integer_cln_imp.h.

◆ Integer() [6/16]

CVC4::Integer::Integer ( unsigned int z)
inline

Definition at line 82 of file integer_cln_imp.h.

◆ Integer() [7/16]

CVC4::Integer::Integer ( signed long int z)
inline

Definition at line 83 of file integer_cln_imp.h.

◆ Integer() [8/16]

CVC4::Integer::Integer ( unsigned long int z)
inline

Definition at line 84 of file integer_cln_imp.h.

◆ ~Integer() [1/2]

CVC4::Integer::~Integer ( )
inline

Definition at line 91 of file integer_cln_imp.h.

◆ Integer() [9/16]

CVC4::Integer::Integer ( )
inline

Constructs a rational with the value 0.

Definition at line 56 of file integer_gmp_imp.h.

◆ Integer() [10/16]

CVC4::Integer::Integer ( const char * s,
unsigned base = 10 )
explicit

Constructs a Integer from a C string.

Throws std::invalid_argument if the string is not a valid rational. For more information about what is a valid rational string, see GMP's documentation for mpq_set_str().

◆ Integer() [11/16]

CVC4::Integer::Integer ( const std::string & s,
unsigned base = 10 )
explicit

◆ Integer() [12/16]

CVC4::Integer::Integer ( const Integer & q)
inline

Definition at line 67 of file integer_gmp_imp.h.

◆ Integer() [13/16]

CVC4::Integer::Integer ( signed int z)
inline

Definition at line 69 of file integer_gmp_imp.h.

◆ Integer() [14/16]

CVC4::Integer::Integer ( unsigned int z)
inline

Definition at line 70 of file integer_gmp_imp.h.

◆ Integer() [15/16]

CVC4::Integer::Integer ( signed long int z)
inline

Definition at line 71 of file integer_gmp_imp.h.

◆ Integer() [16/16]

CVC4::Integer::Integer ( unsigned long int z)
inline

Definition at line 72 of file integer_gmp_imp.h.

◆ ~Integer() [2/2]

CVC4::Integer::~Integer ( )
inline

Definition at line 79 of file integer_gmp_imp.h.

Member Function Documentation

◆ abs() [1/2]

Integer CVC4::Integer::abs ( ) const
inline

Return the absolute value of this integer.

Definition at line 360 of file integer_cln_imp.h.

◆ abs() [2/2]

Integer CVC4::Integer::abs ( ) const
inline

Return the absolute value of this integer.

Definition at line 413 of file integer_gmp_imp.h.

◆ bitwiseAnd() [1/2]

Integer CVC4::Integer::bitwiseAnd ( const Integer & y) const
inline

Definition at line 158 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::operator&().

◆ bitwiseAnd() [2/2]

Integer CVC4::Integer::bitwiseAnd ( const Integer & y) const
inline

Definition at line 148 of file integer_gmp_imp.h.

◆ bitwiseNot() [1/2]

Integer CVC4::Integer::bitwiseNot ( ) const
inline

Definition at line 166 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::operator~().

◆ bitwiseNot() [2/2]

Integer CVC4::Integer::bitwiseNot ( ) const
inline

Definition at line 160 of file integer_gmp_imp.h.

◆ bitwiseOr() [1/2]

Integer CVC4::Integer::bitwiseOr ( const Integer & y) const
inline

Definition at line 154 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::operator|().

◆ bitwiseOr() [2/2]

Integer CVC4::Integer::bitwiseOr ( const Integer & y) const
inline

Definition at line 142 of file integer_gmp_imp.h.

◆ bitwiseXor() [1/2]

Integer CVC4::Integer::bitwiseXor ( const Integer & y) const
inline

Definition at line 162 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::operator^().

◆ bitwiseXor() [2/2]

Integer CVC4::Integer::bitwiseXor ( const Integer & y) const
inline

Definition at line 154 of file integer_gmp_imp.h.

◆ ceilingDivideQuotient() [1/2]

Integer CVC4::Integer::ceilingDivideQuotient ( const Integer & y) const
inline

Returns the ceil(this / y)

Definition at line 234 of file integer_cln_imp.h.

◆ ceilingDivideQuotient() [2/2]

Integer CVC4::Integer::ceilingDivideQuotient ( const Integer & y) const
inline

Returns the ceil(this / y)

Definition at line 249 of file integer_gmp_imp.h.

◆ ceilingDivideRemainder() [1/2]

Integer CVC4::Integer::ceilingDivideRemainder ( const Integer & y) const
inline

Returns the ceil(this / y)

Definition at line 241 of file integer_cln_imp.h.

◆ ceilingDivideRemainder() [2/2]

Integer CVC4::Integer::ceilingDivideRemainder ( const Integer & y) const
inline

Returns the ceil(this / y)

Definition at line 258 of file integer_gmp_imp.h.

◆ divByPow2() [1/2]

Integer CVC4::Integer::divByPow2 ( uint32_t exp) const
inline

◆ divByPow2() [2/2]

Integer CVC4::Integer::divByPow2 ( uint32_t exp) const
inline

Returns y / 2^exp.

Definition at line 341 of file integer_gmp_imp.h.

◆ divides() [1/2]

bool CVC4::Integer::divides ( const Integer & y) const
inline

Return true if *this exactly divides y.

Definition at line 352 of file integer_cln_imp.h.

Referenced by exactQuotient().

◆ divides() [2/2]

bool CVC4::Integer::divides ( const Integer & y) const
inline

All non-zero integers z, z.divide(0) ! zero.divides(zero)

Definition at line 405 of file integer_gmp_imp.h.

◆ euclidianDivideQuotient() [1/2]

Integer CVC4::Integer::euclidianDivideQuotient ( const Integer & y) const
inline

Returns the quoitent according to Boute's Euclidean definition.

See the documentation for euclidianQR.

Definition at line 284 of file integer_cln_imp.h.

◆ euclidianDivideQuotient() [2/2]

Integer CVC4::Integer::euclidianDivideQuotient ( const Integer & y) const
inline

Returns the quoitent according to Boute's Euclidean definition.

See the documentation for euclidianQR.

Definition at line 302 of file integer_gmp_imp.h.

◆ euclidianDivideRemainder() [1/2]

Integer CVC4::Integer::euclidianDivideRemainder ( const Integer & y) const
inline

Returns the remainfing according to Boute's Euclidean definition.

See the documentation for euclidianQR.

Definition at line 294 of file integer_cln_imp.h.

◆ euclidianDivideRemainder() [2/2]

Integer CVC4::Integer::euclidianDivideRemainder ( const Integer & y) const
inline

Returns the remainfing according to Boute's Euclidean definition.

See the documentation for euclidianQR.

Definition at line 312 of file integer_gmp_imp.h.

◆ euclidianQR() [1/2]

static void CVC4::Integer::euclidianQR ( Integer & q,
Integer & r,
const Integer & x,
const Integer & y )
inlinestatic

Computes a quoitent and remainder according to Boute's Euclidean definition.

euclidianDivideQuotient, euclidianDivideRemainder.

Boute, Raymond T. (April 1992). The Euclidean definition of the functions div and mod. ACM Transactions on Programming Languages and Systems (TOPLAS) ACM Press. 14 (2): 127 - 144. doi:10.1145/128861.128862.

Definition at line 254 of file integer_cln_imp.h.

References sgn(), and strictlyNegative().

◆ euclidianQR() [2/2]

static void CVC4::Integer::euclidianQR ( Integer & q,
Integer & r,
const Integer & x,
const Integer & y )
inlinestatic

Computes a quoitent and remainder according to Boute's Euclidean definition.

euclidianDivideQuotient, euclidianDivideRemainder.

Boute, Raymond T. (April 1992). The Euclidean definition of the functions div and mod. ACM Transactions on Programming Languages and Systems (TOPLAS) ACM Press. 14 (2): 127 - 144. doi:10.1145/128861.128862.

Definition at line 273 of file integer_gmp_imp.h.

References sgn(), and strictlyNegative().

◆ exactQuotient() [1/2]

Integer CVC4::Integer::exactQuotient ( const Integer & y) const
inline

If y divides *this, then exactQuotient returns (this/y)

Definition at line 303 of file integer_cln_imp.h.

References CVC4::DebugCheckArgument(), and divides().

◆ exactQuotient() [2/2]

Integer CVC4::Integer::exactQuotient ( const Integer & y) const
inline

If y divides *this, then exactQuotient returns (this/y)

Definition at line 322 of file integer_gmp_imp.h.

References CVC4::DebugCheckArgument(), and divides().

◆ extendedGcd() [1/2]

static void CVC4::Integer::extendedGcd ( Integer & g,
Integer & s,
Integer & t,
const Integer & a,
const Integer & b )
inlinestatic

Definition at line 498 of file integer_cln_imp.h.

◆ extendedGcd() [2/2]

static void CVC4::Integer::extendedGcd ( Integer & g,
Integer & s,
Integer & t,
const Integer & a,
const Integer & b )
inlinestatic

Definition at line 489 of file integer_gmp_imp.h.

◆ extractBitRange() [1/2]

Integer CVC4::Integer::extractBitRange ( uint32_t bitCount,
uint32_t low ) const
inline

See CLN Documentation.

Definition at line 204 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::arithRightShift(), CVC4::BitVector::extract(), and CVC4::BitVector::signExtend().

◆ extractBitRange() [2/2]

Integer CVC4::Integer::extractBitRange ( uint32_t bitCount,
uint32_t low ) const
inline

See GMP Documentation.

Definition at line 210 of file integer_gmp_imp.h.

◆ fitsSignedInt() [1/2]

bool CVC4::Integer::fitsSignedInt ( ) const

fits the C "signed int" primitive

◆ fitsSignedInt() [2/2]

bool CVC4::Integer::fitsSignedInt ( ) const

◆ fitsUnsignedInt() [1/2]

bool CVC4::Integer::fitsUnsignedInt ( ) const

fits the C "unsigned int" primitive

◆ fitsUnsignedInt() [2/2]

bool CVC4::Integer::fitsUnsignedInt ( ) const

◆ floorDivideQuotient() [1/2]

Integer CVC4::Integer::floorDivideQuotient ( const Integer & y) const
inline

Returns the floor(this / y)

Definition at line 212 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::unsignedDivTotal().

◆ floorDivideQuotient() [2/2]

Integer CVC4::Integer::floorDivideQuotient ( const Integer & y) const
inline

Returns the floor(this / y)

Definition at line 224 of file integer_gmp_imp.h.

◆ floorDivideRemainder() [1/2]

Integer CVC4::Integer::floorDivideRemainder ( const Integer & y) const
inline

Returns r == this - floor(this/y)*y.

Definition at line 219 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::unsignedRemTotal().

◆ floorDivideRemainder() [2/2]

Integer CVC4::Integer::floorDivideRemainder ( const Integer & y) const
inline

Returns r == this - floor(this/y)*y.

Definition at line 233 of file integer_gmp_imp.h.

◆ floorQR() [1/2]

static void CVC4::Integer::floorQR ( Integer & q,
Integer & r,
const Integer & x,
const Integer & y )
inlinestatic

Computes a floor quoient and remainder for x divided by y.

Definition at line 225 of file integer_cln_imp.h.

◆ floorQR() [2/2]

static void CVC4::Integer::floorQR ( Integer & q,
Integer & r,
const Integer & x,
const Integer & y )
inlinestatic

Computes a floor quotient and remainder for x divided by y.

Definition at line 242 of file integer_gmp_imp.h.

◆ gcd() [1/2]

Integer CVC4::Integer::gcd ( const Integer & y) const
inline

Return the greatest common divisor of this integer with another.

Definition at line 336 of file integer_cln_imp.h.

◆ gcd() [2/2]

Integer CVC4::Integer::gcd ( const Integer & y) const
inline

Return the greatest common divisor of this integer with another.

Definition at line 386 of file integer_gmp_imp.h.

◆ getLong() [1/2]

long CVC4::Integer::getLong ( ) const
inline

Definition at line 428 of file integer_cln_imp.h.

References CVC4::CheckArgument().

◆ getLong() [2/2]

long CVC4::Integer::getLong ( ) const
inline

Definition at line 429 of file integer_gmp_imp.h.

References CVC4::CheckArgument().

◆ getSignedInt() [1/2]

int CVC4::Integer::getSignedInt ( ) const

◆ getSignedInt() [2/2]

signed int CVC4::Integer::getSignedInt ( ) const

◆ getUnsignedInt() [1/2]

unsigned int CVC4::Integer::getUnsignedInt ( ) const

◆ getUnsignedInt() [2/2]

unsigned int CVC4::Integer::getUnsignedInt ( ) const

◆ getUnsignedLong() [1/2]

unsigned long CVC4::Integer::getUnsignedLong ( ) const
inline

Definition at line 437 of file integer_cln_imp.h.

References CVC4::CheckArgument().

◆ getUnsignedLong() [2/2]

unsigned long CVC4::Integer::getUnsignedLong ( ) const
inline

Definition at line 436 of file integer_gmp_imp.h.

References CVC4::CheckArgument().

◆ hash() [1/2]

size_t CVC4::Integer::hash ( ) const
inline

Computes the hash of the node from the first word of the numerator, the denominator.

Definition at line 450 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::hash(), CVC4::DivisibleHashFunction::operator()(), CVC4::IntegerHashFunction::operator()(), and CVC4::SubrangeBoundsHashFunction::operator()().

◆ hash() [2/2]

size_t CVC4::Integer::hash ( ) const
inline

Computes the hash of the node from the first word of the numerator, the denominator.

Definition at line 448 of file integer_gmp_imp.h.

References CVC4::gmpz_hash().

◆ isBitSet() [1/2]

bool CVC4::Integer::isBitSet ( uint32_t i) const
inline

Definition at line 179 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::isBitSet().

◆ isBitSet() [2/2]

bool CVC4::Integer::isBitSet ( uint32_t i) const
inline

Definition at line 185 of file integer_gmp_imp.h.

◆ isNegativeOne() [1/2]

bool CVC4::Integer::isNegativeOne ( ) const
inline

Definition at line 414 of file integer_cln_imp.h.

◆ isNegativeOne() [2/2]

bool CVC4::Integer::isNegativeOne ( ) const
inline

Definition at line 368 of file integer_gmp_imp.h.

◆ isOne() [1/2]

bool CVC4::Integer::isOne ( ) const
inline

Definition at line 410 of file integer_cln_imp.h.

◆ isOne() [2/2]

bool CVC4::Integer::isOne ( ) const
inline

Definition at line 364 of file integer_gmp_imp.h.

◆ isPow2() [1/2]

unsigned CVC4::Integer::isPow2 ( ) const
inline

Returns k if the integer is equal to 2^(k-1)

Returns
k if the integer is equal to 2^(k-1) and 0 otherwise

Definition at line 468 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::isPow2().

◆ isPow2() [2/2]

unsigned CVC4::Integer::isPow2 ( ) const
inline

Returns k if the integer is equal to 2^(k-1)

Returns
k if the integer is equal to 2^(k-1) and 0 otherwise

Definition at line 466 of file integer_gmp_imp.h.

◆ isZero() [1/2]

bool CVC4::Integer::isZero ( ) const
inline

Definition at line 406 of file integer_cln_imp.h.

◆ isZero() [2/2]

bool CVC4::Integer::isZero ( ) const
inline

Definition at line 360 of file integer_gmp_imp.h.

◆ lcm() [1/2]

Integer CVC4::Integer::lcm ( const Integer & y) const
inline

Return the least common multiple of this integer with another.

Definition at line 344 of file integer_cln_imp.h.

◆ lcm() [2/2]

Integer CVC4::Integer::lcm ( const Integer & y) const
inline

Return the least common multiple of this integer with another.

Definition at line 395 of file integer_gmp_imp.h.

◆ length() [1/2]

size_t CVC4::Integer::length ( ) const
inline

If x != 0, returns the unique n s.t.

2^{n-1} <= abs(x) < 2^{n}. If x == 0, returns 1.

Definition at line 478 of file integer_cln_imp.h.

◆ length() [2/2]

size_t CVC4::Integer::length ( ) const
inline

If x != 0, returns the smallest n s.t.

2^{n-1} <= abs(x) < 2^{n}. If x == 0, returns 1.

Definition at line 481 of file integer_gmp_imp.h.

◆ max() [1/2]

static const Integer & CVC4::Integer::max ( const Integer & a,
const Integer & b )
inlinestatic

Returns a reference to the maximum of two integers.

Definition at line 508 of file integer_cln_imp.h.

◆ max() [2/2]

static const Integer & CVC4::Integer::max ( const Integer & a,
const Integer & b )
inlinestatic

Returns a reference to the maximum of two integers.

Definition at line 501 of file integer_gmp_imp.h.

◆ min() [1/2]

static const Integer & CVC4::Integer::min ( const Integer & a,
const Integer & b )
inlinestatic

Returns a reference to the minimum of two integers.

Definition at line 503 of file integer_cln_imp.h.

◆ min() [2/2]

static const Integer & CVC4::Integer::min ( const Integer & a,
const Integer & b )
inlinestatic

Returns a reference to the minimum of two integers.

Definition at line 496 of file integer_gmp_imp.h.

◆ modByPow2() [1/2]

Integer CVC4::Integer::modByPow2 ( uint32_t exp) const
inline

Definition at line 308 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::BitVector(), and CVC4::BitVector::BitVector().

◆ modByPow2() [2/2]

Integer CVC4::Integer::modByPow2 ( uint32_t exp) const
inline

Returns y mod 2^exp.

Definition at line 332 of file integer_gmp_imp.h.

◆ multiplyByPow2() [1/2]

Integer CVC4::Integer::multiplyByPow2 ( uint32_t pow) const
inline

Return this*(2^pow).

Definition at line 174 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::concat(), and CVC4::BitVector::leftShift().

◆ multiplyByPow2() [2/2]

Integer CVC4::Integer::multiplyByPow2 ( uint32_t pow) const
inline

Return this*(2^pow).

Definition at line 169 of file integer_gmp_imp.h.

◆ oneExtend() [1/2]

Integer CVC4::Integer::oneExtend ( uint32_t size,
uint32_t amount ) const
inline

◆ oneExtend() [2/2]

Integer CVC4::Integer::oneExtend ( uint32_t size,
uint32_t amount ) const
inline

Returns the integer with the binary representation of size bits extended with amount 1's.

Definition at line 193 of file integer_gmp_imp.h.

References CVC4::DebugCheckArgument().

◆ operator!=() [1/2]

bool CVC4::Integer::operator!= ( const Integer & y) const
inline

Definition at line 108 of file integer_cln_imp.h.

◆ operator!=() [2/2]

bool CVC4::Integer::operator!= ( const Integer & y) const
inline

Definition at line 96 of file integer_gmp_imp.h.

◆ operator*() [1/2]

Integer CVC4::Integer::operator* ( const Integer & y) const
inline

Definition at line 145 of file integer_cln_imp.h.

◆ operator*() [2/2]

Integer CVC4::Integer::operator* ( const Integer & y) const
inline

Definition at line 133 of file integer_gmp_imp.h.

◆ operator*=() [1/2]

Integer & CVC4::Integer::operator*= ( const Integer & y)
inline

Definition at line 148 of file integer_cln_imp.h.

◆ operator*=() [2/2]

Integer & CVC4::Integer::operator*= ( const Integer & y)
inline

Definition at line 136 of file integer_gmp_imp.h.

◆ operator+() [1/2]

Integer CVC4::Integer::operator+ ( const Integer & y) const
inline

Definition at line 129 of file integer_cln_imp.h.

◆ operator+() [2/2]

Integer CVC4::Integer::operator+ ( const Integer & y) const
inline

Definition at line 117 of file integer_gmp_imp.h.

◆ operator+=() [1/2]

Integer & CVC4::Integer::operator+= ( const Integer & y)
inline

Definition at line 132 of file integer_cln_imp.h.

◆ operator+=() [2/2]

Integer & CVC4::Integer::operator+= ( const Integer & y)
inline

Definition at line 120 of file integer_gmp_imp.h.

◆ operator-() [1/4]

Integer CVC4::Integer::operator- ( ) const
inline

Definition at line 103 of file integer_cln_imp.h.

◆ operator-() [2/4]

Integer CVC4::Integer::operator- ( ) const
inline

Definition at line 91 of file integer_gmp_imp.h.

◆ operator-() [3/4]

Integer CVC4::Integer::operator- ( const Integer & y) const
inline

Definition at line 137 of file integer_cln_imp.h.

◆ operator-() [4/4]

Integer CVC4::Integer::operator- ( const Integer & y) const
inline

Definition at line 125 of file integer_gmp_imp.h.

◆ operator-=() [1/2]

Integer & CVC4::Integer::operator-= ( const Integer & y)
inline

Definition at line 140 of file integer_cln_imp.h.

◆ operator-=() [2/2]

Integer & CVC4::Integer::operator-= ( const Integer & y)
inline

Definition at line 128 of file integer_gmp_imp.h.

◆ operator<() [1/2]

bool CVC4::Integer::operator< ( const Integer & y) const
inline

Definition at line 112 of file integer_cln_imp.h.

◆ operator<() [2/2]

bool CVC4::Integer::operator< ( const Integer & y) const
inline

Definition at line 100 of file integer_gmp_imp.h.

◆ operator<=() [1/2]

bool CVC4::Integer::operator<= ( const Integer & y) const
inline

Definition at line 116 of file integer_cln_imp.h.

◆ operator<=() [2/2]

bool CVC4::Integer::operator<= ( const Integer & y) const
inline

Definition at line 104 of file integer_gmp_imp.h.

◆ operator=() [1/2]

Integer & CVC4::Integer::operator= ( const Integer & x)
inline

Definition at line 93 of file integer_cln_imp.h.

◆ operator=() [2/2]

Integer & CVC4::Integer::operator= ( const Integer & x)
inline

Definition at line 81 of file integer_gmp_imp.h.

◆ operator==() [1/2]

bool CVC4::Integer::operator== ( const Integer & y) const
inline

Definition at line 99 of file integer_cln_imp.h.

◆ operator==() [2/2]

bool CVC4::Integer::operator== ( const Integer & y) const
inline

Definition at line 87 of file integer_gmp_imp.h.

◆ operator>() [1/2]

bool CVC4::Integer::operator> ( const Integer & y) const
inline

Definition at line 120 of file integer_cln_imp.h.

◆ operator>() [2/2]

bool CVC4::Integer::operator> ( const Integer & y) const
inline

Definition at line 108 of file integer_gmp_imp.h.

◆ operator>=() [1/2]

bool CVC4::Integer::operator>= ( const Integer & y) const
inline

Definition at line 124 of file integer_cln_imp.h.

◆ operator>=() [2/2]

bool CVC4::Integer::operator>= ( const Integer & y) const
inline

Definition at line 112 of file integer_gmp_imp.h.

◆ pow() [1/2]

Integer CVC4::Integer::pow ( unsigned long int exp) const
inline

Raise this Integer to the power exp.

Parameters
expthe exponent

Definition at line 322 of file integer_cln_imp.h.

◆ pow() [2/2]

Integer CVC4::Integer::pow ( unsigned long int exp) const
inline

Raise this Integer to the power exp.

Parameters
expthe exponent

Definition at line 377 of file integer_gmp_imp.h.

◆ setBit() [1/2]

Integer CVC4::Integer::setBit ( uint32_t i) const
inline

Definition at line 183 of file integer_cln_imp.h.

Referenced by CVC4::BitVector::setBit().

◆ setBit() [2/2]

Integer CVC4::Integer::setBit ( uint32_t i) const
inline

Returns the Integer obtained by setting the ith bit of the current Integer to 1.

Definition at line 179 of file integer_gmp_imp.h.

◆ sgn() [1/2]

int CVC4::Integer::sgn ( ) const
inline

Definition at line 392 of file integer_cln_imp.h.

Referenced by euclidianQR().

◆ sgn() [2/2]

int CVC4::Integer::sgn ( ) const
inline

Definition at line 348 of file integer_gmp_imp.h.

◆ strictlyNegative() [1/2]

bool CVC4::Integer::strictlyNegative ( ) const
inline

Definition at line 402 of file integer_cln_imp.h.

Referenced by euclidianQR().

◆ strictlyNegative() [2/2]

bool CVC4::Integer::strictlyNegative ( ) const
inline

Definition at line 356 of file integer_gmp_imp.h.

◆ strictlyPositive() [1/2]

bool CVC4::Integer::strictlyPositive ( ) const
inline

Definition at line 398 of file integer_cln_imp.h.

◆ strictlyPositive() [2/2]

bool CVC4::Integer::strictlyPositive ( ) const
inline

Definition at line 352 of file integer_gmp_imp.h.

◆ testBit() [1/2]

bool CVC4::Integer::testBit ( unsigned n) const
inline

Returns true iff bit n is set.

Parameters
nthe bit to test (0 == least significant bit)
Returns
true if bit n is set in this integer; false otherwise

Definition at line 460 of file integer_cln_imp.h.

◆ testBit() [2/2]

bool CVC4::Integer::testBit ( unsigned n) const
inline

Returns true iff bit n is set.

Parameters
nthe bit to test (0 == least significant bit)
Returns
true if bit n is set in this integer; false otherwise

Definition at line 458 of file integer_gmp_imp.h.

◆ toString() [1/2]

std::string CVC4::Integer::toString ( int base = 10) const
inline

◆ toString() [2/2]

std::string CVC4::Integer::toString ( int base = 10) const
inline

Definition at line 417 of file integer_gmp_imp.h.

◆ toUnsignedInt() [1/2]

uint32_t CVC4::Integer::toUnsignedInt ( ) const
inline

◆ toUnsignedInt() [2/2]

uint32_t CVC4::Integer::toUnsignedInt ( ) const
inline

Definition at line 205 of file integer_gmp_imp.h.

Friends And Related Symbol Documentation

◆ CVC4::Rational

Definition at line 512 of file integer_cln_imp.h.


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