38 for (j=0; j<=o->
tl; j++)
75 for (j=0; j<=o->
Ll; j++)
87 if (o->
L[j].lcm!=
NULL)
112 l[
j].i_r1=n->
T[
i].i_r;
134 l[
j].i_r2=n->
T[
i].i_r;
140 l[
j].ecart=o->
L[
j].ecart;
142 l[
j].length=o->
L[
j].length;
144 l[
j].pLength=o->
L[
j].pLength;
146 l[
j].sev=o->
L[
j].sev;
147 l[
j].i_r = o->
L[
j].i_r;
252 fac_copy=
idInit(fac_elems,1);
258 Print(
"%d factors:\n",fac_elems);
261 while(ii>0) { ii--;
pWrite(fac->m[ii]); }
268 while(ii>0) {
PrintS(
"F"); ii--; }
295 for (si=strat->
sl; si>0; si--)
309 for(i=strat->
tl;i>=0;i--)
345 if (n->
sl==-1) pos=0;
384 Print(
"new s(%d)->D:\n",n->
nr);
390 fac_copy->m[
i]=
pCopy(fac->m[i]);
399 if (n->
D->m[j]!=
NULL)
406 Print(
"empty set s(%d) because D[%d]:",n->
nr,j);
416 if (n->
S[i]==n->
T[n->
tl].p)
444 if ((n->
sl>=0)&&(n->
S[0]!=
NULL))
451 Print(
"empty set because:L[%p]\n",(
void *)Lj);
460 if (n->
S[i]==n->
T[n->
tl].p)
485 if ((strat->
Ll>=0) && (strat->
sl>=0))
break;
496 if ((strat->
Ll==-1) && (strat->
sl>=0))
501 while (strat->
Ll >= 0)
519 strat->
P = strat->
L[strat->
Ll];
542 red_result = strat->
red(&strat->
P,strat);
543 if (strat->
P.p !=
NULL)
569 fac->m[0]=strat->
P.p;
604 if (n->
sl==-1) pos=0;
642 for(ii=0; ii<=n->
tl; ii++)
644 if (n->
R[ii]->p==n->
L[i].p1) { n->
L[
i].i_r1=ii;
break; }
647 for(ii=0; ii<=n->
tl; ii++)
649 if (n->
R[ii]->p==n->
L[i].p2) { n->
L[
i].i_r2=ii;
break; }
677 fac_copy->m[
i]=
pCopy(fac->m[i]);
686 if (n->
D->m[j]!=
NULL)
693 Print(
"empty set s(%d) because: D[%d]:", n->
nr,j);
705 if (n->
S[i]==n->
T[n->
tl].p)
733 if ((n->
sl>=0)&&(n->
S[0]!=
NULL))
741 Print(
"empty set s(%d) because:L[%d]\n",n->
nr,Lj->nr);
743 Print(
"empty set s(%d) because:\n",n->
nr);
753 if (n->
S[i]==n->
T[n->
tl].p)
782 if ((strat->
Ll==-1) && (strat->
sl>=0))
805 return (strat->
Shdl);
860 PrintS(
"====================================\n");
883 ideal_list LL=(ideal_list)
omAlloc(
sizeof(*LL));
896 ideal_list Lj=L->
next;
897 ideal_list Lj_prev=L;
909 Print(
"empty set L[%p] because:L[%p]\n",(
void*)Lj,(
void*)Li);
917 if (Lj==L) Lj_prev=
NULL;
921 while(Lj_prev->next!=Lj) Lj_prev=Lj_prev->next;
932 if (Lj!=
NULL) Lj=Lj->next;
946 orgstrat=strat->
next;
950 if ((delete_w)&&(w!=
NULL)&&(*w!=
NULL))
delete *w;
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
const CanonicalForm int s
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
#define TEST_OPT_DEGBOUND
void initBuchMoraPos(kStrategy strat)
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
#define idDelete(H)
delete an ideal
ideal_list kStdfac(ideal F, ideal Q, tHomog h, intvec **w, ideal D)
void messageStat(int hilbcount, kStrategy strat)
Compatiblity layer for legacy polynomial operations (over currRing)
void initBuchMora(ideal F, ideal Q, kStrategy strat)
#define omFreeSize(addr, size)
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
void deleteInS(int i, kStrategy strat)
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
void initBba(kStrategy strat)
int(* red)(LObject *L, kStrategy strat)
KINLINE poly redtailBba(poly p, int pos, kStrategy strat, BOOLEAN normalize)
int(* posInT)(const TSet T, const int tl, LObject &h)
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
static BOOLEAN rField_has_simple_inverse(const ring r)
void enterT(LObject &p, kStrategy strat, int atT)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
void(* initEcart)(TObject *L)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
void(* enterOnePair)(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
#define TEST_OPT_INTSTRATEGY
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
kStrategy kStratCopy(kStrategy o)
static void copyL(kStrategy o, kStrategy n)
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
void initBuchMoraCrit(kStrategy strat)
void PrintS(const char *s)
int(* posInLOld)(const LSet Ls, const int Ll, LObject *Lo, const kStrategy strat)
static unsigned pLength(poly a)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void(* chainCrit)(poly p, int ecart, kStrategy strat)
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
static void completeReduceFac(kStrategy strat, ideal_list FL)
void pNorm(poly p, const ring R=currRing)
#define pInit()
allocates a new monomial and initializes everything to 0
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
long kModDeg(poly p, ring r)
void updateResult(ideal r, ideal Q, kStrategy strat)
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
BOOLEAN k_factorize(poly p, ideal &rfac, ideal &fac_copy)
ideal singclap_factorize(poly f, intvec **v, int with_exps, const ring r)
ideal idAdd(ideal h1, ideal h2)
h1 + h2
static LSet initL(int nr=setmaxL)
ideal bbafac(ideal, ideal Q, intvec *, kStrategy strat, ideal_list FL)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
poly p_Cleardenom(poly p, const ring r)
void exitBuchMora(kStrategy strat)
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
static void copyT(kStrategy o, kStrategy n)
#define pCopy(p)
return a copy of the poly