21 mpz_init_set( dummy,
thempi );
28 if ( *c ==
'*' && mpz_cmp_si(
thempi, 1 ) == 0 )
30 else if ( *c ==
'*' && mpz_cmp_si(
thempi, -1 ) == 0 )
33 char * str =
new char[mpz_sizeinbase(
thempi, 10 ) + 2];
34 str = mpz_get_str( str, 10,
thempi );
72 mpz_init_set( dummy,
thempi );
73 mpz_neg( dummy, dummy );
215 mpz_sub_ui( dummy,
thempi, -cc );
217 mpz_add_ui( dummy,
thempi, cc );
254 mpz_init_set_si( dummy, cc );
255 mpz_sub( dummy, dummy,
thempi );
261 mpz_add_ui( dummy,
thempi, -cc );
263 mpz_sub_ui( dummy,
thempi, cc );
279 mpz_init_set_si( dummy, cc );
310 mpz_mul_ui( dummy,
thempi, -cc );
311 mpz_neg( dummy, dummy );
314 mpz_mul_ui( dummy,
thempi, cc );
388 if ( cInt == 1 || cInt == -1 )
390 else if ( cInt == 0 )
395 if ( cInt < 0 ) cInt = -cInt;
399 cInt = mpz_gcd_ui( dummy,
thempi, cInt );
401 if ( cInt < 0 ) cInt = -cInt;
428 if ( mpz_sgn(
result ) < 0 )
431 mpz_neg( aMPI, aMPI );
432 mpz_neg( bMPI, bMPI );
478 if ( cInt == 1 || cInt == -1 )
483 else if ( cInt == 0 )
508 return mpz_get_si(
thempi );
513 return (
int)mpz_fdiv_ui(
thempi, (
unsigned long)
p );
531 ASSERT( mpz_cmp_si(
thempi, 0 ) >= 0,
"sqrt() argument < 0" );
551 ASSERT( mpz_cmp_si(
thempi, 0 ) > 0,
"log() argument <= 0" );
552 return mpz_sizeinbase(
thempi, 2 ) - 1;
#define ASSERT(expression, message)
static const int SW_RATIONAL
set to 1 for computations over Q
INST_VAR CFSwitches cf_glob_switches
bool isOn(int s) const
check if 's' is on
virtual class for internal CanonicalForm's
InternalCF * copyObject()
virtual bool isZero() const
virtual void print(OSTREAM &, char *) PVIRT_VOID("print")
virtual int levelcoeff() const
virtual bool isOne() const
bool InternalCF::isOne, isZero () const
factory's class for integers
InternalCF * deepCopyObject() const
InternalCF * sqrt()
InternalCF * InternalInteger::sqrt ()
static const omBin InternalInteger_bin
void divremcoeff(InternalCF *, InternalCF *&, InternalCF *&, bool)
InternalCF * mulsame(InternalCF *)
int ilog2()
int InternalInteger::ilog2 ()
InternalCF * bgcdcoeff(const InternalCF *const)
int sign() const
int InternalInteger::sign () const
InternalCF * addcoeff(InternalCF *)
InternalCF * subcoeff(InternalCF *, bool)
InternalCF * bgcdsame(const InternalCF *const) const
InternalCF * bextgcdsame(InternalCF *, CanonicalForm &, CanonicalForm &)
InternalCF * subsame(InternalCF *)
InternalCF * bextgcdcoeff(InternalCF *, CanonicalForm &, CanonicalForm &)
InternalCF * mulcoeff(InternalCF *)
InternalCF * neg()
InternalCF * InternalInteger::neg ()
int comparesame(InternalCF *)
int comparecoeff(InternalCF *)
static mpz_ptr MPI(const InternalCF *const c)
MPI() - return underlying mpz_t of ācā.
InternalCF * addsame(InternalCF *)
utility functions for gmp
bool mpz_is_imm(const mpz_t mpi)
operations on immediates, that is elements of F_p, GF, Z, Q that fit into intrinsic int,...
static long imm2int(const InternalCF *const imm)
static InternalCF * int2imm(long i)
Factory's internal integers.
Factory's internal rationals.
#define omGetSpecBin(size)