23#if (defined(__CYGWIN__))
43#define pow_(x) jDeg((x),currRing)
50 PrintS(
"T==================================\n");
59 PrintS(
"Q==================================\n");
62 if (it->info->root)
pWrite(it->info->root);
65 Print(
"%d.........",it->info->prolonged);
70 PrintS(
"===================================\n");
76 if (!
x->root || !
y->root)
121 if (!
x->root || !
y->root)
145 if (
p->root==
NULL)
return;
194 int pX=
pow_(
p->lead);
195 int phX=
pow_(
p->history);
199 int phF=
pow_(
f->history);
233 int pF=
pow_(
f->lead);
235 if ((pX == pF) && (pF == phF))
238 if (
p->history!=
NULL)
304 if (
x->root)
return 1;
423 return x->mult[
i/8] &
Mask[
i%8];
433 x->mult[
i/8] &= ~Mask[
i%8];
455 if (p1 ==
NULL)
return 1;
456 if (p2 ==
NULL)
return 0;
526 while ((*
min) && ((*min)->info->root ==
NULL))
536 if ((*l)->info->root !=
NULL)
559 if (
pLmCmp(
y->lead,(*ix)->info->lead) == -1)
586 if (!
y ||
pLmCmp(
y->info->lead,
x) < 0)
return 0;
604 if (!
y ||
pow_(
y->info->lead) <= pow_x)
return 0;
606 while(
y &&
pow_(
y->info->lead) > pow_x)
647 int ploc=
pow_(ll->info->lead);
648 if (ploc <
p)
p=ploc;
659 int ploc=
pow_((*l)->info->lead);
671 (*l)->info->changed=0;
675 if (!(*l)->info->root)
733 if (
pLmCmp(iF->info->root,
x) == 0)
747 if (
pow_(iT->info->lead) ==
pow_(iT->info->history))
792 go_right(current->left,disp);
793 if (current->ended) disp(current->ended);
794 go_right(current->right,disp);
800 go_right(t->root,disp);
824 if (
pow_(m2) == 0 &&
pow_(m1))
return 0;
837 if ((
x->ended) &&
sp_div(item,
x->ended->root,from))
842 div_l(item,
x->right,from);
856 NodeM *curr=tree->root;
858 if (!curr)
return NULL;
861 for ( ; i_con>=0 && !
pGetExp(item,i_con+1) ; i_con--)
864 for (
i=0;
i <= i_con ;
i++)
870 if (curr->ended)
return curr->ended;
883 if (curr->ended)
return curr->ended;
885 if (!curr->right)
return NULL;
890 if (curr->ended)
return curr->ended;
903 if ((xx->ended) && (
GetMult(xx->ended,
i)))
915 NodeM *curr=(*tree)->root;
917 for ( ; (i_con>=0) && !
pGetExp(item->
root,i_con+1) ; i_con--)
920 for (
i = 0;
i<= i_con;
i++)
942 if (!curr->right) curr->right=
create();
955 if (strstr(Ord,
"dp\0") || strstr(Ord,
"Dp\0"))
974void insert_in_G(
Poly *
x)
1036 WarnS(
"Constant in basis\n");
const CanonicalForm int const CFList const Variable & y
static int min(int a, int b)
void InitHistory(Poly *p)
ListNode * CreateListNode(Poly *x)
int ReducePolyLead(Poly *x, Poly *y)
int ComputeBasis(jList *_lT, jList *_lQ)
Poly * is_div_upper(poly item, NodeM *x, int from)
int ListGreatMoveOrder(jList *A, jList *B, poly x)
void DestroyList(jList *x)
void ForEachControlProlong(jList *x)
void DestroyTree(NodeM *G)
static void ClearMultiplicative(NodeM *xx, int i)
int sp_div(poly m1, poly m2, int from)
int ValidatePoly(Poly *x, TreeM *)
int GetProl(Poly *x, int i)
void ClearMult(Poly *x, int i)
void ControlProlong(Poly *x)
void InsertInList(jList *x, Poly *y)
void DestroyListNode(ListNode *x)
void div_l(poly item, NodeM *x, int from)
void ClearProl(Poly *x, int i)
int ReducePoly(Poly *x, poly from, Poly *y)
void InsertInCount(jList *x, Poly *y)
void ForEachPNF(jList *x, int i)
Poly * FindMinList(jList *L)
void NFL(Poly *p, TreeM *F)
void SetMult(Poly *x, int i)
STATIC_VAR NodeM * FreeNodes
STATIC_VAR int degree_compatible
void Initialization(char *Ord)
Poly * is_present(jList *F, poly x)
void SetProl(Poly *x, int i)
Poly * is_div_(TreeM *tree, poly item)
int ListGreatMoveDegree(jList *A, jList *B, poly x)
void PNF(Poly *p, TreeM *F)
void ProlVar(Poly *temp, int i)
int LengthCompare(poly p1, poly p2)
STATIC_VAR int(* ListGreatMove)(jList *, jList *, poly)
int ProlCompare(Poly *item1, Poly *item2)
int GetMult(Poly *x, int i)
void insert_(TreeM **tree, Poly *item)
void(* poly_function)(Poly *)
void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
void kBucketDestroy(kBucket_pt *bucket_pt)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
const poly kBucketGetLm(kBucket_pt bucket)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
void p_SimpleContent(poly ph, int smax, const ring r)
long p_Deg(poly a, const ring r)
void p_ContentForGB(poly ph, const ring r)
static int pLength(poly a)
static poly p_Copy_noCheck(poly p, const ring r)
returns a copy of p (without any additional testing)
static long p_Totaldegree(poly p, const ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing)
#define pIsConstant(p)
like above, except that Comp must be 0
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
#define pGetExp(p, i)
Exponent.
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
#define pCopy(p)
return a copy of the poly
void PrintS(const char *s)
long(* pFDegProc)(poly p, ring r)
int status int void size_t count