Parma_Polyhedra_Library::GMP_Integer Class Reference
[C++ Language Interface]

Unbounded integers as provided by the GMP library. More...

#include <GMP_Integer.types.hh>

List of all members.

Related Functions

(Note that these are not member functions.)



Accessor Functions

const mpz_class & raw_value (const GMP_Integer &x)
 Returns a const reference to the underlying integer value.
mpz_class & raw_value (GMP_Integer &x)
 Returns a reference to the underlying integer value.
Arithmetic Operators

void neg_assign (GMP_Integer &x)
 Assigns to x its negation.
void neg_assign (GMP_Integer &x, const GMP_Integer &y)
 Assigns to x the negation of y.
void abs_assign (GMP_Integer &x)
 Assigns to x its absolute value.
void abs_assign (GMP_Integer &x, const GMP_Integer &y)
 Assigns to x the absolute value of y.
void rem_assign (GMP_Integer &x, const GMP_Integer &y, const GMP_Integer &z)
 Assigns to x the remainder of the division of y by z.
void gcd_assign (GMP_Integer &x, const GMP_Integer &y, const GMP_Integer &z)
 Assigns to x the greatest common divisor of y and z.
void gcdext_assign (GMP_Integer &x, GMP_Integer &s, GMP_Integer &t, const GMP_Integer &y, const GMP_Integer &z)
 Extended GCD.
void lcm_assign (GMP_Integer &x, const GMP_Integer &y, const GMP_Integer &z)
 Assigns to x the least common multiple of y and z.
void add_mul_assign (GMP_Integer &x, const GMP_Integer &y, const GMP_Integer &z)
 Assigns to x the value x + y * z.
void sub_mul_assign (GMP_Integer &x, const GMP_Integer &y, const GMP_Integer &z)
 Assigns to x the value x - y * z.
void mul_2exp_assign (GMP_Integer &x, const GMP_Integer &y, unsigned int exp)
 Assigns to x the value $ y \cdot 2^\mathtt{exp} $.
void div_2exp_assign (GMP_Integer &x, const GMP_Integer &y, unsigned int exp)
 Assigns to x the value $ y / 2^\mathtt{exp} $.
void exact_div_assign (GMP_Integer &x, const GMP_Integer &y, const GMP_Integer &z)
 If z divides y, assigns to x the quotient of the integer division of y and z.
void sqrt_assign (GMP_Integer &x, const GMP_Integer &y)
 Assigns to x the integer square root of y.
int cmp (const GMP_Integer &x, const GMP_Integer &y)
 Returns a negative, zero or positive value depending on whether x is lower than, equal to or greater than y, respectively.

Detailed Description

Unbounded integers as provided by the GMP library.

GMP_Integer is an alias for the mpz_class type defined in the C++ interface of the GMP library. For more information, see http://www.swox.com/gmp/


Friends And Related Function Documentation

void abs_assign ( GMP_Integer x,
const GMP_Integer y 
) [related]

Assigns to x the absolute value of y.

Definition at line 47 of file GMP_Integer.inlines.hh.

00047                                                  {
00048   mpz_abs(x.get_mpz_t(), y.get_mpz_t());
00049 }

void abs_assign ( GMP_Integer x  )  [related]

Assigns to x its absolute value.

Definition at line 42 of file GMP_Integer.inlines.hh.

00042                            {
00043   mpz_abs(x.get_mpz_t(), x.get_mpz_t());
00044 }

void add_mul_assign ( GMP_Integer x,
const GMP_Integer y,
const GMP_Integer z 
) [related]

Assigns to x the value x + y * z.

Definition at line 75 of file GMP_Integer.inlines.hh.

