30 #if (defined(__CYGWIN__)) 43 static int Mask[8]={0x80,0x40,0x20,0x10,0x8,0x4,0x2,0x1};
50 #define pow_(x) jDeg((x),currRing) 57 PrintS(
"T==================================\n");
66 PrintS(
"Q==================================\n");
69 if (it->info->root)
pWrite(it->info->root);
72 Print(
"%d.........",it->info->prolonged);
77 PrintS(
"===================================\n");
243 if ((pX == pF) && (pF == phF))
268 pSimpleContent(p->
root,old_size);
311 if (x->
root)
return 1;
462 if (p1 ==
NULL)
return 1;
463 if (p2 ==
NULL)
return 0;
533 while ((*min) && ((*min)->info->root ==
NULL))
537 if (!(*min))
return NULL;
543 if ((*l)->info->root !=
NULL)
593 if (!y ||
pLmCmp(y->info->lead,x) < 0)
return 0;
595 while(y &&
pLmCmp(y->info->lead,x) >= 0)
611 if (!y ||
pow_(y->info->lead) <= pow_x)
return 0;
613 while(y &&
pow_(y->info->lead) > pow_x)
654 int ploc=
pow_(ll->info->lead);
655 if (ploc < p) p=ploc;
666 int ploc=
pow_((*l)->info->lead);
678 (*l)->info->changed=0;
682 if (!(*l)->info->root)
705 if (
pow_(y->info->root) == i)
PNF(y->info,
G);
740 if (
pLmCmp(iF->info->root,x) == 0)
754 if (
pow_(iT->info->lead) ==
pow_(iT->info->history))
778 y->left=y->right=
NULL;
799 go_right(current->left,disp);
800 if (current->ended) disp(current->ended);
801 go_right(current->right,disp);
807 go_right(t->root,disp);
831 if (
pow_(m2) == 0 &&
pow_(m1))
return 0;
843 div_l(item,x->left,from);
844 if ((x->ended) &&
sp_div(item,x->ended->root,from))
849 div_l(item,x->right,from);
863 NodeM *curr=tree->root;
865 if (!curr)
return NULL;
868 for ( ; i_con>=0 && !
pGetExp(item,i_con+1) ; i_con--)
871 for (i=0; i <= i_con ; i++)
877 if (curr->ended)
return curr->ended;
890 if (curr->ended)
return curr->ended;
892 if (!curr->right)
return NULL;
897 if (curr->ended)
return curr->ended;
910 if ((xx->ended) && (
GetMult(xx->ended,i)))
922 NodeM *curr=(*tree)->root;
924 for ( ; (i_con>=0) && !
pGetExp(item->
root,i_con+1) ; i_con--)
927 for (i = 0; i<= i_con; i++)
948 if (!curr->left)
SetMult(item,i);
949 if (!curr->right) curr->right=
create();
962 if (strstr(Ord,
"dp\0") || strstr(Ord,
"Dp\0"))
981 void insert_in_G(
Poly *
x)
1043 WarnS(
"Constant in basis\n");
int status int void size_t count
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
static int degree_compatible
void SetProl(Poly *x, int i)
int LengthCompare(poly p1, poly p2)
const CanonicalForm int const CFList const Variable & y
void kBucketInit(kBucket_pt bucket, poly lm, int length)
int ListGreatMoveDegree(jList *A, jList *B, poly x)
static void ClearMultiplicative(NodeM *xx, int i)
void ClearMult(Poly *x, int i)
static int min(int a, int b)
Compatiblity layer for legacy polynomial operations (over currRing)
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
void DestroyListNode(ListNode *x)
void ProlVar(Poly *temp, int i)
ListNode * CreateListNode(Poly *x)
const poly kBucketGetLm(kBucket_pt bucket)
void DestroyList(jList *x)
void insert_(TreeM **tree, Poly *item)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Poly * FindMinList(jList *L)
int ProlCompare(Poly *item1, Poly *item2)
static long p_Totaldegree(poly p, const ring r)
int ReducePolyLead(Poly *x, Poly *y)
static int(* ListGreatMove)(jList *, jList *, poly)
void p_SimpleContent(poly ph, int smax, const ring r)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
static int pLength(poly a)
void ControlProlong(Poly *x)
Poly * is_div_(TreeM *tree, poly item)
int ListGreatMoveOrder(jList *A, jList *B, poly x)
static poly p_Copy_noCheck(poly p, const ring r)
returns a copy of p (without any additional testing)
void div_l(poly item, NodeM *x, int from)
int GetMult(Poly *x, int i)
void ClearProl(Poly *x, int i)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pGetExp(p, i)
Exponent.
int ReducePoly(Poly *x, poly from, Poly *y)
int ValidatePoly(Poly *x, TreeM *)
long p_Deg(poly a, const ring r)
void kBucketDestroy(kBucket_pt *bucket_pt)
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r)
int sp_div(poly m1, poly m2, int from)
void DestroyPoly(Poly *x)
Poly * is_present(jList *F, poly x)
#define pIsConstant(p)
like above, except that Comp might be != 0
void InsertInList(jList *x, Poly *y)
void PrintS(const char *s)
void ForEachPNF(jList *x, int i)
void p_Content(poly ph, const ring r)
void(* poly_function)(Poly *)
void InsertInCount(jList *x, Poly *y)
void SetMult(Poly *x, int i)
long(* pFDegProc)(poly p, ring r)
void Initialization(char *Ord)
void InitHistory(Poly *p)
int ComputeBasis(jList *_lT, jList *_lQ)
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
int GetProl(Poly *x, int i)
Poly * is_div_upper(poly item, NodeM *x, int from)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
void ForEachControlProlong(jList *x)
void DestroyTree(NodeM *G)
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
void PNF(Poly *p, TreeM *F)
void NFL(Poly *p, TreeM *F)
#define pCopy(p)
return a copy of the poly