25 mpz_init_set_si(
thempi, i );
30 mpz_init_set_si(
thempi, i );
37 mpz_init_set_str(
thempi, str, base );
48 mpz_init_set( dummy,
thempi );
55 if ( *c ==
'*' && mpz_cmp_si(
thempi, 1 ) == 0 )
57 else if ( *c ==
'*' && mpz_cmp_si(
thempi, -1 ) == 0 )
60 char * str =
new char[mpz_sizeinbase(
thempi, 10 ) + 2];
61 str = mpz_get_str( str, 10,
thempi );
99 mpz_init_set( dummy,
thempi );
100 mpz_neg( dummy, dummy );
242 mpz_sub_ui( dummy,
thempi, -cc );
244 mpz_add_ui( dummy,
thempi, cc );
281 mpz_init_set_si( dummy, cc );
282 mpz_sub( dummy, dummy,
thempi );
288 mpz_add_ui( dummy,
thempi, -cc );
290 mpz_sub_ui( dummy,
thempi, cc );
306 mpz_init_set_si( dummy, cc );
337 mpz_mul_ui( dummy,
thempi, -cc );
338 mpz_neg( dummy, dummy );
341 mpz_mul_ui( dummy,
thempi, cc );
387 mpz_abs( result, result );
415 if ( cInt == 1 || cInt == -1 )
417 else if ( cInt == 0 )
422 if ( cInt < 0 ) cInt = -cInt;
426 cInt = mpz_gcd_ui( dummy,
thempi, cInt );
428 if ( cInt < 0 ) cInt = -cInt;
452 mpz_gcdext( result, aMPI, bMPI,
thempi,
MPI( c ) );
455 if ( mpz_sgn( result ) < 0 )
457 mpz_neg( result, result );
458 mpz_neg( aMPI, aMPI );
459 mpz_neg( bMPI, bMPI );
505 if ( cInt == 1 || cInt == -1 )
510 else if ( cInt == 0 )
535 return mpz_get_si(
thempi );
540 return (
int)mpz_fdiv_ui(
thempi, (
unsigned long)p );
558 ASSERT( mpz_cmp_si(
thempi, 0 ) >= 0,
"sqrt() argument < 0" );
561 mpz_sqrt( result,
thempi );
578 ASSERT( mpz_cmp_si(
thempi, 0 ) > 0,
"log() argument <= 0" );
579 return mpz_sizeinbase(
thempi, 2 ) - 1;
Factory's internal rationals.
int comparecoeff(InternalCF *)
InternalCF * bgcdcoeff(const InternalCF *const )
InternalCF * neg()
InternalCF * InternalInteger::neg ()
InternalCF * int2imm(long i)
InternalCF * copyObject()
InternalCF * bgcdsame(const InternalCF *const ) const
InternalCF * bextgcdsame(InternalCF *, CanonicalForm &, CanonicalForm &)
void print(OSTREAM &, char *)
int sign() const
int InternalInteger::sign () const
int comparesame(InternalCF *)
virtual class for internal CanonicalForm's
InternalCF * bextgcdcoeff(InternalCF *, CanonicalForm &, CanonicalForm &)
virtual bool isZero() const
InternalCF * deepCopyObject() const
virtual bool isOne() const
bool InternalCF::isOne, isZero () const
virtual int levelcoeff() const
InternalCF * subsame(InternalCF *)
static const int SW_RATIONAL
set to 1 for computations over Q
InternalCF * addcoeff(InternalCF *)
InternalCF * subcoeff(InternalCF *, bool)
static mpz_ptr MPI(const InternalCF *const c)
MPI() - return underlying mpz_t of `c'.
InternalCF * sqrt()
InternalCF * InternalInteger::sqrt ()
InternalCF * mulsame(InternalCF *)
#define omGetSpecBin(size)
long imm2int(const InternalCF *const imm)
utility functions for gmp
void divremcoeff(InternalCF *, InternalCF *&, InternalCF *&, bool)
operations on immediates, that is elements of F_p, GF, Z, Q that fit into intrinsic int...
InternalCF * addsame(InternalCF *)
#define cf_glob_switches
CFSwitches cf_glob_switches;.
#define ASSERT(expression, message)
InternalCF * mulcoeff(InternalCF *)
int ilog2()
int InternalInteger::ilog2 ()
bool mpz_is_imm(const mpz_t mpi)
factory's class for integers
static const omBin InternalInteger_bin
Factory's internal integers.