00075                                                                            {
00076   mpz_addmul(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
00077 }

int cmp ( const GMP_Integer x,
const GMP_Integer y 
) [related]

Returns a negative, zero or positive value depending on whether x is lower than, equal to or greater than y, respectively.

Definition at line 106 of file GMP_Integer.inlines.hh.

00106                                                 {
00107   return mpz_cmp(x.get_mpz_t(), y.get_mpz_t());
00108 }

void div_2exp_assign ( GMP_Integer x,
const GMP_Integer y,
unsigned int  exp 
) [related]

Assigns to x the value $ y / 2^\mathtt{exp} $.

Definition at line 90 of file GMP_Integer.inlines.hh.

00090                                                                         {
00091   mpz_tdiv_q_2exp(x.get_mpz_t(), y.get_mpz_t(), exp);
00092 }

void exact_div_assign ( GMP_Integer x,
const GMP_Integer y,
const GMP_Integer z 
) [related]

If z divides y, assigns to x the quotient of the integer division of y and z.

The behavior is undefined if z does not divide y.

Definition at line 95 of file GMP_Integer.inlines.hh.

00095                                                                              {
00096   PPL_ASSERT(y % z == 0);
00097   mpz_divexact(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
00098 }

void gcd_assign ( GMP_Integer x,
const GMP_Integer y,
const GMP_Integer z 
) [related]

Assigns to x the greatest common divisor of y and z.

Definition at line 52 of file GMP_Integer.inlines.hh.

00052                                                                        {
00053   mpz_gcd(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
00054 }

void gcdext_assign ( GMP_Integer x,
GMP_Integer s,
GMP_Integer t,
const GMP_Integer y,
const GMP_Integer z 
) [related]

Extended GCD.

Assigns to x the greatest common divisor of y and z, and to s and t the values such that y * s + z * t = x.

Definition at line 62 of file GMP_Integer.inlines.hh.

00063                                                           {
00064   mpz_gcdext(x.get_mpz_t(),
00065              s.get_mpz_t(), t.get_mpz_t(),
00066              y.get_mpz_t(), z.get_mpz_t());
00067 }

void lcm_assign ( GMP_Integer x,
const GMP_Integer y,
const GMP_Integer z 
) [related]

Assigns to x the least common multiple of y and z.

Definition at line 70 of file GMP_Integer.inlines.hh.

00070                                                                        {
00071   mpz_lcm(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
00072 }

void mul_2exp_assign ( GMP_Integer x,
const GMP_Integer y,
unsigned int  exp 
) [related]

Assigns to x the value $ y \cdot 2^\mathtt{exp} $.

Definition at line 85 of file GMP_Integer.inlines.hh.

00085                                                                         {
00086   mpz_mul_2exp(x.get_mpz_t(), y.get_mpz_t(), exp);
00087 }

void neg_assign ( GMP_Integer x,
const GMP_Integer y 
) [related]

Assigns to x the negation of y.

Definition at line 37 of file GMP_Integer.inlines.hh.

00037                                                  {
00038   mpz_neg(x.get_mpz_t(), y.get_mpz_t());
00039 }

void neg_assign ( GMP_Integer x  )  [related]

Assigns to x its negation.

Definition at line 32 of file GMP_Integer.inlines.hh.

00032                            {
00033   mpz_neg(x.get_mpz_t(), x.get_mpz_t());
00034 }

mpz_class & raw_value ( GMP_Integer x  )  [related]

Returns a reference to the underlying integer value.

Definition at line 116 of file GMP_Integer.inlines.hh.

00116                           {
00117   return x;
00118 }

const mpz_class & raw_value ( const GMP_Integer x  )  [related]

Returns a const reference to the underlying integer value.

Definition at line 111 of file GMP_Integer.inlines.hh.

00111                                 {
00112   return x;
00113 }

void rem_assign ( GMP_Integer x,
const GMP_Integer y,
const GMP_Integer z 
) [related]

Assigns to x the remainder of the division of y by z.

Definition at line 57 of file GMP_Integer.inlines.hh.

00057                                                                        {
00058   mpz_tdiv_r(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
00059 }

void sqrt_assign ( GMP_Integer x,
const GMP_Integer y 
) [related]

Assigns to x the integer square root of y.

Definition at line 101 of file GMP_Integer.inlines.hh.

00101                                                   {
00102   mpz_sqrt(x.get_mpz_t(), y.get_mpz_t());
00103 }

void sub_mul_assign ( GMP_Integer x,
const GMP_Integer y,
const GMP_Integer z 
) [related]

Assigns to x the value x - y * z.

Definition at line 80 of file GMP_Integer.inlines.hh.

00080                                                                            {
00081   mpz_submul(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
00082 }


The documentation for this class was generated from the following files:
Generated on Sun Feb 27 16:20:32 2011 for PPL by  doxygen 1.6.3