60 WarnS(
"minbase applies only to the local or homogeneous case over coefficient fields");
64 homog = idHomModule(h1,
currRing->qideal,&wth);
69 WarnS(
"minbase applies only to the local or homogeneous case over coefficient fields");
92 while ((
k > 0) && (h3->m[
k-1] ==
NULL))
k--;
95 while ((
l > 0) && (h2->m[
l-1] ==
NULL))
l--;
96 for (
i=
l-1;
i>=0;
i--)
101 while ((ll <
k) && ((h3->m[ll] ==
NULL)
153 for (
j=0;
j<r->N-1;
j++) names[
j]=r->names[
j];
238 Werror(
"error %d in >>groebner<<",err);
246 void *args[]={temp,(
void*)1,
NULL};
253 Werror(
"error %d in >>modStd<<",err);
296 void *args[]={temp,
v,
NULL};
304 Werror(
"error %d in >>satstd<<",err);
321 int rank=si_max(h1->rank,h2->rank);
328 ideal first,second,temp,temp1,
result;
340 int t=flength; flength=slength; slength=t;
342 length = si_max(flength,slength);
361 while ((
j>0) && (first->m[
j-1]==
NULL))
j--;
366 if (first->m[
i]!=
NULL)
368 if (syz_ring==orig_ring)
369 temp->m[
k] =
pCopy(first->m[
i]);
371 temp->m[
k] =
prCopyR(first->m[
i], orig_ring, syz_ring);
384 if (second->m[
i]!=
NULL)
386 if (syz_ring==orig_ring)
387 temp->m[
k] =
pCopy(second->m[
i]);
402 WarnS(
"wrong algorithm for GB");
407 if(syz_ring!=orig_ring)
414 if ((temp1->m[
i]!=
NULL)
417 if(syz_ring==orig_ring)
423 p =
prMoveR(temp1->m[
i], syz_ring,orig_ring);
440 if(syz_ring!=orig_ring)
474 int i,
j=0,
k=0,
l,maxrk=-1,realrki;
476 ideal bigmat,tempstd,
result;
481 for (
i=0;
i<length;
i++)
488 if (realrki>maxrk) maxrk = realrki;
518 for (
i=0;
i<maxrk;
i++)
525 bigmat->m[
i] =
pAdd(bigmat->m[
i],
p);
531 for (
j=0;
j<length;
j++)
539 if (syz_ring==orig_ring)
557 WarnS(
"wrong algorithm for GB");
562 if(syz_ring!=orig_ring)
572 if (syz_ring==orig_ring)
582 if(syz_ring!=orig_ring)
585 if(syz_ring!=orig_ring)
637 Warn(
"syzcomp too low, should be %d instead of %d",
k,syzcomp);
641 h2->rank = syzcomp+
i;
691 PrintS(
" --------------before std------------------------\n");
703 WarnS(
"wrong algorithm for GB");
714 int h1_size,
BOOLEAN inputIsIdeal,
const ring oring,
const ring sring)
724 Print(
"after std: --------------syzComp=%d------------------------\n",syzComp);
733 if (s_h3->m[
j] !=
NULL)
759 (*S)->m[
j]=s_h3->m[
j];
771 PrintS(
"T: ----------------------------------------\n");
790 if (s_h2->m[
j] !=
NULL)
792 poly q =
prMoveR( s_h2->m[
j], sring,oring);
838 int j,
k, length=0,reg;
840 int ii, idElemens_h1;
846 for(ii=0;ii<idElemens_h1 ;ii++)
pTest(h1->m[ii]);
854 k=si_max(1,slength );
861 if (orig_ring != syz_ring)
881 if (orig_ring != syz_ring)
886 if (s_h3->m[
j] !=
NULL)
888 if (p_MinComp(s_h3->m[
j],syz_ring) >
k)
891 p_Delete(&s_h3->m[
j],syz_ring);
900 if (rIsPluralRing(orig_ring))
914 if (s_h3->m[
j] !=
NULL)
916 if (p_MinComp(s_h3->m[
j],syz_ring) <=
k)
918 e->m[
j] = s_h3->m[
j];
919 isMonomial=isMonomial && (
pNext(s_h3->m[
j])==
NULL);
920 p_Delete(&
pNext(s_h3->m[
j]),syz_ring);
938 assume(orig_ring==syz_ring);
940 if (dp_C_ring != syz_ring)
949 for (
j=0;
j<length;
j++)
955 if (dp_C_ring != orig_ring)
997 return idInit(1,h1->rank);
1000 BITSET saveOpt1,saveOpt2;
1003 k=si_max(1,inputIsIdeal);
1014 if (orig_ring != syz_ring)
1029 if (syz_ring!=orig_ring)
1039 if (syz_ring!=orig_ring)
rDelete(syz_ring);
1040 s_h3->rank=h1->rank;
1060 if (s_temp->m[
j]!=
NULL)
1073 s_temp->m[
j] =
pAdd(
p, q);
1090 *unit=
mpNew(e_mod,e_mod);
1092 for(
int i=e_mod;
i>0;
i--)
1115 int idelems_submod=
IDELEMS(submod);
1125 return idInit(1,idelems_mod);
1133 return idInit(1,idelems_mod);
1137 WerrorS(
"2nd module does not lie in the first");
1143 comps_to_add = idelems_submod;
1144 while ((comps_to_add>0) && (submod->m[comps_to_add-1]==
NULL))
1148 if ((
k!=0) && (lsmod==0)) lsmod=1;
1149 k=si_max(
k,(
int)
mod->rank);
1157 ideal s_mod, s_temp;
1158 if (orig_ring != syz_ring)
1210 for(
j = 0;
j<comps_to_add;
j++)
1223 s_temp->rank += (
k+comps_to_add);
1226 s_result->rank = s_h3->rank;
1233 if (s_result->m[
j]!=
NULL)
1243 WarnS(
"first module not a standardbasis\n"
1244 "// ** or second not a proper submodule");
1247 WerrorS(
"2nd module does not lie in the first");
1251 if(syz_ring!=orig_ring)
1262 s_result=
idInit(idelems_submod,idelems_mod);
1267 p = s_rest->m[
j] = s_result->m[
j];
1274 pNeg(s_result->m[
j]);
1277 if ((lsmod==0) && (s_rest!=
NULL))
1281 if (s_rest->m[
j-1]!=
NULL)
1287 if(syz_ring!=orig_ring)
1297 s_rest->rank=
mod->rank;
1304 *unit=
mpNew(idelems_submod,idelems_submod);
1308 poly
p=s_result->m[
i];
1326 else p=s_result->m[
i];
1337 s_result->rank=idelems_mod;
1417 int i,
l,ll,
k,kkk,kmax;
1425 if ((k2==0) && (
k>1)) *addOnlyOne =
FALSE;
1432 if (weights!=
NULL)
delete weights;
1436 int kk=si_max(k1,k2);
1445 *q_len=idElem(
currRing->qideal)*kk;
1446 for(
int i=1;
i<=kk;
i++)
1459 if (h2->m[
i] !=
NULL)
1470 *kkmax = kmax =
j*
k+1;
1485 if (h4->m[
i-1]!=
NULL)
1499 if(temph1->m[
l]!=
NULL)
1501 for (ll=0; ll<
j; ll++)
1525 h4->m[
i] = h4->m[
i+1];
1565 if (orig_ring!=syz_ring)
1567 s_h4 =
idrMoveR(s_h4,orig_ring, syz_ring);
1607 m=idModule2Matrix(
idCopy(s_h3));
1608 Print(
"result, kmax=%d:\n",kmax);
1614 if (weights1!=
NULL)
delete weights1;
1632 s_h3->rank = h1->rank;
1633 if(syz_ring!=orig_ring)
1652 int *block0,*block1;
1666 WerrorS(
"cannot eliminate in a qring");
1671 if (rIsPluralRing(origR))
1679 WerrorS(
"no elimination is possible: subalgebra is not admissible");
1687 ordersize=rBlocks(origR)+1;
1689 if (rIsPluralRing(origR))
1692 for (
k=0;
k<ordersize-1;
k++)
1694 block0[
k+1] = origR->block0[
k];
1695 block1[
k+1] = origR->block1[
k];
1696 ord[
k+1] = origR->order[
k];
1697 if (origR->wvhdl[
k]!=
NULL) wv[
k+1] = (
int*)
omMemDup(origR->wvhdl[
k]);
1707 double wNsqr = (double)2.0 / (
double)(
currRing->N);
1711 wCall(h1->m, sl,
x, wNsqr);
1712 for (sl = (
currRing->N); sl!=0; sl--)
1713 wv[1][sl-1] =
x[sl + (
currRing->N) + 1];
1721 if ((hom==
TRUE) && (origR->OrdSgn==1) && (!rIsPluralRing(origR)))
1729 block0=(
int*)
omAlloc0(4*
sizeof(
int));
1730 block1=(
int*)
omAlloc0(4*
sizeof(
int));
1731 wv=(
int**)
omAlloc0(4*
sizeof(
int**));
1732 block0[0] = block0[1] = 1;
1733 block1[0] = block1[1] = rVar(origR);
1734 wv[0]=(
int*)
omAlloc0((rVar(origR) + 1)*
sizeof(
int));
1738 for (
j=0;
j<rVar(origR);
j++)
1741 for (
j=0;
j<rVar(origR);
j++)
1745 wv[1]=(
int*)
omAlloc0((rVar(origR) + 1)*
sizeof(
int));
1746 for (
j=0;
j<rVar(origR);
j++)
1756 block0=(
int*)
omAlloc0(4*
sizeof(
int));
1757 block1=(
int*)
omAlloc0(4*
sizeof(
int));
1758 wv=(
int**)
omAlloc0(4*
sizeof(
int**));
1759 block0[0] = block0[1] = 1;
1760 block1[0] = block1[1] = rVar(origR);
1761 wv[0]=(
int*)
omAlloc0((rVar(origR) + 1)*
sizeof(
int));
1762 wv[1]=(
int*)
omAlloc0((rVar(origR) + 1)*
sizeof(
int));
1764 for (
j=0;
j<rVar(origR);
j++)
1767 for (
j=0;
j<rVar(origR);
j++)
1778 block0=(
int*)
omAlloc0(ordersize*
sizeof(
int));
1779 block1=(
int*)
omAlloc0(ordersize*
sizeof(
int));
1780 wv=(
int**)
omAlloc0(ordersize*
sizeof(
int**));
1781 for (
k=0;
k<ordersize-1;
k++)
1783 block0[
k+1] = origR->block0[
k];
1784 block1[
k+1] = origR->block1[
k];
1785 ord[
k+1] = origR->order[
k];
1786 if (origR->wvhdl[
k]!=
NULL)
1791 int l=(origR->block1[
k]-origR->block0[
k]+1)*
sizeof(
int);
1794 memcpy(wv[
k+1],origR->wvhdl[
k],
l);
1799 block1[0] = rVar(origR);
1800 wv[0]=(
int*)
omAlloc0((rVar(origR) + 1)*
sizeof(
int));
1801 for (
j=0;
j<rVar(origR);
j++)
1812 tmpR->block0 = block0;
1813 tmpR->block1 = block1;
1819 if (rIsPluralRing(origR))
1823 WerrorS(
"no elimination is possible: ordering condition is violated");
1840 if (origR->qideal!=
NULL)
1842 WarnS(
"eliminate in q-ring: experimental");
1855 WarnS(
"wrong algorithm for GB");
1862 while ((
i >= 0) && (hh->m[
i] ==
NULL))
i--;
1865 for (
k=0;
k<=
i;
k++)
1868 while ((
l>0) && (p_GetExp( hh->m[
k],
l,tmpR)*
pGetExp(delVar,
l)==0))
l--;
1877 h3->m[
j] =
prMoveR( hh->m[
k], tmpR,origR);
1893 if (hh!=
NULL)
delete hh;
1897#ifdef WITH_OLD_MINOR
1901poly idMinor(
matrix a,
int ar,
unsigned long which, ideal
R)
1905 int *rowchoise,*colchoise;
1911 rowchoise=(
int *)
omAlloc(ar*
sizeof(
int));
1912 colchoise=(
int *)
omAlloc(ar*
sizeof(
int));
1923 for (
i=1;
i<=ar;
i++)
1925 for (
j=1;
j<=ar;
j++)
1941 for (
i=1;
i<=ar;
i++)
1964 int *rowchoise,*colchoise;
1974 rowchoise=(
int *)
omAlloc(ar*
sizeof(
int));
1975 colchoise=(
int *)
omAlloc(ar*
sizeof(
int));
1985 for (
i=1;
i<=ar;
i++)
1987 for (
j=1;
j<=ar;
j++)
2014 for (
i=1;
i<=ar;
i++)
2042 const int r = a->
nrows;
2043 const int c = a->
ncols;
2045 if((ar<=0) || (ar>r) || (ar>c))
2047 Werror(
"%d-th minor, matrix is %dx%d",ar,r,c);
2059 for (
int i=r*c-1;
i>=0;
i--)
2112 if (id1->m[
i] !=
NULL)
2135 for (
i=length-1;
i>=0;
i--)
2141 if (
w->length()+1 < cmax)
2150 for (
i=length-1;
i>=0;
i--)
2282 int i,
k,rk,flength=0,slength,length;
2290 length = si_max(flength,slength);
2302 for (
i=0;
i<length;
i++)
2303 ((*wtmp)[
i])=(**w)[
i];
2313 ((*wtmp)[
i+length]) = d;
2327 if(temp->m[
i]!=
NULL)
2365 if (syz_ring != orig_ring)
2375 BITSET save_opt,save_opt2;
2379 ideal s_temp1 =
idGroebner(s_temp,length,alg);
2388 ((**
w)[
i])=(*wtmp)[
i+length];
2390 if (wtmp!=
NULL)
delete wtmp;
2396 if (s_temp1->m[
i]!=
NULL)
2398 if (((
int)
pGetComp(s_temp1->m[
i]))<=length)
2414 if (s_temp1->m[
i]!=
NULL)
2416 if (((
int)
pGetComp(s_temp1->m[
i]))<=length)
2421 }
while((
int)
pGetComp(s_temp1->m[
i])<=length);
2422 poly q =
prMoveR( s_temp1->m[
i], syz_ring,orig_ring);
2423 s_temp1->m[
i] =
NULL;
2437 }
while (q !=
NULL);
2450 if (syz_ring!=orig_ring)
2477 int i,flength=0,slength,length;
2484 length = si_max(flength,slength);
2497 for (
i=0;
i<length;
i++)
2498 ((*wtmp)[
i])=(**w)[
i];
2508 ((*wtmp)[
i+length]) = d;
2521 if (syz_ring != orig_ring)
2532 BITSET save_opt,save_opt2;
2546 ((**
w)[
i])=(*wtmp)[
i+length];
2548 if (wtmp!=
NULL)
delete wtmp;
2554 if (syz_ring!=orig_ring)
2594 *convert = idSort(kBase,
FALSE);
2595 for (
i=0;
i<(*convert)->length();
i++)
2609 while ((
j>0) && (kbase->m[
j-1]==
NULL))
j--;
2610 if (
j==0)
return -1;
2619 if (
j==0)
return -1;
2681 while ((
i>0) && (kbase->m[
i-1]==
NULL))
i--;
2684 while ((
j>0) && (arg->m[
j-1]==
NULL))
j--;
2688 while ((
j>0) && (arg->m[
j-1]==
NULL))
j--;
2741 int i=0,
j, generator=-1;
2742 int rk_arg=arg->rank;
2743 int * componentIsUsed =(
int *)
omAlloc((rk_arg+1)*
sizeof(
int));
2746 while ((generator<0) && (
i<
IDELEMS(arg)))
2748 memset(componentIsUsed,0,(rk_arg+1)*
sizeof(
int));
2755 if (componentIsUsed[
j]==0)
2757 if (p_LmIsConstantComp(
p,r) &&
2758 n_IsUnit(pGetCoeff(
p),r->cf))
2761 componentIsUsed[
j] = 1;
2765 componentIsUsed[
j] = -1;
2768 else if (componentIsUsed[
j]>0)
2770 (componentIsUsed[
j])++;
2780 if (componentIsUsed[
j]==0)
2782 if (p_LmIsConstantComp(
p,r))
2785 componentIsUsed[
j] = 1;
2789 componentIsUsed[
j] = -1;
2792 else if (componentIsUsed[
j]>0)
2794 (componentIsUsed[
j])++;
2803 for (
j=0;
j<=rk_arg;
j++)
2805 if (componentIsUsed[
j]>0)
2807 if ((*
comp==-1) || (componentIsUsed[
j]<
i))
2810 i= componentIsUsed[
j];
2823 int* red_comp,
int &del)
2826 int i,next_gen,next_comp;
2830 for (
i=
res->rank;
i>=0;
i--) red_comp[
i]=
i;
2835 if (next_gen<0)
break;
2838 for(
i=next_comp+1;
i<=arg->rank;
i++) red_comp[
i]--;
2841 for(
i=next_comp;
i<(*w)->length();
i++) (**
w)[
i-1]=(**w)[
i];
2849 int nl=si_max((*w)->length()-del,1);
2851 for(
i=0;
i<nl;
i++) (*wtmp)[
i]=(**w)[
i];
2860 int *red_comp=(
int*)
omAlloc((arg->rank+1)*
sizeof(
int));
2870 int *red_comp=(
int*)
omAlloc((arg->rank+1)*
sizeof(
int));
2886 for(
int i=0;
i<arg->rank;
i++)
g[
i]=
i+1;
2890 int *red_comp=(
int*)
omAlloc((arg->rank+1)*
sizeof(
int));
2894 for(
int i=1;
i<=arg->rank;
i++)
2904ideal idMinEmbedding_with_map0(ideal arg,
intvec **
w, ideal &trans)
2909 const int rk=a->rank;
2934 number n=
nCopy(pGetCoeff(
p));
2953 if(changed)
continue;
2962 while(a->m[
i]!=
NULL)
2989poly
id_GCD(poly
f, poly
g,
const ring r)
2993 ideal I=
idInit(2,1); I->m[0]=
f; I->m[1]=
g;
3007 ideal I=
idInit(2,1); I->m[0]=
f; I->m[1]=
g;
3035 int cnt=
IDELEMS(xx[0])*xx[0]->nrows;
3037 result->nrows=xx[0]->nrows;
3038 result->ncols=xx[0]->ncols;
3041 number *
x=(number *)
omAlloc(rl*
sizeof(number));
3042 for(
i=cnt-1;
i>=0;
i--)
3048 for(
j=rl-1;
j>=0;
j--)
3052 &&((r==
NULL)||(p_LmCmp(r,
h,
R)==-1)))
3057 for(
j=rl-1;
j>=0;
j--)
3060 if ((hh!=
NULL) && (p_LmCmp(r,hh,
R)==0))
3063 hh=p_LmFreeAndNext(hh,
R);
3067 x[
j]=n_Init(0,
R->cf);
3070 number n=n_ChineseRemainder(
x,q,rl,
R->cf);
3072 for(
j=rl-1;
j>=0;
j--)
3076 if (n_IsZero(n,
R->cf)) p_Delete(&
h,
R);
3081 res_p=p_Add_q(res_p,
h,
R);
3116 for(
i=cnt-1;
i>=0;
i--)
3220 for (
int i = 0;
i < idsize;
i++)
3222 id_sort[
i].
p =
id->m[
i];
3226 int index, index_i, index_j;
3228 for (
int j = 1;
j < idsize;
j++)
3232 index_i = id_sort[
i].
index;
3233 index_j = id_sort[
j].
index;
3234 if (index_j > index_i)
3259 if (strat->
P.t_p==
NULL)
3268 bool nonTrivialSaturationToBeDone=
true;
3271 nonTrivialSaturationToBeDone=
false;
3277 mm[
i]=si_min(mm[
i],m0[
i]);
3278 if (mm[
i]>0) nonTrivialSaturationToBeDone=
true;
3283 if (!nonTrivialSaturationToBeDone)
break;
3285 if (nonTrivialSaturationToBeDone)
3314 poly
p=strat->
P.t_p;
3321 bool nonTrivialSaturationToBeDone=
true;
3324 nonTrivialSaturationToBeDone=
false;
3330 mm[
i]=si_min(mm[
i],m0[
i]);
3331 if (mm[
i]>0) nonTrivialSaturationToBeDone =
true;
3336 if (!nonTrivialSaturationToBeDone)
break;
3338 if (nonTrivialSaturationToBeDone)
3377 for (
int i=0;
i<
k;
i++)
3386 WerrorS(
"ideal generators must be variables");
3396 Werror(
"generator must be a monomial");
3400 for (
int i=1;
i<=r->N;
i++)
3402 int li = p_GetExp(
x,
i,r);
3408 Werror(
"exponent(x(%d)^%d) must be 0 or 1",
i,li);
3423 int *block0,*block1;
3428 block0=(
int*)
omAlloc0(4*
sizeof(
int));
3429 block1=(
int*)
omAlloc0(4*
sizeof(
int));
3430 wv=(
int**)
omAlloc0(4*
sizeof(
int**));
3431 wv[0]=(
int*)
omAlloc0((rVar(origR) + 2)*
sizeof(
int));
3432 block0[0] = block0[1] = 1;
3433 block1[0] = block1[1] = rVar(origR)+1;
3437 wv[0][rVar(origR)]=1;
3439 for (
int j=0;
j<rVar(origR);
j++)
3443 wv[1]=(
int*)
omAlloc0((rVar(origR) + 1)*
sizeof(
int));
3444 for (
int j=0;
j<rVar(origR);
j++)
3452 char **names=(
char**)
omAlloc0((origR->N+1) *
sizeof(
char *));
3453 for (
int j=0;
j<rVar(origR);
j++)
3454 names[
j]=origR->names[
j];
3455 names[rVar(origR)]=(
char*)
"@";
3456 ring tmpR=
rDefault(nCopyCoeff(origR->cf),rVar(origR)+1,names,4,ord,block0,block1,wv);
3466 p_SetExp(t,rVar(tmpR),1,tmpR);
3470 p=p_Mult_q(
p,t,tmpR);
3477 p_SetExp(t,rVar(tmpR),1,tmpR);
3483 if ((TT->m[
j]!=
NULL)
3484 && (p_GetExp(TT->m[
j],rVar(tmpR),tmpR)>0))
3486 p_Delete(&TT->m[
j],tmpR);
3553 int elem=idElem(tmp);
3582 Iquot=
idQuot(Istd,J,isSB,isIdeal);
3586 int elem=idElem(tmp);
3626 if (ww!=
NULL)
delete ww;
3636 int *perm=(
int*)
omAlloc0((rVar(r)+1)*
sizeof(
int));
3637 for(
int i=rVar(r)-1;
i>0;
i--) perm[
i]=
i;
3671 if (ww!=
NULL)
delete ww;
3681 int *perm=(
int*)
omAlloc0((rVar(r)+1)*
sizeof(
int));
3682 for(
int i=rVar(r)-1;
i>0;
i--) perm[
i]=
i;
3704 if (strcmp(n,
"default")==0) alg=
GbDefault;
3705 else if (strcmp(n,
"slimgb")==0) alg=
GbSlimgb;
3706 else if (strcmp(n,
"std")==0) alg=
GbStd;
3707 else if (strcmp(n,
"sba")==0) alg=
GbSba;
3708 else if (strcmp(n,
"singmatic")==0) alg=
GbSingmatic;
3709 else if (strcmp(n,
"groebner")==0) alg=
GbGroebner;
3710 else if (strcmp(n,
"modstd")==0) alg=
GbModstd;
3711 else if (strcmp(n,
"ffmod")==0) alg=
GbFfmod;
3712 else if (strcmp(n,
"nfmod")==0) alg=
GbNfmod;
3713 else if (strcmp(n,
"std:sat")==0) alg=
GbStdSat;
3714 else Warn(
">>%s<< is an unknown algorithm",n);
3718 if(rHasGlobalOrdering(r)
3726 WarnS(
"requires: coef:field, commutative, global ordering, not qring");
3728 else if (alg==
GbSba)
3730 if(rField_is_Domain(r)
3732 &&(rHasGlobalOrdering(r)))
3737 WarnS(
"requires: coef:domain, commutative, global ordering");
3747 WarnS(
">>modStd<< not found");
3749 else if(rField_is_Q(r)
3751 &&(rHasGlobalOrdering(r)))
3756 WarnS(
"requires: coef:QQ, commutative, global ordering");
3762 WarnS(
">>satstd<< not found");
const CanonicalForm CFMap CFMap & N
poly singclap_pdivide(poly f, poly g, const ring r)
Coefficient rings, fields and other domains suitable for Singular polynomials.
number ndCopyMap(number a, const coeffs src, const coeffs dst)
const CanonicalForm int s
CanonicalForm divide(const CanonicalForm &ff, const CanonicalForm &f, const CFList &as)
const Variable & v
< [in] a sqrfree bivariate poly
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
void WerrorS(const char *s)
GbVariant syGetAlgorithm(char *n, const ring r, const ideal)
static ideal idMinEmbedding1(ideal arg, BOOLEAN inPlace, intvec **w, int *red_comp, int &del)
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
void idLiftW(ideal P, ideal Q, int n, matrix &T, ideal &R, int *w)
static void idLift_setUnit(int e_mod, matrix *unit)
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
matrix idDiff(matrix i, int k)
ideal id_Sat_principal(ideal I, ideal J, const ring origR)
ideal idSaturateGB(ideal I, ideal J, int &k, BOOLEAN isIdeal)
static ideal idGroebner(ideal temp, int syzComp, GbVariant alg, bigintmat *hilb=NULL, intvec *w=NULL, tHomog hom=testHomog)
static ideal idInitializeQuot(ideal h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN *addOnlyOne, int *kkmax, int *q_len)
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
ideal id_Homogenize(ideal I, int var_num, const ring r)
ideal idLiftStd(ideal h1, matrix *T, tHomog hi, ideal *S, GbVariant alg, ideal h11)
void idDelEquals(ideal id)
int pCompare_qsort(const void *a, const void *b)
ideal idQuot(ideal h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN resultIsIdeal)
ideal id_HomogenizeW(ideal I, int var_num, intvec *w, const ring r)
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 idSaturate(ideal I, ideal J, int &k, BOOLEAN isIdeal)
void ipPrint_MA0(matrix m, const char *name)
BOOLEAN idIsSubModule(ideal id1, ideal id2)
ideal idSeries(int n, ideal M, matrix U, intvec *w)
ideal idMinEmbedding_with_map_v(ideal arg, intvec **w, ideal &trans, int *g)
ideal idCreateSpecialKbase(ideal kBase, intvec **convert)
static ideal idPrepare(ideal h1, ideal h11, tHomog hom, int syzcomp, intvec **w, GbVariant alg)
poly id_GCD(poly f, poly g, const ring r)
int idIndexOfKBase(poly monom, ideal kbase)
poly idDecompose(poly monom, poly how, ideal kbase, int *pos)
ideal idSaturate_intern(ideal I, ideal J, int &k, BOOLEAN isIdeal, BOOLEAN isSB)
ideal idElimination2(ideal h1, poly delVar, bigintmat *hilb, GbVariant alg)
matrix idDiffOp(ideal I, ideal J, BOOLEAN multiply)
void idSort_qsort(poly_sort *id_sort, int idsize)
ideal idElimination(ideal h1, poly delVar, intvec *hilb, GbVariant alg)
static ideal idSectWithElim(ideal h1, ideal h2, GbVariant alg)
ideal idSect(ideal h1, ideal h2, GbVariant alg)
ideal idMultSect(resolvente arg, int length, GbVariant alg)
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....
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
represents the generators of submod in terms of the generators of mod (Matrix(SM)*U-Matrix(rest)) = M...
STATIC_VAR int * id_satstdSaturatingVariables
ideal idExtractG_T_S(ideal s_h3, matrix *T, ideal *S, long syzComp, int h1_size, BOOLEAN inputIsIdeal, const ring oring, const ring sring)
static void idDeleteComps(ideal arg, int *red_comp, int del)
ideal idModulo(ideal h2, ideal h1, tHomog hom, intvec **w, matrix *T, GbVariant alg)
ideal idMinEmbedding_with_map(ideal arg, intvec **w, ideal &trans)
ideal idMinBase(ideal h1, ideal *SB)
ideal id_Farey(ideal x, number N, const ring r)
ideal id_Satstd(const ideal I, ideal J, const ring r)
static int id_ReadOutPivot(ideal arg, int *comp, const ring r)
ideal idModuloLP(ideal h2, ideal h1, tHomog, intvec **w, matrix *T, GbVariant alg)
static BOOLEAN id_sat_vars_sp(kStrategy strat)
ideal idMinEmbedding(ideal arg, BOOLEAN inPlace, intvec **w)
#define idDelete(H)
delete an ideal
void idGetNextChoise(int r, int end, BOOLEAN *endch, int *choise)
ideal id_Copy(ideal h1, const ring r)
copy an ideal
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)
void idInitChoise(int r, int beg, int end, BOOLEAN *endch, int *choise)
ideal idFreeModule(int i)
bigintmat * iv2biv(intvec *hilb, const coeffs cf)
intvec * ivCopy(const intvec *o)
idhdl ggetid(const char *n)
EXTERN_VAR omBin sleftv_bin
leftv ii_CallLibProcM(const char *n, void **args, int *arg_types, const ring R, BOOLEAN &err)
args: NULL terminated array of arguments arg_types: 0 terminated array of corresponding types
void * iiCallLibProc1(const char *n, void *arg, int arg_type, BOOLEAN &err)
void p_TakeOutComp(poly *p, long comp, poly *q, int *lq, const ring r)
ideal kMin_std2(ideal F, ideal Q, tHomog h, intvec **w, ideal &M, bigintmat *hilb, int syzComp, int reduced)
ideal kStd2(ideal F, ideal Q, tHomog h, intvec **w, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
generic interface to GB/SB computations, large hilbert vectors
ideal kSba(ideal F, ideal Q, tHomog h, intvec **w, int sbaOrder, int arri, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
BOOLEAN nc_CheckSubalgebra(poly PolyVar, ring r)
matrix mpNew(int r, int c)
create a r x c zero-matrix
matrix mp_MultP(matrix a, poly p, const ring R)
multiply a matrix 'a' by a poly 'p', destroy the args
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
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)
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
poly mp_DetBareiss(matrix a, const ring r)
returns the determinant of the matrix m; uses Bareiss algorithm
#define MATELEM(mat, i, j)
1-based access to matrix
#define __p_GetComp(p, r)
static ideal idPrepareStd(ideal T, ideal s, int k)
#define omFreeSize(addr, size)
#define omFreeBin(addr, bin)
#define SI_SAVE_OPT(A, B)
#define SI_RESTORE_OPT1(A)
#define SI_RESTORE_OPT2(A)
#define TEST_OPT_RETURN_SB
#define TEST_V_INTERSECT_ELIM
#define TEST_V_INTERSECT_SYZ
#define TEST_OPT_NOTREGULARITY
#define SI_RESTORE_OPT(A, B)
poly p_DivideM(poly a, poly b, const ring r)
poly p_Farey(poly p, number N, const ring r)
int p_Weight(int i, const ring r)
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
poly p_Div_nn(poly p, const number n, const ring r)
void p_Norm(poly p1, const ring r)
int p_Compare(const poly a, const poly b, const ring R)
long p_DegW(poly p, const int *w, const ring R)
poly p_Vec2Poly(poly v, int k, const ring r)
void p_SetModDeg(intvec *w, ring r)
int p_Var(poly m, const ring r)
poly p_Sub(poly p1, poly p2, const ring r)
void pEnlargeSet(poly **p, int l, int increment)
long p_Deg(poly a, const ring r)
void rChangeCurrRing(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 pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
#define pGetComp(p)
Component.
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
#define pSeries(n, p, u, w)
#define pGetExp(p, i)
Exponent.
#define pSetmComp(p)
TODO:
#define pEqualPolys(p1, p2)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
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 ...
#define pCopy(p)
return a copy of the poly
poly prMoveR(poly &p, ring src_r, ring dest_r)
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
poly prCopyR(poly p, ring src_r, ring dest_r)
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
poly prMoveR_NoSort(poly &p, ring src_r, ring dest_r)
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
void PrintS(const char *s)
void Werror(const char *fmt,...)
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...
ring rAssure_SyzComp(const ring r, BOOLEAN complete)
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
ring rAssure_Wp_C(const ring r, intvec *w)
ring rAssure_Dp_C(const ring r)
BOOLEAN rOrd_is_Totaldegree_Ordering(const ring r)
ring rAssure_SyzOrder(const ring r, BOOLEAN complete)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
void rDelete(ring r)
unconditionally deletes fields in r
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
void rSetSyzComp(int k, const ring r)
ring rAssure_dp_C(const ring r)
@ ringorder_a64
for int64 weights
@ ringorder_aa
for idElimination, like a, except pFDeg, pWeigths ignore it
#define rField_is_Ring(R)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
ideal id_Homogen(ideal h, int varnum, const ring r)
matrix id_Module2Matrix(ideal mod, const ring R)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
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
ideal id_Matrix2Module(matrix mat, const ring R)
converts mat to module, destroys mat
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
void id_Shift(ideal M, int s, const ring r)
ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring r)
ideal id_SimpleMove(ideal h1, ideal h2, const ring R)
concat the lists h1 and h2 without zeros, destroys h1,h2
long sm_ExpBound(ideal m, int di, int ra, int t, const ring currRing)
ring sm_RingChange(const ring origR, long bound)
void sm_KillModifiedRing(ring r)
void syGaussForOne(ideal syz, int elnum, int ModComp, int from, int till)
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
resolvente sySchreyerResolvente(ideal arg, int maxlength, int *length, BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE)
int name
New type name for int.
ideal t_rep_gb(const ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
THREAD_VAR double(*) wFunctional(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
void wCall(poly *s, int sl, int *x, double wNsqr, const ring R)
double wFunctionalBuch(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)