56 WarnS(
"minbase applies only to the local or homogeneous case over coefficient fields");
65 WarnS(
"minbase applies only to the local or homogeneous case over coefficient fields");
89 while ((k > 0) && (h3->m[k-1] ==
NULL)) k--;
92 while ((l > 0) && (h2->m[l-1] ==
NULL)) l--;
93 for (i=l-1; i>=0; i--)
98 while ((ll < k) && ((h3->m[ll] ==
NULL)
109 e->m[
j] =
pCopy(h2->m[i]);
150 for (j=0;j<r->N-1;j++) names[j]=r->names[j];
175 for (l=
IDELEMS(h1)-1; l>=0; l--)
177 h->m[
l] = h1->m[
l]; h1->m[
l]=
NULL;
180 for (l=
IDELEMS(h2)-1; l>=0; l--)
182 h->m[l+
j] = h2->m[
l]; h2->m[
l]=
NULL;
205 int rank=
si_max(h1->rank,h2->rank);
208 ideal first,second,temp,temp1,
result;
220 int t=flength; flength=slength; slength=t;
222 length =
si_max(flength,slength);
240 while ((j>0) && (first->m[j-1]==
NULL)) j--;
245 if (first->m[i]!=
NULL)
247 if (syz_ring==orig_ring)
248 temp->m[
k] =
pCopy(first->m[i]);
250 temp->m[
k] =
prCopyR(first->m[i], orig_ring, syz_ring);
261 for (i=0;i<
IDELEMS(second);i++)
263 if (second->m[i]!=
NULL)
265 if (syz_ring==orig_ring)
266 temp->m[
k] =
pCopy(second->m[i]);
279 if (w!=
NULL)
delete w;
295 Werror(
"error %d in >>groebner<<",err);
303 void *args[]={temp,(
void*)1,
NULL};
308 Werror(
"error %d in >>modStd<<",err);
327 if (block==1) { block=
i;
break;}
339 for(i=
currRing->block0[block];i<=currRing->block1[block];i++)
345 void *args[]={temp,
v,
NULL};
351 Werror(
"error %d in >>satstd<<",err);
356 if(syz_ring!=orig_ring)
363 if ((temp1->m[i]!=
NULL)
366 if(syz_ring==orig_ring)
372 p =
prMoveR(temp1->m[i], syz_ring,orig_ring);
389 if(syz_ring!=orig_ring)
406 if (w!=
NULL)
delete w;
421 int i,
j=0,
k=0,
l,maxrk=-1,realrki;
423 ideal bigmat,tempstd,
result;
436 if (realrki>maxrk) maxrk = realrki;
442 return idInit(1,arg[i]->rank);
460 bigmat =
idInit(j,(
k+1)*maxrk);
462 for (i=0;i<maxrk;i++)
469 bigmat->m[
i] =
pAdd(bigmat->m[i],p);
483 if (syz_ring==orig_ring)
500 if (w!=
NULL)
delete w;
516 Werror(
"error %d in >>groebner<<",err);
540 Werror(
"wrong algorithm %d for SB",(
int)alg);
543 if(syz_ring!=orig_ring)
549 for (j=0;j<
IDELEMS(tempstd);j++)
551 if ((tempstd->m[j]!=
NULL) && (
__p_GetComp(tempstd->m[j],syz_ring)>syzComp))
553 if (syz_ring==orig_ring)
554 p =
pCopy(tempstd->m[j]);
563 if(syz_ring!=orig_ring)
566 if(syz_ring!=orig_ring)
597 Warn(
"syzcomp too low, should be %d instead of %d",k,syzcomp);
601 h2->rank = syzcomp+
i;
647 Werror(
"error %d in >>groebner<<",err);
660 Werror(
"error %d in >>modStd<<",err);
679 if (block==1) { block=
i;
break;}
691 for(i=
currRing->block0[block];i<=currRing->block1[block];i++)
703 Werror(
"error %d in >>satstd<<",err);
715 Werror(
"wrong algorithm %d for SB",(
int)alg);
734 int ii, idElemens_h1;
740 for(ii=0;ii<idElemens_h1 ;ii++)
pTest(h1->m[ii]);
755 if (orig_ring != syz_ring)
771 if (orig_ring != syz_ring)
779 if (orig_ring != syz_ring)
782 for (j=0; j<
IDELEMS(s_h3); j++)
784 if (s_h3->m[j] !=
NULL)
787 p_Shift(&s_h3->m[j], -k,syz_ring);
810 for (j=
IDELEMS(s_h3)-1; j>=0; j--)
812 if (s_h3->m[j] !=
NULL)
816 e->m[
j] = s_h3->m[
j];
817 isMonomial=isMonomial && (
pNext(s_h3->m[j])==
NULL);
836 assume(orig_ring==syz_ring);
838 if (dp_C_ring != syz_ring)
853 if (dp_C_ring != orig_ring)
887 if (orig_ring != syz_ring)
903 if (orig_ring != syz_ring)
940 return idInit(1,h1->rank);
957 if (orig_ring != syz_ring)
968 if (w!=
NULL)
delete w;
974 for (j=0; j<
IDELEMS(s_h3); j++)
976 if (s_h3->m[j] !=
NULL)
1003 (*syz)->m[
j]=s_h3->m[
j];
1025 if (syz_ring!=orig_ring)
1034 for (j=0; j<
IDELEMS(s_h2); j++)
1036 if (s_h2->m[j] !=
NULL)
1038 q =
prMoveR( s_h2->m[j], syz_ring,orig_ring);
1060 for (i=0; i<
IDELEMS(s_h3); i++)
1066 for (i=0; i<
IDELEMS(*syz); i++)
1072 if (syz_ring!=orig_ring)
rDelete(syz_ring);
1084 for (j=0; j<
IDELEMS(s_temp); j++)
1090 for (j=0; j<
IDELEMS(s_temp); j++)
1092 if (s_temp->m[j]!=
NULL)
1103 s_temp->rank = k+
IDELEMS(s_temp);
1127 *rest=
idInit(1,mod->rank);
1129 return idInit(1,mod->rank);
1133 WerrorS(
"2nd module does not lie in the first");
1138 comps_to_add =
IDELEMS(submod);
1139 while ((comps_to_add>0) && (submod->m[comps_to_add-1]==
NULL))
1143 if ((k!=0) && (lsmod==0)) lsmod=1;
1144 k=
si_max(k,(
int)mod->rank);
1145 if (k<submod->rank) {
WarnS(
"rk(submod) > rk(mod) ?");k=submod->rank; }
1152 ideal s_mod, s_temp;
1153 if (orig_ring != syz_ring)
1188 for(
j = 0;
j<comps_to_add;
j++)
1201 s_temp->rank += (k+comps_to_add);
1203 ideal s_result =
kNF(s_h3,
currRing->qideal,s_temp,k);
1204 s_result->rank = s_h3->rank;
1211 if (s_result->m[
j]!=
NULL)
1219 WarnS(
"first module not a standardbasis\n" 1220 "// ** or second not a proper submodule");
1223 WerrorS(
"2nd module does not lie in the first");
1231 p = s_rest->m[
j] = s_result->m[
j];
1233 s_result->m[
j] =
pNext(p);
1238 pNeg(s_result->m[
j]);
1241 if ((lsmod==0) && (s_rest!=
NULL))
1245 if (s_rest->m[
j-1]!=
NULL)
1248 s_rest->m[
j-1] = s_rest->m[
j-1];
1252 if(syz_ring!=orig_ring)
1267 *unit=
mpNew(comps_to_add,comps_to_add);
1269 for(i=0;i<
IDELEMS(s_result);i++)
1271 poly p=s_result->m[
i];
1284 pIter(s_result->m[i]);
1289 else p=s_result->m[
i];
1357 R->m[
i]=
pAdd(R->m[i],p0);
1379 int i,
l,ll,
k,kkk,kmax;
1387 if ((k2==0) && (k>1)) *addOnlyOne =
FALSE;
1394 if (weights!=
NULL)
delete weights;
1399 if (h2->m[i] !=
NULL)
1401 p =
pCopy(h2->m[i]);
1410 *kkmax = kmax = j*k+1;
1419 ideal h4 =
idInit(k,kmax+k-1);
1425 if (h4->m[i-1]!=
NULL)
1439 if(temph1->m[l]!=
NULL)
1441 for (ll=0; ll<
j; ll++)
1443 p =
pCopy(temph1->m[l]);
1465 h4->m[
i] = h4->m[i+1];
1505 if (orig_ring!=syz_ring)
1507 s_h4 =
idrMoveR(s_h4,orig_ring, syz_ring);
1533 m=idModule2Matrix(
idCopy(s_h3));
1534 Print(
"result, kmax=%d:\n",kmax);
1539 if (weights1!=
NULL)
delete weights1;
1544 if ((s_h3->m[i]!=
NULL) && (
pGetComp(s_h3->m[i])>=kmax))
1557 s_h3->rank = h1->rank;
1558 if(syz_ring!=orig_ring)
1577 int *block0,*block1;
1591 WerrorS(
"cannot eliminate in a qring");
1604 WerrorS(
"no elimination is possible: subalgebra is not admissible");
1614 if (origR->order[
k]!=0) ordersize++;
1621 for (
k=0;
k<ordersize-1;
k++)
1623 block0[
k+1] = origR->block0[
k];
1624 block1[
k+1] = origR->block1[
k];
1625 ord[
k+1] = origR->order[
k];
1626 if (origR->wvhdl[
k]!=
NULL) wv[
k+1] = (
int*)
omMemDup(origR->wvhdl[
k]);
1636 double wNsqr = (double)2.0 / (
double)(
currRing->N);
1640 wCall(h1->m, sl, x, wNsqr);
1641 for (sl = (
currRing->N); sl!=0; sl--)
1642 wv[1][sl-1] = x[sl + (
currRing->N) + 1];
1658 block0=(
int*)
omAlloc0(4*
sizeof(
int));
1659 block1=(
int*)
omAlloc0(4*
sizeof(
int));
1660 wv=(
int**)
omAlloc0(4*
sizeof(
int**));
1661 block0[0] = block0[1] = 1;
1662 block1[0] = block1[1] =
rVar(origR);
1667 for (j=0;j<
rVar(origR);j++)
1668 if (
pGetExp(delVar,j+1)!=0) wv[0][j]=1;
1670 for (j=0;j<
rVar(origR);j++)
1675 for (j=0;j<
rVar(origR);j++)
1685 block0=(
int*)
omAlloc0(4*
sizeof(
int));
1686 block1=(
int*)
omAlloc0(4*
sizeof(
int));
1687 wv=(
int**)
omAlloc0(4*
sizeof(
int**));
1688 block0[0] = block0[1] = 1;
1689 block1[0] = block1[1] =
rVar(origR);
1693 for (j=0;j<
rVar(origR);j++)
1696 for (j=0;j<
rVar(origR);j++)
1697 if (
pGetExp(delVar,j+1)!=0) wv[1][j]=1;
1707 block0=(
int*)
omAlloc0(ordersize*
sizeof(
int));
1708 block1=(
int*)
omAlloc0(ordersize*
sizeof(
int));
1709 wv=(
int**)
omAlloc0(ordersize*
sizeof(
int**));
1710 for (
k=0;
k<ordersize-1;
k++)
1712 block0[
k+1] = origR->block0[
k];
1713 block1[
k+1] = origR->block1[
k];
1714 ord[
k+1] = origR->order[
k];
1715 if (origR->wvhdl[
k]!=
NULL) wv[
k+1] = (
int*)
omMemDup(origR->wvhdl[
k]);
1718 block1[0] =
rVar(origR);
1720 for (j=0;j<
rVar(origR);j++)
1721 if (
pGetExp(delVar,j+1)!=0) wv[0][j]=1;
1731 tmpR->block0 = block0;
1732 tmpR->block1 = block1;
1742 WerrorS(
"no elimination is possible: ordering condition is violated");
1759 if (origR->qideal!=
NULL)
1761 WarnS(
"eliminate in q-ring: experimental");
1795 Werror(
"error %d in >>groebner<<",err);
1808 Werror(
"error %d in >>modStd<<",err);
1812 else if (alg==
GbSba)
1820 Werror(
"wrong algorithm %d for SB",(
int)alg);
1831 while ((i >= 0) && (hh->m[i] ==
NULL)) i--;
1834 for (
k=0;
k<=
i;
k++)
1846 h3->m[
j] =
prMoveR( hh->m[
k], tmpR,origR);
1858 #ifdef WITH_OLD_MINOR 1862 poly idMinor(
matrix a,
int ar,
unsigned long which, ideal
R)
1866 int *rowchoise,*colchoise;
1875 rowchoise=(
int *)
omAlloc(ar*
sizeof(
int));
1876 colchoise=(
int *)
omAlloc(ar*
sizeof(
int));
1891 for (i=1; i<=ar; i++)
1893 for (j=1; j<=ar; j++)
1908 for (i=1; i<=ar; i++)
1932 int *rowchoise,*colchoise;
1941 rowchoise=(
int *)
omAlloc(ar*
sizeof(
int));
1942 colchoise=(
int *)
omAlloc(ar*
sizeof(
int));
1943 if ((i>512) || (j>512) || (i*j >512)) size=512;
1954 for (i=1; i<=ar; i++)
1956 for (j=1; j<=ar; j++)
1986 for (i=1; i<=ar; i++)
2014 const int r = a->nrows;
2015 const int c = a->ncols;
2017 if((ar<=0) || (ar>r) || (ar>c))
2019 Werror(
"%d-th minor, matrix is %dx%d",ar,r,c);
2031 for (
int i=r*c-1;
i>=0;
i--)
2032 if (a->m[
i] !=
NULL)
2067 result =
idrMoveR(result,tmpR,origR);
2085 if (id1->m[i] !=
NULL)
2108 for (i=length-1;i>=0;i--)
2114 if (w->
length()+1 < cmax)
2123 for (i=length-1;i>=0;i--)
2256 int i,
k,rk,flength=0,slength,
length;
2264 length =
si_max(flength,slength);
2277 ((*wtmp)[i])=(**w)[
i];
2294 temp->m[
i] =
pCopy(h2->m[i]);
2298 if(temp->m[i]!=
NULL)
2317 temp->m[
k] =
pCopy(h1->m[i]);
2337 if (syz_ring != orig_ring)
2357 if (wtmp!=
NULL)
delete wtmp;
2359 for (i=0;i<
IDELEMS(s_temp1);i++)
2361 if ((s_temp1->m[i]!=
NULL)
2362 && (((int)
pGetComp(s_temp1->m[i]))<=length))
2374 if (syz_ring!=orig_ring)
2398 while ((i>0) && (mod->m[i-1]==
NULL)) i--;
2419 for (i=0;i<(*convert)->length();i++)
2421 result->m[
i] =
pCopy(kBase->m[(**convert)[i]-1]);
2433 while ((j>0) && (kbase->m[j-1]==
NULL)) j--;
2434 if (j==0)
return -1;
2443 if (j==0)
return -1;
2505 while ((i>0) && (kbase->m[i-1]==
NULL)) i--;
2508 while ((
j>0) && (arg->m[
j-1]==
NULL))
j--;
2512 while ((
j>0) && (arg->m[
j-1]==
NULL))
j--;
2524 MATELEM(result,(*convert)[pos],
k+1) =
2542 for (i=
IDELEMS(arg)-1;i>=0;i--)
2566 int i,next_gen,next_comp;
2568 if (!inPlace) res =
idCopy(arg);
2570 int *red_comp=(
int*)
omAlloc((res->rank+1)*
sizeof(int));
2571 for (i=res->rank;i>=0;i--) red_comp[
i]=
i;
2577 if (next_gen<0)
break;
2580 for(i=next_comp+1;i<=arg->rank;i++) red_comp[i]--;
2583 for(i=next_comp;i<(*w)->length();i++) (**w)[i-1]=(**w)[
i];
2591 if ((w !=
NULL)&&(*w!=
NULL) &&(del>0))
2593 int nl=
si_max((*w)->length()-del,1);
2595 for(i=0;i<res->rank;i++) (*wtmp)[
i]=(**w)[
i];
2605 poly
id_GCD(poly
f, poly
g,
const ring r)
2609 ideal I=
idInit(2,1); I->m[0]=
f; I->m[1]=
g;
2612 if (w!=
NULL)
delete w;
2623 ideal I=
idInit(2,1); I->m[0]=
f; I->m[1]=
g;
2631 if (w!=
NULL)
delete w;
2651 int cnt=
IDELEMS(xx[0])*xx[0]->nrows;
2653 result->nrows=xx[0]->nrows;
2654 result->ncols=xx[0]->ncols;
2657 number *
x=(number *)
omAlloc(rl*
sizeof(number));
2658 for(i=cnt-1;i>=0;i--)
2664 for(j=rl-1;j>=0;j--)
2673 for(j=rl-1;j>=0;j--)
2686 number n=n_ChineseRemainder(x,q,rl, R->cf);
2688 for(j=rl-1;j>=0;j--)
2703 for(i=rl-1;i>=0;i--)
id_Delete(&(xx[i]), R);
2728 result->nrows=x->nrows;
2729 result->ncols=x->ncols;
2732 for(i=cnt-1;i>=0;i--)
2836 for (
int i = 0;
i < idsize;
i++)
2838 id_sort[
i].
p =
id->m[
i];
2842 int index, index_i, index_j;
2844 for (
int j = 1;
j < idsize;
j++)
2848 index_i = id_sort[
i].
index;
2849 index_j = id_sort[
j].
index;
2850 if (index_j > index_i)
2875 if (strat->
P.t_p==
NULL)
2884 bool nonTrivialSaturationToBeDone=
true;
2887 nonTrivialSaturationToBeDone=
false;
2894 if (mm[i]>0) nonTrivialSaturationToBeDone=
true;
2899 if (!nonTrivialSaturationToBeDone)
break;
2901 if (nonTrivialSaturationToBeDone)
2910 memset(&strat->
P,0,
sizeof(strat->
P));
2929 poly
p=strat->
P.t_p;
2936 bool nonTrivialSaturationToBeDone=
true;
2939 nonTrivialSaturationToBeDone=
false;
2946 if (mm[i]>0) nonTrivialSaturationToBeDone =
true;
2951 if (!nonTrivialSaturationToBeDone)
break;
2953 if (nonTrivialSaturationToBeDone)
2961 memset(&strat->
P,0,
sizeof(strat->
P));
2991 for (
int i=0;
i<
k;
i++)
2994 int li =
p_Var(x,r);
3000 WerrorS(
"ideal generators must be variables");
3008 for (
int i=1;
i<=r->N;
i++)
3016 Werror(
"exponent(x(%d)^%d) must be 0 or 1",
i,li);
3031 if (strcmp(n,
"slimgb")==0) alg=
GbSlimgb;
3032 else if (strcmp(n,
"std")==0) alg=
GbStd;
3033 else if (strcmp(n,
"sba")==0) alg=
GbSba;
3034 else if (strcmp(n,
"singmatic")==0) alg=
GbSingmatic;
3035 else if (strcmp(n,
"groebner")==0) alg=
GbGroebner;
3036 else if (strcmp(n,
"modstd")==0) alg=
GbModstd;
3037 else if (strcmp(n,
"ffmod")==0) alg=
GbFfmod;
3038 else if (strcmp(n,
"nfmod")==0) alg=
GbNfmod;
3039 else if (strcmp(n,
"std:sat")==0) alg=
GbStdSat;
3040 else Warn(
">>%s<< is an unknown algorithm",n);
3052 WarnS(
"requires: coef:field, commutative, global ordering, not qring");
3054 else if (alg==
GbSba)
3063 WarnS(
"requires: coef:domain, commutative, global ordering");
3073 WarnS(
">>modStd<< not found");
3082 WarnS(
"requires: coef:QQ, commutative, global ordering");
3088 WarnS(
">>satstd<< not found");
#define TEST_OPT_NOTREGULARITY
matrix idDiff(matrix i, int k)
#define __p_GetComp(p, r)
#define pSetmComp(p)
TODO:
void p_SetModDeg(intvec *w, ring r)
for idElimination, like a, except pFDeg, pWeigths ignore it
ideal id_Satstd(const ideal I, ideal J, const ring r)
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)
const CanonicalForm int s
ring sm_RingChange(const ring origR, long bound)
idhdl ggetid(const char *n)
void idDelEquals(ideal id)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
void idKeepFirstK(ideal id, const int k)
keeps the first k (>= 1) entries of the given ideal (Note that the kept polynomials may be zero...
static ideal idPrepare(ideal h1, tHomog hom, int syzcomp, intvec **w, GbVariant alg)
ideal idMultSect(resolvente arg, int length, GbVariant alg)
static void idPrepareStd(ideal s_temp, int k)
static CanonicalForm bound(const CFMatrix &M)
poly idDecompose(poly monom, poly how, ideal kbase, int *pos)
static BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
poly prCopyR(poly p, ring src_r, ring dest_r)
#define idDelete(H)
delete an ideal
void idLiftW(ideal P, ideal Q, int n, matrix &T, ideal &R, short *w)
static int si_min(const int a, const int b)
Compatiblity layer for legacy polynomial operations (over currRing)
int idIndexOfKBase(poly monom, ideal kbase)
ideal kSba(ideal F, ideal Q, tHomog h, intvec **w, int sbaOrder, int arri, intvec *hilb, int syzComp, int newIdeal, intvec *vw)
void p_TakeOutComp(poly *p, long comp, poly *q, int *lq, const ring r)
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring r)
poly prMoveR(poly &p, ring src_r, ring dest_r)
void mp_RecMin(int ar, ideal result, int &elems, matrix a, int lr, int lc, poly barDiv, ideal R, const ring r)
produces recursively the ideal of all arxar-minors of a
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static void p_GetExpV(poly p, int *ev, const ring r)
#define omFreeSize(addr, size)
#define idSimpleAdd(A, B)
matrix idDiffOp(ideal I, ideal J, BOOLEAN multiply)
static short rVar(const ring r)
#define rVar(r) (r->N)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
int pCompare_qsort(const void *a, const void *b)
CanonicalForm divide(const CanonicalForm &ff, const CanonicalForm &f, const CFList &as)
ring rAssure_SyzOrder(const ring r, BOOLEAN complete)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
static BOOLEAN rField_is_Domain(const ring r)
void WerrorS(const char *s)
ideal idModulo(ideal h2, ideal h1, tHomog hom, intvec **w)
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
#define TEST_V_INTERSECT_ELIM
void mp_MinorToResult(ideal result, int &elems, matrix a, int r, int c, ideal R, const ring)
entries of a are minors and go to result (only if not in R)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
#define pEqualPolys(p1, p2)
ideal idMinEmbedding(ideal arg, BOOLEAN inPlace, intvec **w)
poly singclap_pdivide(poly f, poly g, const ring r)
long sm_ExpBound(ideal m, int di, int ra, int t, const ring currRing)
ideal idQuot(ideal h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN resultIsIdeal)
static number p_SetCoeff(poly p, number n, ring r)
#define pGetComp(p)
Component.
static poly p_Copy(poly p, const ring r)
returns a copy of p
void * iiCallLibProc1(const char *n, void *arg, int arg_type, BOOLEAN &err)
ideal idMinBase(ideal h1)
static long p_SubExp(poly p, int v, long ee, ring r)
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
static poly p_Copy_noCheck(poly p, const ring r)
returns a copy of p (without any additional testing)
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
int p_Weight(int i, const ring r)
#define pGetExp(p, i)
Exponent.
void id_Shift(ideal M, int s, const ring r)
static poly p_Head(poly p, const ring r)
long p_DegW(poly p, const short *w, const ring R)
static ideal idInitializeQuot(ideal h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN *addOnlyOne, int *kkmax)
long p_Deg(poly a, const ring r)
Coefficient rings, fields and other domains suitable for Singular polynomials.
ideal idSeries(int n, ideal M, matrix U, intvec *w)
poly p_Farey(poly p, number N, const ring r)
void id_DelMultiples(ideal id, const ring r)
ideal id = (id[i]), c any unit if id[i] = c*id[j] then id[j] is deleted for j > i ...
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
intvec * idMWLift(ideal mod, intvec *weights)
const CanonicalForm CFMap CFMap & N
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
ideal idMinors(matrix a, int ar, ideal R)
compute all ar-minors of the matrix a the caller of mpRecMin the elements of the result are not in R ...
ideal idFreeModule(int i)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
double(* wFunctional)(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
ideal idSectWithElim(ideal h1, ideal h2)
ring rAssure_SyzComp(const ring r, BOOLEAN complete)
ring rAssure_dp_C(const ring r)
void idSort_qsort(poly_sort *id_sort, int idsize)
static BOOLEAN id_sat_vars_sp(kStrategy strat)
ideal t_rep_gb(const ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
void ipPrint_MA0(matrix m, const char *name)
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
static int p_LmCmp(poly p, poly q, const ring r)
void idGetNextChoise(int r, int end, BOOLEAN *endch, int *choise)
static int si_max(const int a, const int b)
int p_Compare(const poly a, const poly b, const ring R)
void PrintS(const char *s)
static BOOLEAN rField_is_Q(const ring r)
static long p_MinComp(poly p, ring lmRing, ring tailRing)
char name(const Variable &v)
ideal idCreateSpecialKbase(ideal kBase, intvec **convert)
static poly p_LmFreeAndNext(poly p, ring)
BOOLEAN idIsSubModule(ideal id1, ideal id2)
resolvente sySchreyerResolvente(ideal arg, int maxlength, int *length, BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static poly pReverse(poly p)
ideal idLiftStd(ideal h1, matrix *ma, tHomog hi, ideal *syz, GbVariant alg)
static int index(p_Length length, p_Ord ord)
void rSetSyzComp(int k, const ring r)
void rChangeCurrRing(ring r)
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
poly id_GCD(poly f, poly g, const ring r)
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
matrix mpNew(int r, int c)
create a r x c zero-matrix
#define TEST_OPT_RETURN_SB
static void p_Delete(poly *p, const ring r)
matrix mp_MultP(matrix a, poly p, const ring R)
multiply a matrix 'a' by a poly 'p', destroy the args
#define SI_RESTORE_OPT2(A)
ideal idInit(int idsize, int rank)
initialise an ideal / module
const Variable & v
< [in] a sqrfree bivariate poly
#define pSeries(n, p, u, w)
ideal idElimination(ideal h1, poly delVar, intvec *hilb, GbVariant alg)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
poly p_DivideM(poly a, poly b, const ring r)
void * iiCallLibProcM(const char *n, void **args, int *arg_types, BOOLEAN &err)
args: NULL terminated arry of arguments arg_types: 0 terminated array of corresponding types ...
static BOOLEAN rField_is_Ring(const ring r)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
ideal id_Farey(ideal x, number N, const ring r)
void pEnlargeSet(poly **p, int l, int increment)
void wCall(poly *s, int sl, int *x, double wNsqr, const ring R)
BOOLEAN rHasGlobalOrdering(const ring r)
void rDelete(ring r)
unconditionally deletes fields in r
GbVariant syGetAlgorithm(char *n, const ring r, const ideal)
void pTakeOutComp(poly *p, long comp, poly *q, int *lq, const ring R=currRing)
Splits *p into two polys: *q which consists of all monoms with component == comp and *p of all other ...
void sm_KillModifiedRing(ring r)
static void idDeleteComps(ideal arg, int *red_comp, int del)
ideal kMin_std(ideal F, ideal Q, tHomog h, intvec **w, ideal &M, intvec *hilb, int syzComp, int reduced)
static int * id_satstdSaturatingVariables
void idInitChoise(int r, int beg, int end, BOOLEAN *endch, int *choise)
static BOOLEAN length(leftv result, leftv arg)
poly mp_DetBareiss(matrix a, const ring r)
returns the determinant of the matrix m; uses Bareiss algorithm
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
static void p_Setm(poly p, const ring r)
void syGaussForOne(ideal syz, int elnum, int ModComp, int from, int till)
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
static nc_type & ncRingType(nc_struct *p)
ideal idXXX(ideal h1, int k)
#define TEST_V_INTERSECT_SYZ
poly prMoveR_NoSort(poly &p, ring src_r, ring dest_r)
static poly p_Neg(poly p, const ring r)
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
int id_ReadOutPivot(ideal arg, int *comp, const ring r)
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
static poly p_Add_q(poly p, poly q, const ring r)
BOOLEAN nc_CheckSubalgebra(poly PolyVar, ring r)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
int p_Var(poly m, const ring r)
#define SI_RESTORE_OPT1(A)
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
ideal id_Matrix2Module(matrix mat, const ring R)
converts mat to module, destroys mat
static ideal idMult(ideal h1, ideal h2)
hh := h1 * h2
void Werror(const char *fmt,...)
ideal kGroebner(ideal F, ideal Q)
double wFunctionalBuch(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
ideal idSect(ideal h1, ideal h2, GbVariant alg)
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
#define pCopy(p)
return a copy of the poly
#define MATELEM(mat, i, j)
1-based access to matrix