 |
My Project
debian-1:4.1.1-p2+ds-4
|
factory's class for integers
More...
#include <int_int.h>
|
void * | operator new (size_t) |
|
void | operator delete (void *addr, size_t) |
|
| InternalInteger () |
|
| InternalInteger (const InternalCF &) |
|
| InternalInteger (const int i) |
|
| InternalInteger (const long i) |
|
| InternalInteger (const char *str, const int base=10) |
|
| InternalInteger (const mpz_ptr mpi) |
|
| ~InternalInteger () |
|
InternalCF * | deepCopyObject () const |
|
const char * | classname () const |
|
void | print (OSTREAM &, char *) |
|
InternalCF * | genZero () |
|
InternalCF * | genOne () |
|
bool | is_imm () const |
|
int | levelcoeff () const |
|
InternalCF * | neg () |
| InternalCF * InternalInteger::neg () More...
|
|
int | comparesame (InternalCF *) |
|
InternalCF * | addsame (InternalCF *) |
|
InternalCF * | subsame (InternalCF *) |
|
InternalCF * | mulsame (InternalCF *) |
|
InternalCF * | dividesame (InternalCF *) |
|
InternalCF * | modulosame (InternalCF *) |
|
InternalCF * | divsame (InternalCF *) |
|
InternalCF * | modsame (InternalCF *) |
|
void | divremsame (InternalCF *, InternalCF *&, InternalCF *&) |
|
bool | divremsamet (InternalCF *, InternalCF *&, InternalCF *&) |
|
int | comparecoeff (InternalCF *) |
|
InternalCF * | addcoeff (InternalCF *) |
|
InternalCF * | subcoeff (InternalCF *, bool) |
|
InternalCF * | mulcoeff (InternalCF *) |
|
InternalCF * | dividecoeff (InternalCF *, bool) |
|
InternalCF * | modulocoeff (InternalCF *, bool) |
|
InternalCF * | divcoeff (InternalCF *, bool) |
|
InternalCF * | modcoeff (InternalCF *, bool) |
|
void | divremcoeff (InternalCF *, InternalCF *&, InternalCF *&, bool) |
|
bool | divremcoefft (InternalCF *, InternalCF *&, InternalCF *&, bool) |
|
InternalCF * | bgcdsame (const InternalCF *const) const |
|
InternalCF * | bgcdcoeff (const InternalCF *const) |
|
InternalCF * | bextgcdsame (InternalCF *, CanonicalForm &, CanonicalForm &) |
|
InternalCF * | bextgcdcoeff (InternalCF *, CanonicalForm &, CanonicalForm &) |
|
long | intval () const |
|
int | intmod (int p) const |
|
int | sign () const |
| int InternalInteger::sign () const More...
|
|
InternalCF * | sqrt () |
| InternalCF * InternalInteger::sqrt () More...
|
|
int | ilog2 () |
| int InternalInteger::ilog2 () More...
|
|
| InternalCF () |
|
| InternalCF (const InternalCF &) |
|
virtual | ~InternalCF () |
|
int | deleteObject () |
|
InternalCF * | copyObject () |
|
virtual int | level () const |
|
virtual int | type () const |
|
virtual Variable | variable () const |
|
virtual bool | inBaseDomain () const |
|
virtual bool | inExtension () const |
|
virtual bool | inCoeffDomain () const |
|
virtual bool | inPolyDomain () const |
|
virtual bool | inQuotDomain () const |
|
virtual bool | isZero () const |
|
virtual bool | isOne () const |
| bool InternalCF::isOne, isZero () const More...
|
|
virtual bool | isUnivariate () const |
|
virtual InternalCF * | num () |
| InternalCF * InternalCF::num (), den () More...
|
|
virtual InternalCF * | den () |
|
virtual InternalCF * | invert () |
|
virtual InternalCF * | tryInvert (const CanonicalForm &, bool &) |
|
virtual InternalCF * | tryMulsame (InternalCF *, const CanonicalForm &) |
|
virtual InternalCF * | tryDivsame (InternalCF *, const CanonicalForm &, bool &) |
|
virtual bool | tryDivremsamet (InternalCF *, InternalCF *&, InternalCF *&, const CanonicalForm &, bool &) |
|
virtual InternalCF * | tryDividecoeff (InternalCF *, bool, const CanonicalForm &, bool &) |
|
virtual InternalCF * | tryDivcoeff (InternalCF *, bool, const CanonicalForm &, bool &) |
|
virtual bool | tryDivremcoefft (InternalCF *, InternalCF *&, InternalCF *&, bool, const CanonicalForm &, bool &) |
|
virtual CanonicalForm | lc () |
| CanonicalForm InternalCF::lc (), Lc (), LC () More...
|
|
virtual CanonicalForm | Lc () |
|
virtual CanonicalForm | LC () |
|
virtual CanonicalForm | coeff (int i) |
| CanonicalForm InternalCF::coeff ( int i ) More...
|
|
virtual int | degree () |
| int InternalCF::degree () More...
|
|
virtual int | taildegree () |
|
virtual CanonicalForm | tailcoeff () |
| CanonicalForm InternalCF::tailcoeff (), int InternalCF::taildegree () More...
|
|
void * | operator new (size_t size) throw (std::bad_alloc) |
|
void | operator delete (void *block) throw () |
|
void * | operator new[] (size_t size) throw (std::bad_alloc) |
|
void | operator delete[] (void *block) throw () |
|
void * | operator new (size_t size, const std::nothrow_t &) throw () |
|
void * | operator new[] (size_t size, const std::nothrow_t &) throw () |
|
factory's class for integers
an integer is represented as an mpz_t thempi
- See also
- InternalRational
Definition at line 40 of file int_int.h.
◆ InternalInteger() [1/6]
InternalInteger::InternalInteger |
( |
| ) |
|
|
inline |
◆ InternalInteger() [2/6]
Definition at line 71 of file int_int.h.
73 ASSERT( 0,
"ups there is something wrong in your code" );
◆ InternalInteger() [3/6]
InternalInteger::InternalInteger |
( |
const int |
i | ) |
|
|
inline |
◆ InternalInteger() [4/6]
InternalInteger::InternalInteger |
( |
const long |
i | ) |
|
|
inline |
◆ InternalInteger() [5/6]
InternalInteger::InternalInteger |
( |
const char * |
str, |
|
|
const int |
base = 10 |
|
) |
| |
|
inline |
◆ InternalInteger() [6/6]
InternalInteger::InternalInteger |
( |
const mpz_ptr |
mpi | ) |
|
|
inline |
◆ ~InternalInteger()
InternalInteger::~InternalInteger |
( |
| ) |
|
|
inline |
◆ addcoeff()
◆ addsame()
◆ bextgcdcoeff()
◆ bextgcdsame()
◆ bgcdcoeff()
◆ bgcdsame()
◆ classname()
const char* InternalInteger::classname |
( |
| ) |
const |
|
inlinevirtual |
◆ comparecoeff()
int InternalInteger::comparecoeff |
( |
InternalCF * |
c | ) |
|
|
virtual |
◆ comparesame()
int InternalInteger::comparesame |
( |
InternalCF * |
c | ) |
|
|
virtual |
◆ deepCopyObject()
InternalCF * InternalInteger::deepCopyObject |
( |
| ) |
const |
|
virtual |
◆ divcoeff()
◆ dividecoeff()
- See also
- CanonicalForm::operator /(), InternalInteger::dividesame()
Reimplemented from InternalCF.
Definition at line 69 of file int_intdiv.cc.
72 "type error: immediate integer expected" );
74 "math error: divide by zero" );
81 mpz_init_set_si( n, intC );
85 mpz_init_set_si( d, intC );
89 return result->normalize_myself();
93 int mpiSign = mpz_sgn(
thempi );
102 mpz_init( mpiResult );
104 mpz_fdiv_q_ui( mpiResult,
thempi, intC );
106 mpz_fdiv_q_ui( mpiResult,
thempi, -intC );
107 mpz_neg( mpiResult, mpiResult );
◆ dividesame()
- See also
- CanonicalForm::operator /(), InternalInteger::dividecoeff()
Reimplemented from InternalCF.
Definition at line 28 of file int_intdiv.cc.
31 "type error: InternalInteger expected" );
41 mpz_init_set( d,
MPI( c ) );
44 return result->normalize_myself();
50 mpz_init( mpiResult );
51 if ( mpz_sgn(
MPI( c ) ) > 0 )
52 mpz_fdiv_q( mpiResult,
thempi,
MPI( c ) );
54 mpz_cdiv_q( mpiResult,
thempi,
MPI( c ) );
57 if ( mpz_sgn(
MPI( c ) ) > 0 )
◆ divremcoeff()
- See also
- CanonicalForm::divrem(), InternalInteger::divremsame()
Reimplemented from InternalCF.
Definition at line 308 of file int_intdiv.cc.
311 "type error: immediate integer expected" );
313 "math error: divide by zero" );
320 mpz_init_set_si( n, intC );
321 mpz_init_set( d,
thempi );
323 mpz_init_set( n,
thempi );
324 mpz_init_set_si( d, intC );
327 quot =
result->normalize_myself();
338 mpz_init_set( mpiResult,
thempi );
339 mpz_abs( mpiResult, mpiResult );
340 mpz_sub_ui( mpiResult, mpiResult, -intC );
347 mpz_init( q ); mpz_init( dummy );
◆ divremcoefft()
◆ divremsame()
◆ divremsamet()
◆ divsame()
◆ genOne()
◆ genZero()
◆ ilog2()
int InternalInteger::ilog2 |
( |
| ) |
|
|
virtual |
◆ intmod()
int InternalInteger::intmod |
( |
int |
p | ) |
const |
|
virtual |
◆ intval()
long InternalInteger::intval |
( |
| ) |
const |
|
virtual |
◆ is_imm()
bool InternalInteger::is_imm |
( |
| ) |
const |
◆ levelcoeff()
int InternalInteger::levelcoeff |
( |
| ) |
const |
|
inlinevirtual |
◆ modcoeff()
◆ modsame()
◆ modulocoeff()
- See also
- CanonicalForm::operator %(), InternalInteger::modulosame()
Reimplemented from InternalCF.
Definition at line 212 of file int_intdiv.cc.
215 "type error: immediate integer expected" );
217 "math error: divide by zero" );
233 mpz_init_set( mpiResult,
thempi );
234 mpz_abs( mpiResult, mpiResult );
235 mpz_sub_ui( mpiResult, mpiResult, -intC );
◆ modulosame()
◆ MPI()
MPI() - return underlying mpz_t of ‘c’.
‘c’ is expected to be an ‘InternalInteger *’. `c's underlying mpz_t is returned.
Definition at line 232 of file int_int.h.
◆ mulcoeff()
Reimplemented from InternalCF.
Definition at line 299 of file int_int.cc.
310 mpz_mul_ui( dummy,
thempi, -cc );
311 mpz_neg( dummy, dummy );
314 mpz_mul_ui( dummy,
thempi, cc );
◆ mulsame()
◆ neg()
◆ normalizeMPI()
InternalCF * InternalInteger::normalizeMPI |
( |
mpz_ptr |
aMpi | ) |
|
|
inlinestaticprivate |
◆ normalizeMyself()
normalizeMyself(), uiNormalizeMyself() - normalize CO.
If CO fits into an immediate integer, delete CO and return the immediate. Otherwise, return a pointer to CO.
Note: We do not mind reference counting at this point! CO is deleted unconditionally!
Definition at line 152 of file int_int.h.
◆ operator delete()
void InternalInteger::operator delete |
( |
void * |
addr, |
|
|
size_t |
|
|
) |
| |
|
inline |
◆ operator new()
void* InternalInteger::operator new |
( |
size_t |
| ) |
|
|
inline |
◆ print()
void InternalInteger::print |
( |
OSTREAM & |
os, |
|
|
char * |
c |
|
) |
| |
|
virtual |
Reimplemented from InternalCF.
Definition at line 26 of file int_int.cc.
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 );
◆ sign()
int InternalInteger::sign |
( |
| ) |
const |
|
virtual |
◆ sqrt()
◆ subcoeff()
Reimplemented from InternalCF.
Definition at line 244 of file int_int.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 );
◆ subsame()
◆ uiNormalizeMPI()
InternalCF * InternalInteger::uiNormalizeMPI |
( |
mpz_ptr |
aMpi | ) |
|
|
inlinestaticprivate |
‘uiNormalizeMPI()’ is the same as ‘normalizeMPI()’ except that ‘aMpi’ is expected to be non-begative.
In this case, we may use ‘mpz_get_ui()’ to convert ‘aMpi’ into an immediate which is slightly faster than the signed variant.
Definition at line 213 of file int_int.h.
◆ uiNormalizeMyself()
InternalCF * InternalInteger::uiNormalizeMyself |
( |
| ) |
|
|
inlineprivate |
‘uiNormalizeMyself()’ is the same as ‘normalizeMyself()’ except that CO is expected to be non-negative.
In this case, we may use ‘mpz_get_ui()’ to convert the underlying mpi into an immediate which is slightly faster than the signed variant.
Note: We do not mind reference counting at this point! CO is deleted unconditionally!
Definition at line 174 of file int_int.h.
◆ getmpi
◆ gmp_denominator
◆ gmp_numerator
◆ InternalRational
◆ InternalInteger_bin
◆ thempi
mpz_t InternalInteger::thempi |
|
private |
The documentation for this class was generated from the following files:
static const int SW_RATIONAL
set to 1 for computations over Q
virtual InternalCF * invert()
InternalCF * modulocoeff(InternalCF *, bool)
static InternalCF * normalizeMPI(mpz_ptr)
normalizeMPI(), uiNormalizeMPI() - normalize a mpi.
virtual bool isZero() const
InternalCF * normalizeMyself()
normalizeMyself(), uiNormalizeMyself() - normalize CO.
virtual class for internal CanonicalForm's
static const omBin InternalInteger_bin
virtual bool isOne() const
bool InternalCF::isOne, isZero () const
static mpz_ptr MPQNUM(const InternalCF *const c)
InternalCF * copyObject()
friend class InternalRational
virtual int levelcoeff() const
#define ASSERT(expression, message)
static InternalCF * int2imm(long i)
InternalCF * uiNormalizeMyself()
‘uiNormalizeMyself()’ is the same as ‘normalizeMyself()’ except that CO is expected to be non-negativ...
#define omTypeAllocBin(type, addr, bin)
static InternalCF * uiNormalizeMPI(mpz_ptr)
‘uiNormalizeMPI()’ is the same as ‘normalizeMPI()’ except that ‘aMpi’ is expected to be non-begative.
void divremsame(InternalCF *, InternalCF *&, InternalCF *&)
factory's class for rationals
static mpz_ptr MPI(const InternalCF *const c)
MPI() - return underlying mpz_t of ‘c’.
static long imm2int(const InternalCF *const imm)
void divremcoeff(InternalCF *, InternalCF *&, InternalCF *&, bool)
CFSwitches cf_glob_switches
CFSwitches cf_glob_switches;.
#define omFreeBin(addr, bin)
bool mpz_is_imm(const mpz_t mpi)
InternalCF * modulosame(InternalCF *)
static mpz_ptr MPQDEN(const InternalCF *const c)
void rem(unsigned long *a, unsigned long *q, unsigned long p, int °a, int degq)
factory's class for integers
bool isOn(int s) const
check if 's' is on