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

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

Returns a const reference to the underlying integer value.

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

00098                                 {
00099   return x;
00100 }

mpz_class & raw_value ( GMP_Integer x  )  [related]

Returns a reference to the underlying integer value.

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

00103                           {
00104   return x;
00105 }

void neg_assign ( GMP_Integer x  )  [related]

Assigns to x its negation.

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

00029                            {
00030   mpz_neg(x.get_mpz_t(), x.get_mpz_t());
00031 }

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

Assigns to x the negation of y.

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

00034                                                  {
00035   mpz_neg(x.get_mpz_t(), y.get_mpz_t());
00036 }

void abs_assign ( GMP_Integer x  )  [related]

Assigns to x its absolute value.

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

00039                            {
00040   mpz_abs(x.get_mpz_t(), x.get_mpz_t());
00041 }

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

Assigns to x the absolute value of y.

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

00044                                                  {
00045   mpz_abs(x.get_mpz_t(), y.get_mpz_t());
00046 }

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 54 of file GMP_Integer.inlines.hh.

00054                                                                        {
00055   mpz_tdiv_r(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
00056 }

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 49 of file GMP_Integer.inlines.hh.

00049                                                                        {
00050   mpz_gcd(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
00051 }

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 59 of file GMP_Integer.inlines.hh.

00060                                                           {
00061   mpz_gcdext(x.get_mpz_t(),
00062              s.get_mpz_t(), t.get_mpz_t(),
00063              y.get_mpz_t(), z.get_mpz_t());
00064 }

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 67 of file GMP_Integer.inlines.hh.

00067                                                                        {
00068   mpz_lcm(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
00069 }

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 72 of file GMP_Integer.inlines.hh.

00072                                                                            {
00073   mpz_addmul(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
00074 }

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 77 of file GMP_Integer.inlines.hh.

00077                                                                            {
00078   mpz_submul(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
00079 }

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 82 of file GMP_Integer.inlines.hh.

00082                                                                              {
00083   assert(y % z == 0);
00084   mpz_divexact(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
00085 }

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

Assigns to x the integer square root of y.

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

00088                                                   {
00089   mpz_sqrt(x.get_mpz_t(), y.get_mpz_t());
00090 }

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 93 of file GMP_Integer.inlines.hh.

00093                                                 {
00094   return mpz_cmp(x.get_mpz_t(), y.get_mpz_t());
00095 }


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

Generated on Sat Oct 11 10:41:18 2008 for PPL by  doxygen 1.5.6