14 #include <factory/factory.h> 107 #define PLURAL_MASK 3 109 #define PLURAL_MASK 0 114 #define ZERODIVISOR_MASK 8 117 #define ZERODIVISOR_MASK 0 119 #define ALLOW_PLURAL 1 121 #define COMM_PLURAL 2 124 #define NO_ZERODIVISOR 8 125 #define ALLOW_ZERODIVISOR 0 137 Print(
"please rewrite the use of >>%s<< in >>%s<<\n" 138 "%s is depreciated or changed in Singular 4-1\n",s,
my_yylinebuf,s);
161 typedef char * (*Proc1)(
char *);
198 short number_of_args;
227 extern int iiArithAddCmd(
const char *szName,
short nAlias,
short nTokval,
228 short nToktype,
short nPos=-1);
238 #define ii_div_by_0 "div. by 0" 247 if ((
long)i==
l)
return l;
259 if (sArithBase.
sCmds[
i].tokval==op)
260 return sArithBase.
sCmds[
i].toktype;
272 int bb = (int)(
long)(v->
Data());
277 case '+': cc=
bimAdd(aa,bb);
break;
278 case '-': cc=
bimSub(aa,bb);
break;
279 case '*': cc=
bimMult(aa,bb);
break;
281 res->
data=(
char *)cc;
291 number bb = (number)(v->
Data());
298 res->
data=(
char *)cc;
308 int bb = (int)(
long)(v->
Data());
312 case '+': (*aa) += bb;
break;
313 case '-': (*aa) -= bb;
break;
314 case '*': (*aa) *= bb;
break;
317 case '%': (*aa) %= bb;
break;
319 res->
data=(
char *)aa;
329 int bb = (int)(
long)(v->
Data());
333 case '+':
for (;i>0;i--)
IMATELEM(*aa,i,i) += bb;
335 case '-':
for (;i>0;i--)
IMATELEM(*aa,i,i) -= bb;
338 res->
data=(
char *)aa;
347 int l=(int)(
long)v->
Data();
350 int d=(int)(
long)u->
Data();
353 for(i=l-1;i>=0;i--) { (*vv)[
i]=d; }
354 res->
data=(
char *)vv;
372 res->
data = (
char *) (r<0);
375 res->
data = (
char *) (r>0);
378 res->
data = (
char *) (r<=0);
381 res->
data = (
char *) (r>=0);
385 res->
data = (
char *) (r==0);
389 if(r==-2) {
WerrorS(
"size incompatible");
return TRUE; }
400 res->
data = (
char *) (r<0);
403 res->
data = (
char *) (r>0);
406 res->
data = (
char *) (r<=0);
409 res->
data = (
char *) (r>=0);
413 res->
data = (
char *) (r==0);
417 if(r==-2) {
WerrorS(
"size incompatible");
return TRUE; }
423 int b = (int)(
long)(v->
Data());
428 res->
data = (
char *) (r<0);
431 res->
data = (
char *) (r>0);
434 res->
data = (
char *) (r<=0);
437 res->
data = (
char *) (r>=0);
441 res->
data = (
char *) (r==0);
483 res->
data = (
char *) (r < 0);
486 res->
data = (
char *) (r > 0);
489 res->
data = (
char *) (r <= 0);
492 res->
data = (
char *) (r >= 0);
504 char*
a = (
char * )(u->
Data());
505 char*
b = (
char * )(v->
Data());
510 res->
data = (
char *) (result < 0);
513 res->
data = (
char *) (result > 0);
516 res->
data = (
char *) (result <= 0);
519 res->
data = (
char *) (result >= 0);
523 res->
data = (
char *) (result == 0);
547 int b=(int)(
long)u->
Data();
548 int e=(int)(
long)v->
Data();
557 else if ((e==0)||(b==1))
575 if(rc/b!=oldrc) overflow=
TRUE;
579 WarnS(
"int overflow(^), result may be wrong");
581 res->
data = (
char *)((
long)rc);
587 WerrorS(
"exponent must be non-negative");
593 int e=(int)(
long)v->
Data();
594 number n=(number)u->
Data();
601 WerrorS(
"exponent must be non-negative");
609 int e=(int)(
long)v->
Data();
610 number n=(number)u->
Data();
627 int v_i=(int)(
long)v->
Data();
630 WerrorS(
"exponent must be non-negative");
638 Werror(
"OVERFLOW in power(d=%ld, e=%d, max=%ld)",
723 if(isupper(u->
name[0]))
725 const char *c=u->
name+1;
726 while((*c!=
'\0')&&(islower(*c)||(isdigit(*c)))) c++;
731 Print(
"%s of type 'ANY'. Trying load.\n", u->
name);
759 WerrorS(
"reserved name with ::");
764 memcpy(res, v,
sizeof(
sleftv));
765 memset(v, 0,
sizeof(
sleftv));
770 WerrorS(
"<package>::<id> expected");
777 unsigned int a=(
unsigned int)(
unsigned long)u->
Data();
778 unsigned int b=(
unsigned int)(
unsigned long)v->
Data();
780 res->
data = (
char *)((
long)c);
783 WarnS(
"int overflow(+), result may be wrong");
807 WerrorS(
"intmat size not compatible");
817 WerrorS(
"bigintmat/cmatrix not compatible");
828 Werror(
"matrix size not compatible(%dx%d, %dx%d)",
851 char*
a = (
char * )(u->
Data());
852 char*
b = (
char * )(v->
Data());
853 char*
r = (
char * )
omAlloc(strlen(a) + strlen(b) + 1);
866 void *ap=u->
Data();
void *bp=v->
Data();
867 int aa=(int)(
long)ap;
868 int bb=(int)(
long)bp;
870 unsigned int a=(
unsigned int)(
unsigned long)ap;
871 unsigned int b=(
unsigned int)(
unsigned long)bp;
875 WarnS(
"int overflow(-), result may be wrong");
877 res->
data = (
char *)((
long)cc);
900 WerrorS(
"intmat size not compatible");
910 WerrorS(
"bigintmat/cmatrix not compatible");
921 Werror(
"matrix size not compatible(%dx%d, %dx%d)",
930 int a=(int)(
long)u->
Data();
931 int b=(int)(
long)v->
Data();
933 if ((c>INT_MAX)||(c<INT_MIN))
934 WarnS(
"int overflow(*), result may be wrong");
935 res->
data = (
char *)((
long)((int)c));
950 number n=(number)res->
data;
970 Warn(
"possible OVERFLOW in mult(d=%ld, d=%ld, max=%ld)",
982 Warn(
"possible OVERFLOW in mult(d=%ld, d=%ld, max=%ld)",
1017 WerrorS(
"intmat size not compatible");
1029 WerrorS(
"bigintmat/cmatrix not compatible");
1043 res->
data = (
char *)I;
1057 res->
data = (
char *)I;
1067 res->
data = (
char *)I;
1098 Werror(
"matrix size not compatible(%dx%d, %dx%d) in *",
1116 res->
data = (
char *)(
long)((int)((
long)u->
Data()) >= (
int)((long)v->
Data()));
1134 res->
data = (
char *)(
long)((int)((
long)u->
Data()) > (
int)((long)v->
Data()));
1148 res->
data = (
char *)(
long)((int)((
long)u->
Data()) <= (
int)((long)v->
Data()));
1161 res->
data = (
char *)(
long)((int)((
long)u->
Data()) < (
int)((long)v->
Data()));
1171 int a= (int)(
long)u->
Data();
1172 int b= (int)(
long)v->
Data();
1186 r=((a-c) /b);
break;
1188 res->
data=(
void *)((
long)
r);
1193 number q=(number)v->
Data();
1201 res->
data = (
char *)q;
1206 number q=(number)v->
Data();
1214 res->
data = (
char *)q;
1253 I->m[
i]=
pAdd(I->m[i],p);
1259 for(i=comps-1;i>=0;i--)
1269 res->
data=(
void *)p;
1278 WerrorS(
"division only defined over coefficient domains");
1283 WerrorS(
"division over a coefficient domain only implemented for terms");
1319 res->
data=(
char *)mm;
1330 res->
data = (
char *)((
int)((long)u->
Data()) == (
int)((long)v->
Data()));
1369 res->
data = (
char *)((
long)u->
Data() && (long)v->
Data());
1374 res->
data = (
char *)((
long)u->
Data() || (long)v->
Data());
1387 while (sh->next !=
NULL) sh=sh->next;
1403 WerrorS(
"indexed object must have a name");
1410 memset(&t,0,
sizeof(t));
1412 for (i=0;i<iv->
length(); i++)
1414 t.
data=(
char *)((
long)(*iv)[
i]);
1438 int i=(int)(
long)v->
Data();
1459 for(i=iv->
length()-1;i>=0;i--)
1462 while ((p!=
NULL) && (sum>0))
1465 for(i=iv->
length()-1;i>=0;i--)
1478 res->
data=(
char *)r;
1486 int i=(int)(
long)v->
Data();
1491 if (r==p) r=
pNext(p);
1508 res->
data=(
char *)r;
1522 for(i=0;i<iv->
length();i++)
1542 res->
data=(
char *)r;
1550 char * nn = (
char *)
omAlloc(strlen(u->
name) + 14);
1551 sprintf(nn,
"%s(%d)",u->
name,(
int)(
long)v->
Data());
1565 long slen = strlen(u->
name) + 14;
1566 char *n = (
char*)
omAlloc(slen);
1568 for (i=0;i<iv->
length(); i++)
1579 sprintf(n,
"%s(%d)",u->
name,(*iv)[i]);
1591 memset(tmp,0,
sizeof(
sleftv));
1617 tmp_proc->
id=
"_auto";
1621 d=u->
data; u->
data=(
void *)tmp_proc;
1638 if (sl)
return TRUE;
1657 memcpy(res,sl,
sizeof(
sleftv));
1666 number *
x=(number *)
omAlloc(rl*
sizeof(number));
1667 number *q=(number *)
omAlloc(rl*
sizeof(number));
1669 for(i=rl-1;i>=0;i--)
1676 for(i=rl-1;i>=0;i--)
1682 res->
data=(
char *)n;
1692 number *
x=(number *)
omAlloc(rl*
sizeof(number));
1693 number *q=(number *)
omAlloc(rl*
sizeof(number));
1695 for(i=rl-1;i>=0;i--)
1701 for(i=rl-1;i>=0;i--)
1705 Werror(
"poly expected at pos %d",i+1);
1706 for(i=rl-1;i>=0;i--)
1715 else if (
pLmCmp(r,h)==-1) r=h;
1718 for(i=rl-1;i>=0;i--)
1730 number n=n_ChineseRemainder(x,q,rl,
currRing->cf);
1731 for(i=rl-1;i>=0;i--)
1737 result=
pAdd(result,h);
1739 for(i=rl-1;i>=0;i--)
1744 res->
data=(
char *)result;
1751 int s=(int)(
long)v->
Data();
1760 ideal
M=(ideal)u->
CopyD();
1761 int s=(int)(
long)v->
Data();
1781 ideal *
x=(ideal *)
omAlloc(rl*
sizeof(ideal));
1784 int return_type=c->
m[0].
Typ();
1792 WerrorS(
"poly/ideal/module/matrix expected");
1810 for(i=rl-1;i>=0;i--)
1812 if (c->
m[i].
Typ()!=return_type)
1837 xx=(number *)
omAlloc(rl*
sizeof(number));
1838 for(i=rl-1;i>=0;i--)
1850 Werror(
"bigint expected at pos %d",i+1);
1857 number *q=(number *)
omAlloc(rl*
sizeof(number));
1860 for(i=rl-1;i>=0;i--)
1867 for(i=rl-1;i>=0;i--)
1879 Werror(
"bigint expected at pos %d",i+1);
1895 res->
data=(
char *)n;
1904 res->
data=(
char *)result->m[0];
1909 res->
data=(
char *)result;
1911 for(i=rl-1;i>=0;i--)
1916 res->
rtyp=return_type;
1917 return result==
NULL;
1947 (ideal)(v->
Data()), p);
1959 ideal I=(ideal)u->
Data();
1964 res->
data = (
char *)((
long)d);
1975 res->
data = (
char *)(d);
1978 res->
data=(
char *)(
long)(-1);
2020 ideal vid = (ideal)v->
Data();
2024 res->
data = (
char *)-1;
2033 if (i != -1)
pDelete(&vv->m[i]);
2036 res->
data = (
char *)d;
2055 ideal vi=(ideal)v->
Data();
2057 ideal ui=(ideal)u->
Data();
2091 res->
data=(
char *)L;
2128 number uu=(number)u->
Data();number vv=(number)v->
Data();
2137 res->
data=(
char *)L;
2142 int uu=(int)(
long)u->
Data();
int vv=(int)(
long)v->
Data();
2143 int p0=
ABS(uu),p1=
ABS(vv);
2144 int f0 = 1, f1 = 0, g0 = 0, g1 = 1, q,
r;
2166 res->
data=(
char *)L;
2173 if (ret)
return TRUE;
2176 res->
data=(
char *)L;
2177 L->
m[0].
data=(
void *)r;
2179 L->
m[1].
data=(
void *)pa;
2181 L->
m[2].
data=(
void *)pb;
2189 int sw=(int)(
long)dummy->
Data();
2191 if ((sw<0)||(sw>2)) fac_sw=1;
2204 l->
m[0].
data=(
void *)f;
2206 l->
m[1].
data=(
void *)v;
2207 res->
data=(
void *)l;
2212 res->
data=(
void *)f;
2225 res->
data=(
void *)p;
2239 while (p!=NULL) { p=p->next;l++; }
2245 L->
m[
l].
data=(
char *)h->d;
2252 res->
data=(
void *)L;
2259 number uu=(number)u->
Data();
2260 number vv=(number)v->
Data();
2268 ideal uu=(ideal)u->
Data();
2269 number vv=(number)v->
Data();
2276 ring
r=(ring)u->
Data();
2285 int par_perm_size=0;
2298 par_perm_size=
rPar(r);
2307 perm=(
int *)
omAlloc0((r->N+1)*
sizeof(int));
2308 if (par_perm_size!=0)
2309 par_perm=(
int *)
omAlloc0(par_perm_size*
sizeof(
int));
2314 char ** r_par_names=
NULL;
2315 if (r->cf->extRing!=
NULL)
2317 r_par=r->cf->extRing->N;
2318 r_par_names=r->cf->extRing->names;
2321 char ** c_par_names=
NULL;
2325 c_par_names=
currRing->cf->extRing->names;
2327 maFindPerm(r->names, r->N, r_par_names, r_par,
2329 perm,par_perm,
currRing->cf->type);
2334 if (par_perm_size!=0)
2344 Print(
"// var nr %d: %s -> %s\n",i,r->names[i],
currRing->names[i]);
2348 Print(
"// par nr %d: %s -> %s\n",
2354 memset(&tmpW,0,
sizeof(
sleftv));
2358 perm,par_perm,par_perm_size,nMap)))
2386 char *where=(
char *)u->
Data();
2387 char *what=(
char *)v->
Data();
2388 char *
found = strstr(where,what);
2391 res->
data=(
char *)((found-where)+1);
2404 int uu=(int)(
long)u->
Data();
int vv=(int)(
long)v->
Data();
2405 int p0=
ABS(uu),p1=
ABS(vv);
2413 res->
data=(
char *)(
long)p0;
2418 number n1 = (number) u->
Data();
2419 number n2 = (number) v->
Data();
2425 number
a=(number) u->
Data();
2426 number
b=(number) v->
Data();
2452 ring tempR =
rCopy(origR);
2457 ideal uid = (ideal)u->
Data();
2460 sleftv uuAsLeftv; memset(&uuAsLeftv, 0,
sizeof(uuAsLeftv));
2465 Print(
"// NOTE: computation of Hilbert series etc. is being\n");
2466 Print(
"// performed for generic fibre, that is, over Q\n");
2469 int returnWithTrue = 1;
2470 switch((
int)(
long)v->
Data())
2473 res->
data=(
void *)iv;
2488 if (returnWithTrue)
return TRUE;
else return FALSE;
2494 switch((
int)(long)v->
Data())
2497 res->
data=(
void *)iv;
2522 WerrorS(
"variable must have weight 1");
2544 WerrorS(
"variable must have weight 1");
2551 ideal v_id=(ideal)v->
Data();
2560 currRing->pLexOrder=save_pLexOrder;
2564 if (w!=
NULL)
delete w;
2583 const int n = L->
nr;
assume (n >= 0);
2584 std::vector<ideal> V(n + 1);
2586 for(
int i = n;
i >= 0;
i--) V[
i] = (ideal)(L->
m[
i].
Data());
2637 memset(&h,0,
sizeof(
sleftv));
2668 char *
s=(
char *)u->
Data();
2669 if(strcmp(s,
"with")==0)
2671 if (strcmp(s,
"try")==0)
2673 WerrorS(
"invalid second argument");
2674 WerrorS(
"load(\"libname\" [,option]);");
2696 ideal u_id=(ideal)u->
Data();
2697 ideal v_id=(ideal)v->
Data();
2700 if ((*w_u).compare((w_v))!=0)
2702 WarnS(
"incompatible weights");
2703 delete w_u; w_u=
NULL;
2711 WarnS(
"wrong weights");
2712 delete w_u; w_u=
NULL;
2728 number q=(number)v->
Data();
2739 number q=(number)v->
Data();
2756 char *opt=(
char *)v->
Data();
2768 if(strcmp(l->m->type,
"ASCII")!=0)
2770 Werror(
"ASCII link required, not `%s`",l->m->type);
2775 if ( l->name[0]!=
'\0')
2779 if (v==
NULL) opt=(
const char*)
"i";
2780 else opt=(
const char *)v->
Data();
2787 monitor((FILE *)l->data,mode);
2815 if(err) {
pDelete(&p);
WerrorS(
"no negative exponent allowed"); }
2829 int i=(
int)(long)v->
Data();
2837 Werror(
"par number %d out of range 1..%d",
i,p);
2847 WerrorS(
"basering must NOT be a qring!");
2868 WerrorS(
"basering must NOT be a qring!");
2889 WerrorS(
"basering must NOT be a qring!");
2910 WerrorS(
"basering must NOT be a qring!");
2949 ring
r = (ring)a->
Data();
2958 Werror(
"%s is not an opposite ring to current ring",a->
Fullname());
2964 int argtype =
IDTYP(w);
2971 res->
rtyp = argtype;
2979 res->
rtyp = argtype;
2987 res->
rtyp = argtype;
3000 res->
rtyp = argtype;
3005 WerrorS(
"unsupported type in oppose");
3029 int i=(int)(
long)u->
Data();
3030 int j=(int)(
long)v->
Data();
3031 if (j-i <0) {
WerrorS(
"invalid range for random");
return TRUE;}
3032 res->
data =(
char *)(
long)((i >
j) ? i : (
siRand() % (j-i+1)) +
i);
3038 int isRowEchelon = (int)(
long)v->
Data();
3039 if (isRowEchelon != 1) isRowEchelon = 0;
3040 int rank =
luRank(m, isRowEchelon);
3041 res->
data =(
char *)(
long)rank;
3051 if ((l!=
NULL)&&(l->name!=
NULL)) s=l->name;
3053 Werror(
"cannot read from `%s`",s);
3056 memcpy(res,r,
sizeof(
sleftv));
3062 ideal vi=(ideal)v->
Data();
3070 ideal ui=(ideal)u->
Data();
3071 ideal vi=(ideal)v->
Data();
3080 int maxl=(int)(
long)v->
Data();
3083 WerrorS(
"length for res must not be negative");
3091 ideal u_id=(ideal)u->
Data();
3100 "full resolution in a qring may be infinite, setting max length to %d",
3114 int add_row_shift=0;
3118 add_row_shift = ww->
min_in();
3119 (*ww) -= add_row_shift;
3139 (
"`lres` not implemented for inhomogeneous input or qring");
3151 (
"`kres` not implemented for inhomogeneous input or qring");
3163 (
"`hres` not implemented for inhomogeneous input or qring");
3171 res->
data=(
void *)r;
3175 if (weights!=
NULL) (*w) += add_row_shift;
3191 if (ww!=
NULL) {
delete ww; ww=
NULL; }
3197 int maxl=(int)(
long)v->
Data();
3200 WerrorS(
"length for res must not be negative");
3206 ideal u_id=(ideal)u->
Data();
3215 "full resolution in a qring may be infinite, setting max length to %d",
3229 int add_row_shift=0;
3233 add_row_shift = ww->
min_in();
3234 (*ww) -= add_row_shift;
3250 (
"`lres` not implemented for inhomogeneous input or qring");
3254 WarnS(
"the current implementation of `lres` may not work in the case of a single variable");
3264 (
"`kres` not implemented for inhomogeneous input or qring");
3276 (
"`hres` not implemented for inhomogeneous input or qring");
3279 ideal u_id_copy=
idCopy(u_id);
3281 r=
syHilb(u_id_copy,&dummy);
3287 res->
data=(
void *)r;
3288 if ((weights!=
NULL) && (ww!=
NULL)) {
delete ww; ww=
NULL; }
3292 if (weights!=
NULL) (*ww) += add_row_shift;
3322 n1 = (number)u->
CopyD();
3326 i = (int)(
long)u->
Data();
3334 i = (int)(
long)v->
Data();
3338 res->
data = (
char*)l;
3345 res->
data = (
char *)r;
3348 #define SIMPL_LMDIV 32 3349 #define SIMPL_LMEQ 16 3350 #define SIMPL_MULT 8 3352 #define SIMPL_NULL 2 3353 #define SIMPL_NORM 1 3356 int sw = (int)(
long)v->
Data();
3383 res->
data = (
char * )
id;
3390 int sw=(int)(
long)dummy->
Data();
3405 l->
m[0].
data=(
void *)f;
3407 l->
m[1].
data=(
void *)v;
3408 res->
data=(
void *)l;
3413 res->
data=(
void *)f;
3426 res->
data=(
void *)p;
3447 int sw = (int)(
long)v->
Data();
3454 res->
data = (
char * )p;
3462 ideal u_id=(ideal)(u->
Data());
3478 res->
data = (
char *)result;
3487 ideal i1=(ideal)(u->
Data());
3525 res->
data = (
char *)result;
3529 i0=(ideal)v->
CopyD();
3568 res->
data = (
char *)result;
3576 int i=(
int)(long)v->
Data();
3597 int t = (int)(
long)v->
Data();
3607 res->
data = (
void*)(
long)
i;
3622 int timeout = 1000*(int)(
long)v->
Data();
3630 for(
int nfinished = 0; nfinished < Lforks->
nr+1; nfinished++)
3655 res->
data = (
void*)(
long)ret;
3663 #define jjWRONG2 (proc2)jjWRONG 3664 #define jjWRONG3 (proc3)jjWRONG 3709 res->
data = (
char *)n;
3714 res->
data = (
char *)(-(
long)u->
Data());
3721 res->
data = (
char *)n;
3739 res->
data = (
char *)iv;
3746 res->
data = (
char *)bim;
3764 l->m[0].data=(
void *)m;
3765 l->m[1].data=(
void *)iv;
3766 res->
data = (
char *)l;
3779 number n=(number)u->
CopyD();
3803 number n=(number) tmp.
data;
3841 res->
data = (
char *)p;
3873 ring
r=(ring)v->
Data();
3878 extern int ipower (
int b,
int n );
3879 elems=
ipower(r->cf->ch,r->cf->extRing->pFDeg(r->cf->extRing->qideal->m[0],r->cf->extRing));
3881 res->
data = (
char *)(
long)elems;
3889 else res->
data=(
char *)-1;
3894 ideal I=(ideal)u->
Data();
3900 res->
data = (
char *)(
long)d;
3910 ring tempR =
rCopy(origR);
3915 ideal vid = (ideal)v->
Data();
3918 sleftv vvAsLeftv; memset(&vvAsLeftv, 0,
sizeof(vvAsLeftv));
3923 Print(
"// NOTE: computation of degree is being performed for\n");
3924 Print(
"// generic fibre, that is, over Q\n");
3948 else if (v->
rtyp!=0) res->
data=(
void *)(-1);
3956 number n =
reinterpret_cast<number
>(v->
Data());
3965 number n =
reinterpret_cast<number
>(v->
Data());
3982 res ->
data = (
char *)p;
3994 Werror(
"det of %d x %d bigintmat",i,j);
4008 Werror(
"det of %d x %d intmat",i,j);
4015 ideal I=(ideal)v->
Data();
4026 res->
data = (
char *)p;
4041 ideal vid = (ideal)v->
Data();
4045 res->
data = (
char *)-1;
4052 if (i != -1)
pDelete(&vv->m[i]);
4055 res->
data = (
char *)d;
4071 if ((l!=
NULL)&&(l->name!=
NULL)) s=l->name;
4073 Werror(
"cannot dump to `%s`",s);
4082 int co=(int)(
long)v->
Data();
4088 else WerrorS(
"argument of gen must be positive");
4093 char * d = (
char *)v->
Data();
4094 char *
s = (
char *)
omAlloc(strlen(d) + 13);
4095 strcpy( s, (
char *)d);
4096 strcat( s,
"\n;RETURN();\n");
4117 while (p!=
NULL) { p=p->next;l++; }
4122 L->
m[
l].
data=(
char *)h->d;
4133 WarnS(
"no factorization implemented");
4137 res->
data=(
void *)L;
4150 l->
m[0].
data=(
void *)f;
4152 l->
m[1].
data=(
void *)v;
4153 res->
data=(
void *)l;
4162 if ((l!=
NULL)&&(l->name!=
NULL)) s=l->name;
4164 Werror(
"cannot get dump from `%s`",s);
4173 ideal I=(ideal)v->
Data();
4182 ideal I=(ideal)v->
Data();
4196 WerrorS(
"module must be zero-dimensional");
4197 if (delete_w)
delete w;
4220 if (delete_w)
delete w;
4221 res->
data=(
void *)po;
4230 ring tempR =
rCopy(origR);
4235 ideal vid = (ideal)v->
Data();
4238 sleftv vvAsLeftv; memset(&vvAsLeftv, 0,
sizeof(vvAsLeftv));
4243 Print(
"// NOTE: computation of Hilbert series etc. is being\n");
4244 Print(
"// performed for generic fibre, that is, over Q\n");
4265 Print(
"// NOTE: computation of Hilbert series etc. is being\n");
4266 Print(
"// performed for generic fibre, that is, over Q\n");
4275 ideal v_id=(ideal)v->
Data();
4283 char *s_isHomog=
omStrDup(
"isHomog");
4289 else if (w!=
NULL)
delete w;
4326 res->
data=(
char *)mat;
4336 res->
data=(
char *)I;
4343 ring q=(ring)v->
Data();
4346 if (q->qideal==
NULL)
4353 WerrorS(
"can only get ideal from identical qring");
4379 Warn(
"interred: this command is experimental over the integers");
4398 res->
data = (
char *)0;
4408 i->m[k-1]=
pDiff(p,k);
4410 res->
data = (
char *)i;
4417 WerrorS(
"differentiation not defined in the coefficient ring");
4420 number n = (number) u->
Data();
4421 number
k = (number) v->
Data();
4434 ideal
id = (ideal)a->
Data();
4439 poly *
p = result->m;
4441 for(
int v = 1; v <=
currRing->N; v++ )
4444 for(
int i = 0;
i < W;
i++, p++, q++ )
4445 *p =
pDiff( *q, v );
4449 res->
data = (
char *)result;
4496 res->
data=(
char *)iv;
4510 res->
data = (
char*) lm;
4523 res->
data=(
char *)r;
4531 memset(&tmp, 0,
sizeof(tmp));
4547 WerrorS(
"matrix must be constant");
4561 res->
data=(
char*)ll;
4568 switch(((
int)(
long)v->
Data()))
4583 res->
data = (
char *)0;
4587 res->
data = (
char *)0;
4602 l->m[0].data=(
char *)r;
4605 l->m[1].data=(
char *)m;
4606 res->
data=(
char *)l;
4622 res->
data=(
char *)tmp;
4631 number n,
i; i=(number)v->
Data();
4636 res->
data=(
void *)n;
4660 res->
data=(
char*)(
long)((long)v->
Data()==0 ? 1 : 0);
4665 res->
data = (
char *)(
long)(((ring)(v->
Data()))->N);
4682 int i=(int)(
long)v->
Data();
4685 if ((0<i) && (i<=p))
4691 Werror(
"par number %d out of range 1..%d",i,p);
4698 number nn=(number)v->
Data();
4709 int i=(int)(
long)v->
Data();
4715 Werror(
"par number %d out of range 1..%d",i,p);
4726 WerrorS(
"poly must be constant");
4735 res->
data=(
void *)n;
4746 WerrorS(
"poly must be constant");
4761 res->
data = (
char *)(
long)(i > 1 ? i : 2);
4767 ideal v_id=(ideal)v->
Data();
4772 WarnS(
"wrong weights");
4801 res->
data = (
char *)n;
4806 char *
s= (
char *)v->
Data();
4808 for(i=0; i<sArithBase.
nCmdUsed; i++)
4811 if (strcmp(s, sArithBase.
sCmds[i].name) == 0)
4813 res->
data = (
char *)1;
4824 res->
data =(
char *)(
long)rank;
4843 ring
r=(ring)v->
Data();
4859 ideal
i = (ideal)v->
Data();
4860 res->
data = (
char *)i->rank;
4883 const bool bIsSCA =
false;
4888 WerrorS(
"qring not supported by slimgb at the moment");
4893 WerrorS(
"ordering must be global for slimgb");
4898 ideal u_id=(ideal)u->
Data();
4903 WarnS(
"wrong weights");
4925 ideal v_id=(ideal)v->
Data();
4932 WarnS(
"wrong weights");
4943 res->
data = (
char *)result;
4951 ideal v_id=(ideal)v->
Data();
4958 WarnS(
"wrong weights");
4969 res->
data = (
char *)result;
4977 ideal v_id=(ideal)v->
Data();
4984 WarnS(
"wrong weights");
4995 res->
data = (
char *)result;
5003 ideal v_id=(ideal)v->
Data();
5010 WarnS(
"wrong weights");
5021 res->
data = (
char *)result;
5041 l->
m[0].
data=(
void *)f;
5043 l->
m[1].
data=(
void *)v;
5044 res->
data=(
void *)l;
5052 if (w!=
NULL)
delete w;
5061 ideal v_id=(ideal)v->
Data();
5063 int add_row_shift=0;
5067 add_row_shift=w->
min_in();
5068 (*w)-=add_row_shift;
5104 ring
r = (ring)a->
Data();
5112 WarnS(
"opposite only for global orderings");
5119 ring
r = (ring)a->
Data();
5152 int t=(int)(
long)v->
data;
5202 int i=(int)(
long)v->
Data();
5203 if ((0<i) && (i<=currRing->
N))
5208 res->
data=(
char *)p;
5224 int i=(int)(
long)v->
Data();
5225 if ((0<i) && (i<=currRing->
N))
5252 res->
data = (
void*)(
long)
i;
5265 for(
int nfinished = 0; nfinished < Lforks->
nr+1; nfinished++)
5281 res->
data = (
void*)(
long)
j;
5291 #ifdef HAVE_DYNAMIC_LOADING 5298 Werror(
"%s: unknown type", s);
5301 Werror(
"cannot open %s", s);
5316 Werror(
"can not create package `%s`",plib);
5320 package savepack=currPack;
5323 char libnamebuf[256];
5336 #ifdef HAVE_DYNAMIC_LOADING 5339 WerrorS(
"Dynamic modules are not supported by this version of Singular");
5348 WerrorS_dummy_cnt++;
5354 WerrorS_dummy_cnt=0;
5357 Print(
"loading of >%s< failed\n",s);
5365 res->
data = (
char *)strlen((
char *)v->
Data());
5473 number n=(number)u->
CopyD();
5480 number n=(number)u->
Data();
5489 char *s= (
char *)u->
Data();
5490 int r = (int)(
long)v->
Data();
5491 int c = (int)(
long)w->
Data();
5494 if ( (r<1) || (r>l) || (c<0) )
5500 sprintf((
char *)res->
data,
"%-*.*s",c,c,s+r-1);
5506 int r = (int)(
long)v->
Data();
5507 int c = (int)(
long)w->
Data();
5508 if ((r<1)||(r>iv->
rows())||(c<1)||(c>iv->
cols()))
5510 Werror(
"wrong range[%d,%d] in intmat %s(%d x %d)",
5519 if (u->
e==
NULL) res->
e=e;
5523 while (h->next!=
NULL) h=h->next;
5533 int r = (int)(
long)v->
Data();
5534 int c = (int)(
long)w->
Data();
5535 if ((r<1)||(r>bim->
rows())||(c<1)||(c>bim->
cols()))
5537 Werror(
"wrong range[%d,%d] in bigintmat %s(%d x %d)",
5551 while (h->next!=
NULL) h=h->next;
5561 int r = (int)(
long)v->
Data();
5562 int c = (int)(
long)w->
Data();
5566 Werror(
"wrong range[%d,%d] in matrix %s(%d x %d)",r,c,u->
Fullname(),
5580 while (h->next!=
NULL) h=h->next;
5598 WerrorS(
"cannot build expression lists from unnamed objects");
5601 memcpy(&ut,u,
sizeof(ut));
5602 memset(&t,0,
sizeof(t));
5604 for (l=0;l< iv->
length(); l++)
5606 t.
data=(
char *)(
long)((*iv)[
l]);
5616 memcpy(u,&ut,
sizeof(ut));
5648 WerrorS(
"cannot build expression lists from unnamed objects");
5651 memcpy(&ut,u,
sizeof(ut));
5652 memset(&t,0,
sizeof(t));
5654 for (l=0;l< iv->
length(); l++)
5656 t.
data=(
char *)(
long)((*iv)[
l]);
5666 memcpy(u,&ut,
sizeof(ut));
5699 WerrorS(
"cannot build expression lists from unnamed objects");
5702 memcpy(&ut,u,
sizeof(ut));
5703 memset(&t1,0,
sizeof(
sleftv));
5704 memset(&t2,0,
sizeof(
sleftv));
5707 for (vl=0;vl< vv->
length(); vl++)
5709 t1.
data=(
char *)(
long)((*vv)[vl]);
5710 for (wl=0;wl< wv->
length(); wl++)
5712 t2.
data=(
char *)(
long)((*wv)[wl]);
5722 memcpy(u,&ut,
sizeof(ut));
5742 memset(w,0,
sizeof(
sleftv));
5750 int k=(int)(
long)w->
Data();
5757 l->
m[0].
data=(
void *)m;
5758 l->
m[1].
data=(
void *)iv;
5765 l->
m[0].
data=(
void *)m;
5767 res->
data = (
char *)l;
5774 WerrorS(
"3rd argument must be a name of a matrix");
5777 ideal
i=(ideal)u->
Data();
5778 int rank=(int)i->rank;
5794 WerrorS(
"3rd argument must be a name of a matrix");
5802 memset(&t,0,
sizeof(t));
5832 int n=(int)(
long)w->
Data();
5833 char *where=(
char *)u->
Data();
5834 char *what=(
char *)v->
Data();
5836 if ((1>n)||(n>(
int)strlen(where)))
5838 Werror(
"start position %d out of range",n);
5841 found = strchr(where+n-1,*what);
5842 if (*(what+1)!=
'\0')
5844 while((found !=
NULL) && (strncmp(found+1,what+1,strlen(what+1))!=0))
5846 found=strchr(found+1,*what);
5851 res->
data=(
char *)((found-where)+1);
5857 if ((
int)(
long)w->
Data()==0)
5869 Werror(
"weight vector must have size %d, not %d",
5877 ring tempR =
rCopy(origR);
5882 ideal uid = (ideal)u->
Data();
5885 sleftv uuAsLeftv; memset(&uuAsLeftv, 0,
sizeof(uuAsLeftv));
5890 Print(
"// NOTE: computation of Hilbert series etc. is being\n");
5891 Print(
"// performed for generic fibre, that is, over Q\n");
5894 int returnWithTrue = 1;
5895 switch((
int)(
long)v->
Data())
5898 res->
data=(
void *)iv;
5913 if (returnWithTrue)
return TRUE;
else return FALSE;
5919 switch((
int)(long)v->
Data())
5922 res->
data=(
void *)iv;
5948 WerrorS(
"variable must have weight 1");
5966 WerrorS(
"variable must have weight 1");
5977 (*im)[
i] = (*arg)[
i];
5980 res->
data = (
char *)im;
5994 WerrorS(
"2nd argument must be a unit");
6010 WerrorS(
"2nd argument must be a diagonal matrix of units");
6081 const int mk = (
const int)(
long)u->
Data();
6082 bool noIdeal =
true;
bool noK =
true;
bool noAlgorithm =
true;
6083 bool noCacheMinors =
true;
bool noCacheMonomials =
true;
6084 ideal IasSB;
int k;
char* algorithm;
int cacheMinors;
int cacheMonomials;
6100 noAlgorithm =
false;
6105 noCacheMinors =
false;
6111 noCacheMonomials =
false;
6125 noAlgorithm =
false;
6130 noCacheMinors =
false;
6135 noCacheMonomials =
false;
6142 algorithm = (
char*)u->
next->
Data();
6143 noAlgorithm =
false;
6147 noCacheMinors =
false;
6152 noCacheMonomials =
false;
6160 if (strcmp(algorithm,
"bareiss") == 0)
6161 algorithm = (
char*)
"Bareiss";
6162 if (strcmp(algorithm,
"laplace") == 0)
6163 algorithm = (
char*)
"Laplace";
6164 if (strcmp(algorithm,
"cache") == 0)
6165 algorithm = (
char*)
"Cache";
6174 if ((!noK) && (k == 0))
6176 WerrorS(
"Provided number of minors to be computed is zero.");
6179 if ((!noAlgorithm) && (strcmp(algorithm,
"Bareiss") != 0)
6180 && (strcmp(algorithm,
"Laplace") != 0)
6181 && (strcmp(algorithm,
"Cache") != 0))
6183 WerrorS(
"Expected as algorithm one of 'B/bareiss', 'L/laplace', or 'C/cache'.");
6186 if ((!noAlgorithm) && (strcmp(algorithm,
"Bareiss") == 0)
6189 Werror(
"Bareiss algorithm not defined over coefficient rings %s",
6190 "with zero divisors.");
6194 if ((mk < 1) || (mk > m->
rows()) || (mk > m->
cols()))
6203 if ((!noAlgorithm) && (strcmp(algorithm,
"Cache") == 0)
6204 && (noCacheMinors || noCacheMonomials))
6207 cacheMonomials = 100000;
6213 (noIdeal ? 0 : IasSB),
false);
6214 else if (strcmp(algorithm,
"Cache") == 0)
6216 (noIdeal ? 0 : IasSB), 3, cacheMinors,
6217 cacheMonomials,
false);
6220 (noIdeal ? 0 : IasSB),
false);
6230 (
const char *)w->
Data());
6244 WerrorS(
"2nd/3rd arguments must have names");
6248 const char *ring_name=u->
Name();
6255 if ((preim_ring==
NULL)
6258 Werror(
"preimage ring `%s` is not the basering",mapping->preimage);
6274 Werror(
"`%s` is not defined in `%s`",v->
name,ring_name);
6278 if (kernel_cmd) image=
idInit(1,1);
6295 Werror(
"`%s` is not defined in `%s`",w->
name,ring_name);
6302 WarnS(
"preimage in local qring may be wrong: use Ring::preimageLoc instead");
6311 int i=(int)(
long)u->
Data();
6312 int r=(int)(
long)v->
Data();
6313 int c=(int)(
long)w->
Data();
6314 if ((r<=0) || (c<=0))
return TRUE;
6325 for (k=0; k<iv->
length(); k++)
6327 (*iv)[
k] = ((
siRand() % di) - i);
6330 res->
data = (
char *)iv;
6338 if ((cf==
NULL) ||(cf->cfRandom==
NULL))
6340 Werror(
"no random function defined for coeff %d",cf->type);
6346 number2 nn=(number2)
omAlloc(
sizeof(*nn));
6356 int &ringvar,
poly &monomexpr)
6363 Werror(
"`%s` substitutes a ringvar only by a term",
6368 if ((ringvar=
pVar(p))==0)
6377 WerrorS(
"ringvar/par expected");
6388 if (nok)
return TRUE;
6414 if (nok)
return TRUE;
6415 ideal
id=(ideal)u->
Data();
6419 if (monomexpr!=
NULL)
6434 Warn(
"possible OVERFLOW in subst, max exponent is %ld",
currRing->bitmask/2);
6464 memset(&tmp,0,
sizeof(tmp));
6473 int mi=(int)(
long)v->
Data();
6474 int ni=(int)(
long)w->
Data();
6477 Werror(
"converting ideal to matrix: dimensions must be positive(%dx%d)",mi,ni);
6488 memcpy(m->
m,I->m,i*
sizeof(
poly));
6489 memset(I->m,0,i*
sizeof(
poly));
6491 res->
data = (
char *)m;
6496 int mi=(int)(
long)v->
Data();
6497 int ni=(int)(
long)w->
Data();
6500 Werror(
"converting module to matrix: dimensions must be positive(%dx%d)",mi,ni);
6509 int mi=(int)(
long)v->
Data();
6510 int ni=(int)(
long)w->
Data();
6513 Werror(
"converting matrix to matrix: dimensions must be positive(%dx%d)",mi,ni);
6530 res->
data = (
char *)m;
6554 &(hw->data.uideal));
6563 Werror(
"`%s` must be 0-dimensional",v->
Name());
6575 Werror(
"`%s` must be 0-dimensional",v->
Name());
6586 0,(int)(
long)w->
Data());
6593 0,(int)(
long)w->
Data());
6599 int maxl=(int)v->
Data();
6600 ideal u_id=(ideal)u->
Data();
6616 WarnS(
"wrong weights");
6644 yes = (strcmp((
char *) res->
data, (
char *) w->
Data()) == 0);
6646 res->
data = (
void *)(
long)yes;
6660 ideal u_id=(ideal)(u->
Data());
6665 WarnS(
"wrong weights");
6682 res->
data = (
char *)result;
6768 WarnS(
"<module>,<module>,<int>[,<intvec>] expected!");
6775 ideal
P=(ideal)w1.
Data();
6776 ideal
Q=(ideal)w2.
Data();
6778 int n=(int)(
long)v3->
Data();
6785 while( (i > 0) && ((*w0) > 0) )
6791 WarnS(
"not all weights are positive!");
6805 L->
m[1].
rtyp=v1->Typ();
6810 L->
m[1].
data=(
void *)R->m[0];
6819 L->
m[1].
data=(
void *)R;
6822 L->
m[0].
data=(
char *)T;
6888 number
b=(number)h->
Data();
6944 res->
data=(
char *)
id;
6949 ring
r=(ring)u->
Data();
6957 WerrorS(
"fetch(<ring>,<name>[,<intvec>[,<intvec>])");
6962 if (perm_par_l!=
NULL)
6971 int par_perm_size=0;
6984 par_perm_size=
rPar(r);
6992 par_perm_size=
rPar(r);
6994 if (par_perm_size!=0)
6995 par_perm=(
int *)
omAlloc0(par_perm_size*
sizeof(
int));
6997 if (perm_par_l==
NULL)
6999 if (par_perm_size!=0)
7004 if (par_perm_size==0)
WarnS(
"source ring has no parameters");
7007 for(i=
rPar(r)-1;i>=0;i--)
7009 if (i<perm_par_v->length()) par_perm[
i]=(*perm_par_v)[
i];
7013 Warn(
"invalid entry for par %d: %d\n",i,par_perm[i]);
7019 for(i=
rVar(r)-1;i>=0;i--)
7021 if (i<perm_var_v->length()) perm[i+1]=(*perm_var_v)[
i];
7025 Warn(
"invalid entry for var %d: %d\n",i,perm[i]);
7034 Print(
"// var nr %d: %s -> var %s\n",i,r->names[i-1],
currRing->names[perm[i]-1]);
7040 if (par_perm[i-1]<0)
7041 Print(
"// par nr %d: %s -> par %s\n",
7043 else if (par_perm[i-1]>0)
7044 Print(
"// par nr %d: %s -> var %s\n",
7050 memset(&tmpW,0,
sizeof(
sleftv));
7054 perm,par_perm,par_perm_size,nMap)))
7109 WerrorS(
"cannot convert to ideal or module");
7120 r[
i]=(ideal)h->
Data();
7132 r[
i]=(ideal)tmp.
Data();
7164 matrix iMat;
int invertible;
7170 int rr = aMat->
rows();
7171 int cc = aMat->
cols();
7174 Werror(
"given matrix (%d x %d) is not quadratic, hence not invertible", rr, cc);
7179 WerrorS(
"matrix must be constant");
7189 int rr = uMat->
rows();
7190 int cc = uMat->
cols();
7193 Werror(
"third matrix (%d x %d) is not quadratic, hence not invertible",
7202 WerrorS(
"matricesx must be constant");
7209 Werror(
"expected either one or three matrices");
7227 res->
data=(
char*)ll;
7251 WerrorS(
"expected exactly three matrices and one vector as input");
7261 Werror(
"first matrix (%d x %d) is not quadratic",
7267 Werror(
"second matrix (%d x %d) is not quadratic",
7273 Werror(
"second matrix (%d x %d) and third matrix (%d x %d) do not fit",
7279 Werror(
"third matrix (%d x %d) and vector (%d x 1) do not fit",
7288 WerrorS(
"matrices must be constant");
7308 res->
data=(
char*)ll;
7322 (*iv)[
i]=(int)(
long)h->
Data();
7341 res->
data=(
char *)iv;
7358 WerrorS(
"2nd argument must be a unit");
7371 WerrorS(
"2nd argument must be a diagonal matrix of units");
7376 (
int)(long)u3->
Data(),
7385 Werror(
"%s(`poly`,`poly`,`int`,`intvec`) exppected",
7393 && ((strcmp(u->
Name(),
"real")==0) || (strcmp(u->
Name(),
"complex")==0)))
7395 memcpy(res,u,
sizeof(
sleftv));
7396 memset(u,0,
sizeof(
sleftv));
7418 int add_row_shift = 0;
7420 if (weights!=
NULL) add_row_shift=weights->
min_in();
7453 ((ring)L->
m[i].
data)->ref++;
7459 res->
data=(
char *)L;
7506 WerrorS(
"2nd argument must be a diagonal matrix of units");
7514 (
int)(long)u4->
Data()
7525 WerrorS(
"2nd argument must be a unit");
7552 WerrorS(
"2nd argument must be a diagonal matrix of units");
7560 (
int)(long)u4->
Data(),
7572 WerrorS(
"2nd argument must be a unit");
7583 Werror(
"%s(`ideal`,`ideal`,`matrix`,`int`,`intvec`) exppected",
7591 int nCount = (sArithBase.
nCmdUsed-1)/3;
7592 if((3*nCount)<sArithBase.
nCmdUsed) nCount++;
7595 for(i=0; i<nCount; i++)
7599 Print(
"%-20s",sArithBase.
sCmds[i+1+nCount].name);
7600 if(i+1+2*nCount<sArithBase.
nCmdUsed)
7601 Print(
"%-20s",sArithBase.
sCmds[i+1+2*nCount].name);
7623 char** slist = (
char**)
omAlloc(n*
sizeof(
char*));
7626 for (i=0, j=0; i<n; i++, v = v ->
next)
7628 slist[
i] = v->String();
7630 j+=strlen(slist[i]);
7632 char* s = (
char*)
omAlloc((j+1)*
sizeof(char));
7636 strcat(s, slist[i]);
7656 #if defined(__alpha) && !defined(linux) 7659 void usleep(
unsigned long usec);
7688 leftv u =
v;
int factorsGiven = 0;
7691 WerrorS(
"expected arguments (poly, int [, poly, poly] [, int, int])");
7698 WerrorS(
"expected arguments (poly, int [, poly, poly] [, int, int])");
7701 else d = (int)(
long)u->
Data();
7707 WerrorS(
"expected arguments (poly, int [, poly, poly] [, int, int])");
7722 WerrorS(
"expected arguments (poly, int [, poly, poly] [, int, int])");
7727 xIndex = (int)(
long)u->
Data();
7728 yIndex = (int)(
long)u->
next->
Data();
7734 WerrorS(
"expected arguments (poly, int [, poly, poly] [, int, int])");
7741 WerrorS(
"expected non-constant polynomial argument(s)");
7745 if ((xIndex < 1) || (n < xIndex))
7747 Werror(
"index for variable x (%d) out of range [1..%d]", xIndex, n);
7750 if ((yIndex < 1) || (n < yIndex))
7752 Werror(
"index for variable y (%d) out of range [1..%d]", yIndex, n);
7755 if (xIndex == yIndex)
7757 WerrorS(
"expected distinct indices for variables x and y");
7762 if (factorsGiven == 0)
7776 WerrorS(
"expected h(0,y) to have exactly two distinct monic factors");
7791 res->
data = (
char*)L;
7802 #if defined(HAVE_USLEEP) 7803 if (((
long) res->
data) == 0L)
7812 #elif defined(HAVE_SLEEP) 7813 if (((
int) res->
data) == 0)
7818 si_sleep((is - 1)/1000000 + 1);
7837 if ((rest!=
NULL) && (!b))
7842 memset(&tmp_res,0,
sizeof(tmp_res));
7844 memcpy(res,&tmp_res,
sizeof(tmp_res));
7859 WerrorS(
"expected (matrix, number, number, number) as arguments");
7864 (number)(v->
Data()),
7865 (number)(w->
Data()),
7866 (number)(x->
Data()));
7876 ideal i1=(ideal)(u->
Data());
7882 WerrorS(
"expected `std(`ideal/module`,`poly/vector`,`intvec`,`intvec`)");
7902 i0=(ideal)v->
Data();
7906 WerrorS(
"expected `std(`ideal/module`,`poly/vector`,`intvec`,`intvec`)");
7923 WarnS(
"wrong weights");
7946 res->
data = (
char *)result;
7957 r->start =(int)(
long)e->
Data();
7961 #define NULL_VAL NULL 7965 #include "iparith.inc" 7977 memset(res,0,
sizeof(
sleftv));
7984 while (dA2[i].
cmd==op)
7986 if ((at==dA2[i].arg1)
7987 && (bt==dA2[i].arg2))
8004 if ((call_failed=dA2[i].
p(res,a,b)))
8024 while (dA2[i].
cmd==op)
8047 failed= ((
iiConvert(at,dA2[i].arg1,ai,a,an))
8049 || (call_failed=dA2[i].
p(res,an,bn)));
8089 Werror(
"`%s` is not defined",s);
8096 Werror(
"%s(`%s`,`%s`) failed" 8101 Werror(
"`%s` %s `%s` failed" 8106 while (dA2[i].
cmd==op)
8108 if(((at==dA2[i].arg1)||(bt==dA2[i].arg2))
8113 Werror(
"expected %s(`%s`,`%s`)" 8116 Werror(
"expected `%s` %s `%s`" 8145 memset(res,0,
sizeof(
sleftv));
8154 memcpy(&d->arg1,a,
sizeof(
sleftv));
8156 memcpy(&d->arg2,b,
sizeof(
sleftv));
8160 res->
data=(
char *)d;
8173 if (!bb->blackbox_Op2(op,res,a,b))
return FALSE;
8179 else if ((bt>
MAX_TOK)&&(op!=
'('))
8184 if(!bb->blackbox_Op2(op,res,a,b))
return FALSE;
8204 memset(res,0,
sizeof(
sleftv));
8212 while (dA1[i].
cmd==op)
8231 if ((call_failed=dA1[i].
p(res,a)))
8251 while (dA1[i].
cmd==op)
8272 failed= ((
iiConvert(at,dA1[i].arg,ai,a,an,dConvertTypes))
8273 || (call_failed=dA1[i].
p(res,an)));
8314 while (dA1[i].
cmd==op)
8318 Werror(
"expected %s(`%s`)" 8332 memset(res,0,
sizeof(
sleftv));
8341 memcpy(&d->arg1,a,
sizeof(
sleftv));
8345 res->
data=(
char *)d;
8358 res->
data=bb->blackbox_Init(bb);
8359 if(!bb->blackbox_Assign(res,a))
return FALSE;
8369 if(!bb->blackbox_Op1(op,res,a))
return FALSE;
8389 struct sValCmd3* dA3,
int at,
int bt,
int ct,
8392 memset(res,0,
sizeof(
sleftv));
8401 while (dA3[i].
cmd==op)
8403 if ((at==dA3[i].arg1)
8404 && (bt==dA3[i].arg2)
8405 && (ct==dA3[i].arg3))
8413 Print(
"call %s(%s,%s,%s)\n",
8415 if ((call_failed=dA3[i].
p(res,a,b,c)))
8436 while (dA3[i].
cmd==op)
8450 Print(
"call %s(%s,%s,%s)\n",
8453 failed= ((
iiConvert(at,dA3[i].arg1,ai,a,an,dConvertTypes))
8454 || (
iiConvert(bt,dA3[i].arg2,bi,b,bn,dConvertTypes))
8455 || (
iiConvert(ct,dA3[i].arg3,ci,c,cn,dConvertTypes))
8456 || (call_failed=dA3[i].
p(res,an,bn,cn)));
8507 Werror(
"`%s` is not defined",s);
8513 Werror(
"%s(`%s`,`%s`,`%s`) failed" 8517 while (dA3[i].
cmd==op)
8519 if(((at==dA3[i].arg1)
8521 ||(ct==dA3[i].arg3))
8524 Werror(
"expected %s(`%s`,`%s`,`%s`)" 8544 memset(res,0,
sizeof(
sleftv));
8553 memcpy(&d->arg1,a,
sizeof(
sleftv));
8555 memcpy(&d->arg2,b,
sizeof(
sleftv));
8557 memcpy(&d->arg3,c,
sizeof(
sleftv));
8561 res->
data=(
char *)d;
8573 if(!bb->blackbox_Op3(op,res,a,b,c))
return FALSE;
8621 if(v==
NULL)
return failed;
8632 memset(res,0,
sizeof(
sleftv));
8642 res->
data=(
char *)d;
8647 memcpy(&d->arg1,a,
sizeof(
sleftv));
8682 if(!bb->blackbox_OpM(op,res,a))
return FALSE;
8697 if ((args==
dArithM[i].number_of_args)
8698 || (
dArithM[i].number_of_args==-1)
8699 || ((
dArithM[i].number_of_args==-2)&&(args>0)))
8728 Werror(
"%s(...) failed",s);
8750 if (strcmp(n, sArithBase.
sCmds[an].name) == 0)
8755 else if ((an!=en) && (strcmp(n, sArithBase.
sCmds[en].name) == 0))
8768 if (*n < *(sArithBase.
sCmds[i].name))
8772 else if (*n > *(sArithBase.
sCmds[i].name))
8778 int v=strcmp(n,sArithBase.
sCmds[i].name);
8794 tok=sArithBase.
sCmds[
i].tokval;
8795 if(sArithBase.
sCmds[i].alias==2)
8797 Warn(
"outdated identifier `%s` used - please change your code",
8798 sArithBase.
sCmds[i].name);
8799 sArithBase.
sCmds[
i].alias=1;
8836 return sArithBase.
sCmds[
i].toktype;
8848 if (op==dArithTab[p].
cmd)
return dArithTab[
p].start;
8849 if (op<dArithTab[p].cmd) e=p-1;
8865 return sArithBase.
sCmds[0].name;
8867 if (tok==
ANY_TYPE)
return "any_type";
8868 if (tok==
COMMAND)
return "command";
8869 if (tok==
NONE)
return "nothing";
8876 if (tok==
IDHDL)
return "identifier";
8883 for(i=0; i<sArithBase.
nCmdUsed; i++)
8886 if ((sArithBase.
sCmds[i].tokval == tok)&&
8887 (sArithBase.
sCmds[i].alias==0))
8889 return sArithBase.
sCmds[
i].name;
8893 for(i=0; i<sArithBase.
nCmdUsed; i++)
8895 if (sArithBase.
sCmds[i].tokval == tok)
8897 return sArithBase.
sCmds[
i].name;
8900 return sArithBase.
sCmds[0].name;
8916 cmdnames *pCmdL = (cmdnames*)a;
8917 cmdnames *pCmdR = (cmdnames*)b;
8922 if(pCmdL->name==
NULL)
return 1;
8923 if(pCmdR->name==
NULL)
return -1;
8926 if(strcmp(pCmdL->name,
"$INVALID$")==0)
return -1;
8927 if(strcmp(pCmdR->name,
"$INVALID$")==0)
return 1;
8930 if (pCmdL->tokval==-1)
8932 if (pCmdR->tokval==-1)
8933 return strcmp(pCmdL->name, pCmdR->name);
8938 if(pCmdR->tokval==-1)
return -1;
8940 return strcmp(pCmdL->name, pCmdR->name);
8954 memset(&sArithBase, 0,
sizeof(sArithBase));
8997 if (strcmp(szName, sArithBase.
sCmds[an].name) == 0)
9002 else if (strcmp(szName, sArithBase.
sCmds[en].name) == 0)
9014 if (*szName < *(sArithBase.
sCmds[i].name))
9018 else if (*szName > *(sArithBase.
sCmds[i].name))
9024 v=strcmp(szName,sArithBase.
sCmds[i].name);
9048 if(nPos<0)
return NULL;
9050 return sArithBase.
sCmds[nPos].name;
9057 if(szName==
NULL)
return -1;
9060 if(nIndex<0 || nIndex>=sArithBase.
nCmdUsed)
9062 Print(
"'%s' not found (%d)\n", szName, nIndex);
9067 qsort(sArithBase.
sCmds, sArithBase.
nCmdUsed,
sizeof(cmdnames),
9097 sArithBase.
sCmds[nPos].alias = nAlias;
9098 sArithBase.
sCmds[nPos].tokval = nTokval;
9099 sArithBase.
sCmds[nPos].toktype = nToktype;
9105 if(szName==
NULL)
return -1;
9109 Print(
"'%s' already exists at %d\n", szName, nIndex);
9128 qsort(sArithBase.
sCmds, sArithBase.
nCmdUsed,
sizeof(cmdnames),
9147 WerrorS(
"not implemented for non-commutative rings");
9150 else if ((p & PLURAL_MASK)==2 )
9163 WerrorS(
"not implemented for rings with rings as coeffients");
9170 WerrorS(
"domain required as coeffients");
9176 WarnS(
"considering the image in Q[...]");
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
static BOOLEAN jjINTMAT3(leftv res, leftv u, leftv v, leftv w)
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of 'a' and 'b', i.e., a-b
int iiInitArithmetic()
initialisation of arithmetic structured data
matrix idDiff(matrix i, int k)
static BOOLEAN jjBREAK0(leftv, leftv)
static BOOLEAN jjPLUS_I(leftv res, leftv u, leftv v)
static BOOLEAN jjE(leftv res, leftv v)
static BOOLEAN jjPAR1(leftv res, leftv v)
static BOOLEAN jjRANK2(leftv res, leftv u, leftv v)
static BOOLEAN jjIDEAL_PL(leftv res, leftv v)
poly pOppose(ring Rop_src, poly p, const ring Rop_dst)
opposes a vector p from Rop to currRing (dst!)
ideal singclap_sqrfree(poly f, intvec **v, int with_exps, const ring r)
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
static BOOLEAN jjDET_S(leftv res, leftv v)
BOOLEAN yyInRingConstruction
ideal scKBase(int deg, ideal s, ideal Q, intvec *mv)
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
ideal getMinorIdeal(const matrix mat, const int minorSize, const int k, const char *algorithm, const ideal iSB, const bool allDifferent)
Returns the specified set of minors (= subdeterminantes) of the given matrix.
static BOOLEAN jjTIMES_ID(leftv res, leftv u, leftv v)
static FORCE_INLINE number n_IntMod(number a, number b, const coeffs r)
for r a field, return n_Init(0,r) otherwise: n_Div(a,b,r)*b+n_IntMod(a,b,r)==a
matrix mp_CoeffProc(poly f, poly vars, const ring R)
static FORCE_INLINE number n_GetNumerator(number &n, const coeffs r)
return the numerator of n (if elements of r are by nature not fractional, result is n) ...
static BOOLEAN jjBI2IM(leftv res, leftv u)
int compare(const bigintmat *op) const
static BOOLEAN jjOP_BI_BIM(leftv res, leftv u, leftv v)
void id_Normalize(ideal I, const ring r)
normialize all polys in id
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
static BOOLEAN jjFAC_P(leftv res, leftv u)
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)
const CanonicalForm int s
void id_DelDiv(ideal id, const ring r)
delete id[j], if LT(j) == coeff*mon*LT(i) and vice versa, i.e., delete id[i], if LT(i) == coeff*mon*L...
This file provides miscellaneous functionality.
static BOOLEAN jjCALL2ARG(leftv res, leftv u)
resolvente syResolvente(ideal arg, int maxlength, int *length, intvec ***weights, BOOLEAN minim)
syStrategy syKosz(ideal arg, int *length)
int iiTestConvert(int inputType, int outputType)
static BOOLEAN jjREPART(leftv res, leftv v)
ideal id_FreeModule(int i, const ring r)
the free module of rank i
static BOOLEAN jjRING3(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjRSUM(leftv res, leftv u, leftv v)
ideal id_Transp(ideal a, const ring rRing)
transpose a module
static BOOLEAN jjVAR1(leftv res, leftv v)
bool luSolveViaLUDecomp(const matrix pMat, const matrix lMat, const matrix uMat, const matrix bVec, matrix &xVec, matrix &H)
Solves the linear system A * x = b, where A is an (m x n)-matrix which is given by its LU-decompositi...
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
poly pSubstPoly(poly p, int var, poly image)
void atSet(idhdl root, const char *name, void *data, int typ)
Class used for (list of) interpreter objects.
static BOOLEAN jjTEST(leftv, leftv v)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
ideal id_Homogen(ideal h, int varnum, const ring r)
static int _gentable_sort_cmds(const void *a, const void *b)
compares to entry of cmdsname-list
static FORCE_INLINE BOOLEAN n_IsUnit(number n, const coeffs r)
TRUE iff n has a multiplicative inverse in the given coeff field/ring r.
static BOOLEAN jjPARDEG(leftv res, leftv v)
number ntDiff(number a, number d, const coeffs cf)
static BOOLEAN jjTIMES_I(leftv res, leftv u, leftv v)
void syMake(leftv v, const char *id, idhdl packhdl)
static BOOLEAN jjLOAD_E(leftv, leftv v, leftv u)
static BOOLEAN jjJET_ID_M(leftv res, leftv u, leftv v, leftv w)
BOOLEAN rIsLikeOpposite(ring rBase, ring rCandidate)
checks whether rings rBase and rCandidate could be opposite to each other returns TRUE if it is so ...
static BOOLEAN jjCOMPARE_S(leftv res, leftv u, leftv v)
static BOOLEAN jjnInt(leftv res, leftv u)
static BOOLEAN jjLIFT(leftv res, leftv u, leftv v)
void omPrintInfo(FILE *fd)
bigintmat * bimSub(bigintmat *a, bigintmat *b)
static BOOLEAN jjPLUS_MA(leftv res, leftv u, leftv v)
#define TEST_OPT_DEGBOUND
static BOOLEAN jjKERNEL(leftv res, leftv u, leftv v)
static BOOLEAN jjCOMPARE_IV(leftv res, leftv u, leftv v)
static BOOLEAN jjPLUS_BIM(leftv res, leftv u, leftv v)
static BOOLEAN jjSQR_FREE(leftv res, leftv u)
static BOOLEAN jjPFAC1(leftv res, leftv v)
static BOOLEAN jjTIMES_MA_BI2(leftv res, leftv u, leftv v)
static BOOLEAN jjKBASE2(leftv res, leftv u, leftv v)
static BOOLEAN jjHILBERT2(leftv res, leftv u, leftv v)
static BOOLEAN jjJET_P_IV(leftv res, leftv u, leftv v, leftv w)
ideal id_Subst(ideal id, int n, poly e, const ring r)
ideal idSubstPar(ideal id, int n, poly e)
static BOOLEAN jjMULT(leftv res, leftv v)
static BOOLEAN jjSUBST_Id_I(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjPlural_mat_mat(leftv res, leftv a, leftv b)
static BOOLEAN jjPOWER_ID(leftv res, leftv u, leftv v)
#define idDelete(H)
delete an ideal
static BOOLEAN rField_is_Zp_a(const ring r)
static BOOLEAN jjFACSTD(leftv res, leftv v)
static BOOLEAN jjTRANSP_IV(leftv res, leftv v)
int nCmdAllocated
number of commands-slots allocated
static BOOLEAN jjCALL3ARG(leftv res, leftv u)
static BOOLEAN jjN2BI(leftv res, leftv v)
static BOOLEAN jjCOUNT_N(leftv res, leftv v)
static BOOLEAN jjGETDUMP(leftv, leftv v)
static BOOLEAN jjINTVEC_PL(leftv res, leftv v)
static BOOLEAN jjP2BI(leftv res, leftv v)
ideal_list kStdfac(ideal F, ideal Q, tHomog h, intvec **w, ideal D)
static BOOLEAN jjTIMES_MA_P2(leftv res, leftv u, leftv v)
void idLiftW(ideal P, ideal Q, int n, matrix &T, ideal &R, short *w)
ideal interpolation(const std::vector< ideal > &L, intvec *v)
intvec * scIndIntvec(ideal S, ideal Q)
void henselFactors(const int xIndex, const int yIndex, const poly h, const poly f0, const poly g0, const int d, poly &f, poly &g)
Computes a factorization of a polynomial h(x, y) in K[[x]][y] up to a certain degree in x...
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
static BOOLEAN jjCOUNT_M(leftv res, leftv v)
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
static BOOLEAN rField_is_Ring_PtoM(const ring r)
static int WerrorS_dummy_cnt
static int si_min(const int a, const int b)
static BOOLEAN jjRANDOM(leftv res, leftv u, leftv v)
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
static BOOLEAN jjFAREY_BI(leftv res, leftv u, leftv v)
matrix mp_InitP(int r, int c, poly p, const ring R)
make it a p * unit matrix
ideal t_rep_gb(ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
Compatiblity layer for legacy polynomial operations (over currRing)
static BOOLEAN jjDIVMOD_I(leftv res, leftv u, leftv v)
static BOOLEAN jjBRACK_Ma_I_IV(leftv res, leftv u, leftv v, leftv w)
ideal kSba(ideal F, ideal Q, tHomog h, intvec **w, int sbaOrder, int arri, intvec *hilb, int syzComp, int newIdeal, intvec *vw)
poly p_Homogen(poly p, int varnum, const ring r)
static BOOLEAN jjL2R(leftv res, leftv v)
static BOOLEAN jjOpenClose(leftv, leftv v)
static BOOLEAN jjMEMORY(leftv res, leftv v)
BOOLEAN jjWAIT1ST1(leftv res, leftv u)
int exprlist_length(leftv v)
ideal id_Copy(ideal h1, const ring r)
copy an ideal
short * iv2array(intvec *iv, const ring R)
static int rPar(const ring r)
(r->cf->P)
static BOOLEAN jjCOEFFS_Id(leftv res, leftv u, leftv v)
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
static BOOLEAN jjCOLS(leftv res, leftv v)
static BOOLEAN rField_is_Ring_ModN(const ring r)
matrix mp_Coeffs(ideal I, int var, const ring R)
corresponds to Maple's coeffs: var has to be the number of a variable
#define nPower(a, b, res)
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
static BOOLEAN jjKLAMMER_rest(leftv res, leftv u, leftv v)
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
static BOOLEAN jjALIGN_M(leftv res, leftv u, leftv v)
static BOOLEAN jjHOMOG1(leftv res, leftv v)
static BOOLEAN jjCHINREM_BI(leftv res, leftv u, leftv v)
void omPrintBinStats(FILE *fd)
static BOOLEAN jjPLUS_MA_P(leftv res, leftv u, leftv v)
poly sm_CallDet(ideal I, const ring R)
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
static BOOLEAN jjGCD_N(leftv res, leftv u, leftv v)
static BOOLEAN jjrVarStr(leftv res, leftv v)
static BOOLEAN jjPRIME(leftv res, leftv v)
static BOOLEAN jjMODULO(leftv res, leftv u, leftv v)
static BOOLEAN jjROWS(leftv res, leftv v)
ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring r)
static BOOLEAN jjDET_BI(leftv res, leftv v)
static BOOLEAN jjDUMP(leftv, leftv v)
static BOOLEAN jjPLUS_S(leftv res, leftv u, leftv v)
BOOLEAN iiTryLoadLib(leftv v, const char *id)
leftv slRead(si_link l, leftv a)
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
poly mp_Trace(matrix a, const ring R)
static BOOLEAN jjCOEF(leftv res, leftv u, leftv v)
static BOOLEAN jjREDUCE3_ID(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjTIMES_MA_I2(leftv res, leftv u, leftv v)
static BOOLEAN jjJACOB_M(leftv res, leftv a)
static BOOLEAN jjnlInt(leftv res, leftv u)
static BOOLEAN jjIS_RINGVAR0(leftv res, leftv)
static BOOLEAN jjINTERRED(leftv res, leftv v)
static BOOLEAN jjMINUS_BI(leftv res, leftv u, leftv v)
static BOOLEAN jjSTD_1(leftv res, leftv u, leftv v)
static BOOLEAN jjDOTDOT(leftv res, leftv u, leftv v)
void id_Norm(ideal id, const ring r)
ideal id = (id[i]), result is leadcoeff(id[i]) = 1
static BOOLEAN jjNULL(leftv, leftv)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
#define pIsUnit(p)
return true if the Lm is a constant <>0
static BOOLEAN jjCONTENT(leftv res, leftv v)
static BOOLEAN jjFAC_P2(leftv res, leftv u, leftv dummy)
#define omFreeSize(addr, size)
static BOOLEAN jjREAD2(leftv res, leftv u, leftv v)
static BOOLEAN jjKLAMMER_IV(leftv res, leftv u, leftv v)
#define idSimpleAdd(A, B)
matrix idDiffOp(ideal I, ideal J, BOOLEAN multiply)
int singclap_det_i(intvec *m, const ring)
static BOOLEAN jjpHead(leftv res, leftv v)
static BOOLEAN jjCOLON(leftv res, leftv u, leftv v)
static BOOLEAN jjPARSTR2(leftv res, leftv u, leftv v)
BOOLEAN iiExprArith1Tab(leftv res, leftv a, int op, struct sValCmd1 *dA1, int at, struct sConvertTypes *dConvertTypes)
apply an operation 'op' to an argument a return TRUE on failure
static BOOLEAN jjBI2N(leftv res, leftv u)
static BOOLEAN jjUMINUS_MA(leftv res, leftv u)
static BOOLEAN jjSUBST_Id_N(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjDIV_P(leftv res, leftv u, leftv v)
static short rVar(const ring r)
#define rVar(r) (r->N)
BOOLEAN jjPROC(leftv res, leftv u, leftv v)
poly singclap_gcd(poly f, poly g, const ring r)
destroys f and g
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
intvec * ivCopy(const intvec *o)
struct sValCmd1 * psValCmd1
static BOOLEAN jjDEGREE(leftv res, leftv v)
bigintmat * bimAdd(bigintmat *a, bigintmat *b)
Matrix-Add/-Sub/-Mult so oder mit operator+/-/* ? : NULL as a result means an error (non-compatible m...
static BOOLEAN jjINTERSECT_PL(leftv res, leftv v)
static BOOLEAN jjBREAK1(leftv, leftv v)
static BOOLEAN jjEXTGCD_I(leftv res, leftv u, leftv v)
ideal getMinorIdealCache(const matrix mat, const int minorSize, const int k, const ideal iSB, const int cacheStrategy, const int cacheN, const int cacheW, const bool allDifferent)
Returns the specified set of minors (= subdeterminantes) of the given matrix.
static BOOLEAN jjPlural_mat_poly(leftv res, leftv a, leftv b)
static BOOLEAN jjNEWSTRUCT3(leftv, leftv u, leftv v, leftv w)
static BOOLEAN jjTRACE_IV(leftv res, leftv v)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
#define pCmp(p1, p2)
pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2))) ...
static BOOLEAN jjGT_I(leftv res, leftv u, leftv v)
static BOOLEAN jjidFreeModule(leftv res, leftv v)
static BOOLEAN rField_is_Q_a(const ring r)
static BOOLEAN jjINTERPOLATION(leftv res, leftv l, leftv v)
struct sValCmd1 dArith1[]
lists qrDoubleShift(const matrix A, const number tol1, const number tol2, const number tol3, const ring r=currRing)
Computes all eigenvalues of a given real quadratic matrix with multiplicites.
lib_types type_of_LIB(const char *newlib, char *libnamebuf)
static BOOLEAN jjMINUS_I(leftv res, leftv u, leftv v)
static BOOLEAN jjDUMMY(leftv res, leftv u)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
syStrategy syResolution(ideal arg, int maxlength, intvec *w, BOOLEAN minim)
BOOLEAN maApplyFetch(int what, map theMap, leftv res, leftv w, ring preimage_r, int *perm, int *par_perm, int P, nMapFunc nMap)
ideal idMultSect(resolvente arg, int length)
static BOOLEAN jjHILBERT_IV(leftv res, leftv v)
static long p_Totaldegree(poly p, const ring r)
intvec * ivSub(intvec *a, intvec *b)
int syDim(syStrategy syzstr)
static BOOLEAN rField_is_Domain(const ring r)
static BOOLEAN jjEQUAL_BI(leftv res, leftv u, leftv v)
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
poly iiHighCorner(ideal I, int ak)
static BOOLEAN jjTIMES_MA_BI1(leftv res, leftv u, leftv v)
static BOOLEAN jjWEDGE(leftv res, leftv u, leftv v)
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
poly singclap_det(const matrix m, const ring s)
static BOOLEAN jjPROC1(leftv res, leftv u)
intvec * ivTranp(intvec *o)
static BOOLEAN jjDEG_M(leftv res, leftv u)
static BOOLEAN jjDIM_R(leftv res, leftv v)
void WerrorS(const char *s)
static BOOLEAN jjPROC3(leftv res, leftv u, leftv v, leftv w)
void omPrintStats(FILE *fd)
static BOOLEAN jjJanetBasis2(leftv res, leftv u, leftv v)
static BOOLEAN jjOP_BIM_BI(leftv res, leftv u, leftv v)
static BOOLEAN jjBRACK_Im(leftv res, leftv u, leftv v, leftv w)
ideal idModulo(ideal h2, ideal h1, tHomog hom, intvec **w)
static BOOLEAN jjDIV_Ma(leftv res, leftv u, leftv v)
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
static BOOLEAN jjNAMES0(leftv res, leftv)
static BOOLEAN rField_is_GF(const ring r)
static char const ** rParameter(const ring r)
(r->cf->parameter)
static BOOLEAN jjTIMES_BI(leftv res, leftv u, leftv v)
static BOOLEAN jjSTD(leftv res, leftv v)
static BOOLEAN jjJACOB_P(leftv res, leftv v)
static BOOLEAN jjpLength(leftv res, leftv v)
const char * slStatus(si_link l, const char *request)
#define pLmFreeAndNext(p)
assumes p != NULL, deletes p, returns pNext(p)
static BOOLEAN jjJET_P(leftv res, leftv u, leftv v)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
static BOOLEAN jjGE_BI(leftv res, leftv u, leftv v)
#define pEqualPolys(p1, p2)
static FORCE_INLINE int n_ParDeg(number n, const coeffs r)
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
static BOOLEAN jjP2N(leftv res, leftv v)
ideal idMinEmbedding(ideal arg, BOOLEAN inPlace, intvec **w)
static BOOLEAN jjGCD_I(leftv res, leftv u, leftv v)
poly singclap_pdivide(poly f, poly g, const ring r)
static BOOLEAN jjOPPOSE(leftv res, leftv a, leftv b)
static bool rIsPluralRing(const ring r)
we must always have this test!
static BOOLEAN jjSUBST_Id(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjPRUNE(leftv res, leftv v)
static BOOLEAN jjOP_I_BIM(leftv res, leftv u, leftv v)
ideal idQuot(ideal h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN resultIsIdeal)
BOOLEAN slOpen(si_link l, short flag, leftv h)
long(* pLDegProc)(poly p, int *length, ring r)
static BOOLEAN jjINDEX_P_IV(leftv res, leftv u, leftv v)
static BOOLEAN jjsyMinBase(leftv res, leftv v)
#define pGetComp(p)
Component.
static BOOLEAN jjPARSTR1(leftv res, leftv v)
static BOOLEAN jjHOMOG1_W(leftv res, leftv v, leftv u)
static BOOLEAN jjGE_I(leftv res, leftv u, leftv v)
static int pLength(poly a)
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
#define SI_LINK_SET_CLOSE_P(l)
BOOLEAN iiExport(leftv v, int toLev)
newstruct_desc newstructFromString(const char *s)
static BOOLEAN jjWAIT1ST2(leftv res, leftv u, leftv v)
ideal idOppose(ring Rop_src, ideal I, const ring Rop_dst)
opposes a module I from Rop to currRing(dst)
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
static BOOLEAN jjMAP(leftv res, leftv u, leftv v)
static BOOLEAN jjKoszul_Id(leftv res, leftv u, leftv v)
static BOOLEAN jjMINUS_N(leftv res, leftv u, leftv v)
static BOOLEAN idIsZeroDim(ideal i)
idhdl get(const char *s, int lev)
ideal idMinBase(ideal h1)
void monitor(void *F, int mode)
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
static BOOLEAN jjTIMES_MA_I1(leftv res, leftv u, leftv v)
static BOOLEAN jjP2I(leftv res, leftv v)
ideal id_JetW(ideal i, int d, intvec *iv, const ring R)
static BOOLEAN jjMINOR_M(leftv res, leftv v)
static BOOLEAN jjEXPORTTO(leftv, leftv u, leftv v)
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..)
static void iiReWrite(const char *s)
int iiRegularity(lists L)
static FORCE_INLINE number n_Random(siRandProc p, number p1, number p2, const coeffs cf)
static BOOLEAN jjUMINUS_BI(leftv res, leftv u)
static BOOLEAN jjTIMES_BIM(leftv res, leftv u, leftv v)
static BOOLEAN jjCOUNT_RES(leftv res, leftv v)
static BOOLEAN jjJanetBasis(leftv res, leftv v)
void printBlackboxTypes()
list all defined type (for debugging)
static FORCE_INLINE number n_Param(const int iParameter, const coeffs r)
return the (iParameter^th) parameter as a NEW number NOTE: parameter numbering: 1..n_NumberOfParameters(...)
static BOOLEAN jjVARSTR2(leftv res, leftv u, leftv v)
static BOOLEAN jjLE_N(leftv res, leftv u, leftv v)
static BOOLEAN jjROWS_IV(leftv res, leftv v)
int rSum(ring r1, ring r2, ring &sum)
static BOOLEAN jjEQUAL_Ma(leftv res, leftv u, leftv v)
static BOOLEAN jjBAREISS(leftv res, leftv v)
matrix mp_Transp(matrix a, const ring R)
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
static BOOLEAN jjWAITALL2(leftv res, leftv u, leftv v)
int scMultInt(ideal S, ideal Q)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pGetExp(p, i)
Exponent.
static BOOLEAN jjBRACK_Ma_IV_IV(leftv res, leftv u, leftv v, leftv w)
static void WerrorS_dummy(const char *)
static BOOLEAN jjCOUNT_IV(leftv res, leftv v)
static BOOLEAN jjRES3(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjTIMES_MA_N1(leftv res, leftv u, leftv v)
static BOOLEAN jjRINGLIST_C(leftv res, leftv v)
static BOOLEAN jjSTATUS2L(leftv res, leftv u, leftv v)
static BOOLEAN check_valid(const int p, const int op)
static BOOLEAN jjPLUS_P(leftv res, leftv u, leftv v)
char * iiArithGetCmd(int nPos)
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
static BOOLEAN jjrCharStr(leftv res, leftv v)
static BOOLEAN jjKoszul(leftv res, leftv u, leftv v)
static BOOLEAN jjBRACKET(leftv res, leftv a, leftv b)
const char * Tok2Cmdname(int tok)
BOOLEAN iiMake_proc(idhdl pn, package pack, sleftv *sl)
static BOOLEAN jjINDEX_P(leftv res, leftv u, leftv v)
void luDecomp(const matrix aMat, matrix &pMat, matrix &lMat, matrix &uMat, const ring R)
LU-decomposition of a given (m x n)-matrix.
void id_Shift(ideal M, int s, const ring r)
long p_DegW(poly p, const short *w, const ring R)
static BOOLEAN jjOP_BIM_I(leftv res, leftv u, leftv v)
int r_IsRingVar(const char *n, char **names, int N)
ideal idSect(ideal h1, ideal h2)
static BOOLEAN jjREDUCE3_CID(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjIDEAL_Map(leftv res, leftv v)
static BOOLEAN jjSUBST_Test(leftv v, leftv w, int &ringvar, poly &monomexpr)
static BOOLEAN jjIm2Iv(leftv res, leftv v)
static BOOLEAN jjSUBST_M(leftv res, leftv u)
static BOOLEAN jjLU_INVERSE(leftv res, leftv v)
static BOOLEAN jjHIGHCORNER_M(leftv res, leftv v)
static BOOLEAN jjINDEPSET2(leftv res, leftv u, leftv v)
intvec * bim2iv(bigintmat *b)
Coefficient rings, fields and other domains suitable for Singular polynomials.
static BOOLEAN jjLT_BI(leftv res, leftv u, leftv v)
static BOOLEAN jjIMPART(leftv res, leftv v)
static BOOLEAN jjLOAD1(leftv, leftv v)
ideal idSeries(int n, ideal M, matrix U, intvec *w)
ideal idElimination(ideal h1, poly delVar, intvec *hilb)
static BOOLEAN jjSUBST_Id_X(leftv res, leftv u, leftv v, leftv w, int input_type)
static BOOLEAN jjREDUCE_ID(leftv res, leftv u, leftv v)
BOOLEAN jjWAITALL1(leftv res, leftv u)
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
void id_DelLmEquals(ideal id, const ring r)
Delete id[j], if Lm(j) == Lm(i) and both LC(j), LC(i) are units and j > i.
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ...
const char * iiTwoOps(int t)
const CanonicalForm CFMap CFMap & N
static BOOLEAN jjUMINUS_I(leftv res, leftv u)
matrix mp_Wedge(matrix a, int ar, const ring R)
static BOOLEAN jjWRONG(leftv, leftv)
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 BOOLEAN jjMATRIX_Ma(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjMSTD(leftv res, leftv v)
int iiArithRemoveCmd(char *szName)
static BOOLEAN jjUMINUS_P(leftv res, leftv u)
static BOOLEAN jjCOEFFS2_KB(leftv res, leftv u, leftv v)
static BOOLEAN jjmpTrace(leftv res, leftv v)
lists ipNameListLev(idhdl root, int lev)
static BOOLEAN jjALIGN_V(leftv res, leftv u, leftv v)
bigintmat * bimMult(bigintmat *a, bigintmat *b)
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
static BOOLEAN jjKLAMMER(leftv res, leftv u, leftv v)
static long pTotaldegree(poly p)
static BOOLEAN jjHOMOG_P_W(leftv res, leftv u, leftv v, leftv)
BOOLEAN setOption(leftv res, leftv v)
static BOOLEAN jjDIFF_ID(leftv res, leftv u, leftv v)
int scMult0Int(ideal S, ideal Q, const ring tailRing)
poly pSubstPar(poly p, int par, poly image)
The main handler for Singular numbers which are suitable for Singular polynomials.
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
static BOOLEAN jjRPAR(leftv res, leftv v)
static BOOLEAN jjERROR(leftv, leftv u)
static BOOLEAN jjVDIM(leftv res, leftv v)
static BOOLEAN jjEQUAL_N(leftv res, leftv u, leftv v)
static BOOLEAN jjJET4(leftv res, leftv u)
void scDegree(ideal S, intvec *modulweight, ideal Q)
static BOOLEAN jjOP_IM_I(leftv res, leftv u, leftv v)
int nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
static BOOLEAN jjLEADEXP(leftv res, leftv v)
int scDimInt(ideal S, ideal Q)
int compare(const intvec *o) const
static BOOLEAN jjSLIM_GB(leftv res, leftv u)
matrix mp_MultI(matrix a, int f, const ring R)
c = f*a
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
static BOOLEAN jjDIVISION4(leftv res, leftv v)
static BOOLEAN jjKBASE(leftv res, leftv v)
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
static FORCE_INLINE number n_ChineseRemainderSym(number *a, number *b, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs r)
static BOOLEAN jjVARSTR1(leftv res, leftv v)
static BOOLEAN jjREDUCE5(leftv res, leftv u)
static BOOLEAN jjELIMIN(leftv res, leftv u, leftv v)
static BOOLEAN jjSTD_HILB_W(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjLIFT3(leftv res, leftv u, leftv v, leftv w)
BOOLEAN sm_CheckDet(ideal I, int d, BOOLEAN sw, const ring r)
static BOOLEAN jjMONOM(leftv res, leftv v)
const char feNotImplemented[]
void id_DelEquals(ideal id, const ring r)
ideal id = (id[i]) if id[i] = id[j] then id[j] is deleted for j > i
static BOOLEAN jjTIMES_N(leftv res, leftv u, leftv v)
static BOOLEAN jjMOD_BI(leftv res, leftv u, leftv v)
static BOOLEAN jjBRACK_Ma_IV_I(leftv res, leftv u, leftv v, leftv w)
long kHomModDeg(poly p, ring r)
struct sValCmd3 dArith3[]
static BOOLEAN jjPREIMAGE(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjKLAMMER_PL(leftv res, leftv u)
ideal kInterRed(ideal F, ideal Q)
ideal id_Power(ideal given, int exp, const ring r)
BOOLEAN(* proc3)(leftv, leftv, leftv, leftv)
static BOOLEAN jjSTATUS_M(leftv res, leftv v)
static BOOLEAN jjDEG_M_IV(leftv res, leftv u, leftv v)
static BOOLEAN jjDET(leftv res, leftv v)
BOOLEAN jjLOAD_TRY(const char *s)
static BOOLEAN jjSUBST_P(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjLIFTSTD(leftv res, leftv u, leftv v)
int nCmdUsed
number of commands used
static BOOLEAN jjRES(leftv res, leftv u, leftv v)
static BOOLEAN jjINDEX_V_IV(leftv res, leftv u, leftv v)
static BOOLEAN jjSTRING_PL(leftv res, leftv v)
static BOOLEAN jjRANK1(leftv res, leftv v)
static BOOLEAN jjHOMOG_P(leftv res, leftv u, leftv v)
static BOOLEAN jjDIV_N(leftv res, leftv u, leftv v)
static BOOLEAN jjEXTGCD_P(leftv res, leftv u, leftv v)
static BOOLEAN jjLEADCOEF(leftv res, leftv v)
static BOOLEAN jjSBA_2(leftv res, leftv v, leftv u, leftv t)
struct sValCmd2 * psValCmd2
BOOLEAN rSamePolyRep(ring r1, ring r2)
returns TRUE, if r1 and r2 represents the monomials in the same way FALSE, otherwise this is an analo...
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
#define pIsConstant(p)
like above, except that Comp might be != 0
static BOOLEAN jjSBA(leftv res, leftv v)
static BOOLEAN jjREGULARITY(leftv res, leftv v)
BOOLEAN jjStdJanetBasis(leftv res, leftv v, int flag)
flag: 0: JB, 1: SB
matrix pMultMp(poly p, matrix a, const ring R)
static BOOLEAN jjDEFINED(leftv res, leftv v)
static BOOLEAN jjidVec2Ideal(leftv res, leftv v)
struct sValCmdM * psValCmdM
static int si_max(const int a, const int b)
static BOOLEAN jjGE_N(leftv res, leftv u, leftv v)
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
static BOOLEAN jjREDUCE_P(leftv res, leftv u, leftv v)
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
static BOOLEAN jjMINUS_P(leftv res, leftv u, leftv v)
BOOLEAN assumeStdFlag(leftv h)
static BOOLEAN jjOP_I_IV(leftv res, leftv u, leftv v)
static BOOLEAN jjFAREY_ID(leftv res, leftv u, leftv v)
static BOOLEAN jjRESERVED0(leftv, leftv)
static BOOLEAN jjENVELOPE(leftv res, leftv a)
static BOOLEAN jjPFAC2(leftv res, leftv u, leftv v)
void PrintS(const char *s)
static BOOLEAN jjDEG_IV(leftv res, leftv u, leftv v)
static BOOLEAN jjRINGLIST(leftv res, leftv v)
lists ipNameList(idhdl root)
static BOOLEAN rField_is_Q(const ring r)
static BOOLEAN jjCALL1ARG(leftv res, leftv v)
static BOOLEAN jjLOAD2(leftv, leftv, leftv v)
static BOOLEAN jjidTransp(leftv res, leftv v)
int iiArithAddCmd(const char *szName, short nAlias, short nTokval, short nToktype, short nPos=-1)
static long p_MinComp(poly p, ring lmRing, ring tailRing)
BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
static BOOLEAN jjSTD_HILB(leftv res, leftv u, leftv v)
static BOOLEAN jjidMinBase(leftv res, leftv v)
syStrategy sySchreyer(ideal arg, int maxlength)
BOOLEAN sdb_set_breakpoint(const char *pp, int given_lineno)
static BOOLEAN jjBI2P(leftv res, leftv u)
matrix id_Module2Matrix(ideal mod, const ring R)
resolvente sySchreyerResolvente(ideal arg, int maxlength, int *length, BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE)
static BOOLEAN jjDIM2(leftv res, leftv v, leftv w)
static BOOLEAN jjPOWER_BI(leftv res, leftv u, leftv v)
static BOOLEAN jjUMINUS_N(leftv res, leftv u)
int sySize(syStrategy syzstr)
static BOOLEAN jjDIVISION(leftv res, leftv u, leftv v)
static BOOLEAN jjFWALK(leftv res, leftv u, leftv v)
static BOOLEAN jjREDUCE3_CP(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjINTERSECT(leftv res, leftv u, leftv v)
struct sValCmd2 dArith2[]
static BOOLEAN jjREDUCE3_P(leftv res, leftv u, leftv v, leftv w)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
static BOOLEAN jjmpTransp(leftv res, leftv v)
static BOOLEAN jjTYPEOF(leftv res, leftv v)
static BOOLEAN jjINDEX_I(leftv res, leftv u, leftv v)
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static BOOLEAN jjFactModD_M(leftv res, leftv v)
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
lists scIndIndset(ideal S, BOOLEAN all, ideal Q)
void(* WerrorS_callback)(const char *s)
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
void iiMakeResolv(resolvente r, int length, int rlen, char *name, int typ0, intvec **weights)
static BOOLEAN jjPLUS_IV(leftv res, leftv u, leftv v)
static BOOLEAN jjLISTRING(leftv res, leftv v)
static BOOLEAN jjOPTION_PL(leftv res, leftv v)
poly p_Series(int n, poly p, poly u, intvec *w, const ring R)
BOOLEAN iiExprArith2Tab(leftv res, leftv a, int op, struct sValCmd2 *dA2, int at, struct sConvertTypes *dConvertTypes)
apply an operation 'op' to arguments a and a->next return TRUE on failure
static BOOLEAN jjDENOMINATOR(leftv res, leftv v)
Return the denominator of the input number NOTE: the input number is normalized as a side effect...
static BOOLEAN jjRANDOM_CF(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjIS_RINGVAR_P(leftv res, leftv v)
static BOOLEAN jjrOrdStr(leftv res, leftv v)
static BOOLEAN jjNAMES(leftv res, leftv v)
bool luInverse(const matrix aMat, matrix &iMat, const ring R)
This code first computes the LU-decomposition of aMat, and then calls the method for inverting a matr...
static BOOLEAN jjGCD_BI(leftv res, leftv u, leftv v)
static BOOLEAN jjBRACK_S(leftv res, leftv u, leftv v, leftv w)
struct sValCmdM dArithM[]
struct sConvertTypes dConvertTypes[]
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
#define rHasLocalOrMixedOrdering_currRing()
static FORCE_INLINE number n_ImPart(number i, const coeffs cf)
void rChangeCurrRing(ring r)
static BOOLEAN jjFIND2(leftv res, leftv u, leftv v)
static BOOLEAN jjFETCH_M(leftv res, leftv u)
static BOOLEAN jjMOD_N(leftv res, leftv u, leftv v)
static BOOLEAN rField_is_Zp(const ring r)
static FORCE_INLINE number n_Farey(number a, number b, const coeffs r)
intvec * ivMult(intvec *a, intvec *b)
ideal idSubstPoly(ideal id, int n, poly e)
static BOOLEAN jjBAREISS3(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjSIMPL_P(leftv res, leftv u, leftv v)
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
static BOOLEAN jjDIM(leftv res, leftv v)
INLINE_THIS void Init(int l=0)
static BOOLEAN jjCOEFFS3_KB(leftv res, leftv u, leftv v, leftv w)
BOOLEAN(* proc2)(leftv, leftv, leftv)
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)
ideal idMult(ideal h1, ideal h2)
hh := h1 * h2
matrix mp_MultP(matrix a, poly p, const ring R)
multiply a matrix 'a' by a poly 'p', destroy the args
static BOOLEAN jjOP_IV_I(leftv res, leftv u, leftv v)
static BOOLEAN iiExprArith2TabIntern(leftv res, leftv a, int op, leftv b, BOOLEAN proccall, struct sValCmd2 *dA2, int at, int bt, struct sConvertTypes *dConvertTypes)
static BOOLEAN jjTIMES_MA_P1(leftv res, leftv u, leftv v)
static BOOLEAN jjINDEX_V(leftv res, leftv u, leftv v)
static FORCE_INLINE number n_ExtGcd(number a, number b, number *s, number *t, const coeffs r)
beware that ExtGCD is only relevant for a few chosen coeff. domains and may perform something unexpec...
static BOOLEAN jjNEWSTRUCT2(leftv, leftv u, leftv v)
#define SI_RESTORE_OPT2(A)
static BOOLEAN jjCOMPARE_P(leftv res, leftv u, leftv v)
static BOOLEAN jjSQR_FREE2(leftv res, leftv u, leftv dummy)
ideal idInit(int idsize, int rank)
initialise an ideal / module
static BOOLEAN jjGCD_P(leftv res, leftv u, leftv v)
BOOLEAN nc_CallPlural(matrix cc, matrix dd, poly cn, poly dn, ring r, bool bSetupQuotient, bool bCopyInput, bool bBeQuiet, ring curr, bool dummy_ring=false)
returns TRUE if there were errors analyze inputs, check them for consistency detects nc_type...
const Variable & v
< [in] a sqrfree bivariate poly
static BOOLEAN jjEXECUTE(leftv, leftv v)
#define pSeries(n, p, u, w)
static BOOLEAN jjidMaxIdeal(leftv res, leftv v)
matrix mp_Mult(matrix a, matrix b, const ring R)
int singclap_factorize_retry
static BOOLEAN jjMINRES_R(leftv res, leftv v)
static BOOLEAN jjPlural_num_mat(leftv res, leftv a, leftv b)
static BOOLEAN iiExprArith3TabIntern(leftv res, int op, leftv a, leftv b, leftv c, struct sValCmd3 *dA3, int at, int bt, int ct, struct sConvertTypes *dConvertTypes)
static BOOLEAN jjCOEFFS3_P(leftv res, leftv u, leftv v, leftv w)
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
void mp_Coef2(poly v, poly mon, matrix *c, matrix *m, const ring R)
corresponds to Macauley's coef: the exponent vector of vars has to contain the variables, eg 'xy'; then the poly f is searched for monomials in x and y, these monimials are written to the first row of the matrix co. the second row of co contains the respective factors in f. Thus f = sum co[1,i]*co[2,i], i = 1..cols, rows equals 2.
ideal getMinorIdealHeuristic(const matrix mat, const int minorSize, const int k, const ideal iSB, const bool allDifferent)
Returns the specified set of minors (= subdeterminantes) of the given matrix.
void maFindPerm(char const *const *const preim_names, int preim_n, char const *const *const preim_par, int preim_p, char const *const *const names, int n, char const *const *const par, int nop, int *perm, int *par_perm, n_coeffType ch)
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
static BOOLEAN jjPLUS_N(leftv res, leftv u, leftv v)
ideal id_Jet(ideal i, int d, const ring R)
static BOOLEAN jjJET_ID_IV(leftv res, leftv u, leftv v, leftv w)
BOOLEAN jjLIST_PL(leftv res, leftv v)
static BOOLEAN jjTIMES_MA(leftv res, leftv u, leftv v)
void mp_Monomials(matrix c, int r, int var, matrix m, const ring R)
static BOOLEAN rField_is_Ring_2toM(const ring r)
static BOOLEAN rField_is_Ring(const ring r)
matrix mp_Add(matrix a, matrix b, const ring R)
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
static BOOLEAN jjJET_ID(leftv res, leftv u, leftv v)
int ipower(int b, int m)
int ipower ( int b, int m )
int slStatusSsiL(lists L, int timeout)
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
ring rCompose(const lists L, const BOOLEAN check_comp=TRUE)
static BOOLEAN jjHILBERT(leftv, leftv v)
ideal id_Farey(ideal x, number N, const ring r)
static BOOLEAN jjIS_RINGVAR_S(leftv res, leftv v)
static BOOLEAN jjGT_N(leftv res, leftv u, leftv v)
lists primeFactorisation(const number n, const int pBound)
Factorises a given bigint number n into its prime factors less than or equal to a given bound...
static BOOLEAN jjLT_I(leftv res, leftv u, leftv v)
void rDelete(ring r)
unconditionally deletes fields in r
lists rDecompose(const ring r)
static BOOLEAN jjPOWER_P(leftv res, leftv u, leftv v)
SModulFunc_t iiGetBuiltinModInit(const char *libname)
static BOOLEAN jjQUOT(leftv res, leftv u, leftv v)
ideal sm_CallSolv(ideal I, const ring R)
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
static BOOLEAN jjCOEF_M(leftv, leftv v)
ideal walkProc(leftv first, leftv second)
LINLINE void nlDelete(number *a, const coeffs r)
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
long(* pFDegProc)(poly p, ring r)
intvec * hSecondSeries(intvec *hseries1)
ideal kMin_std(ideal F, ideal Q, tHomog h, intvec **w, ideal &M, intvec *hilb, int syzComp, int reduced)
BOOLEAN iiCheckTypes(leftv args, const short *type_list, int report)
check a list of arguemys against a given field of types return TRUE if the types match return FALSE (...
int luRank(const matrix aMat, const bool isRowEchelon, const ring R)
Computes the rank of a given (m x n)-matrix.
static BOOLEAN jjPLUS_P_MA(leftv res, leftv u, leftv v)
bool luInverseFromLUDecomp(const matrix pMat, const matrix lMat, const matrix uMat, matrix &iMat, const ring R)
This code computes the inverse by inverting lMat and uMat, and then performing two matrix multiplicat...
static BOOLEAN rField_is_Ring_Z(const ring r)
static BOOLEAN jjCOUNT_RG(leftv res, leftv v)
static BOOLEAN jjUMINUS_IV(leftv res, leftv u)
void pNorm(poly p, const ring R=currRing)
static BOOLEAN jjTIMES_IV(leftv res, leftv u, leftv v)
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, struct sConvertTypes *dConvertTypes)
ideal idLiftStd(ideal h1, matrix *ma, tHomog hi, ideal *syz)
static BOOLEAN jjMONITOR1(leftv res, leftv v)
static BOOLEAN jjMINUS_BIM(leftv res, leftv u, leftv v)
static BOOLEAN jjQRDS(leftv res, leftv INPUT)
ideal fractalWalkProc(leftv first, leftv second)
#define pInit()
allocates a new monomial and initializes everything to 0
static BOOLEAN jjPREIMAGE_R(leftv res, leftv v)
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
static BOOLEAN jjPLUS_BI(leftv res, leftv u, leftv v)
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
static BOOLEAN jjTIMES_MA_N2(leftv res, leftv u, leftv v)
static BOOLEAN jjNAMES_I(leftv res, leftv v)
static BOOLEAN jjEQUAL_P(leftv res, leftv u, leftv v)
number singclap_det_bi(bigintmat *m, const coeffs cf)
static BOOLEAN jjEXTGCD_BI(leftv res, leftv u, leftv v)
static BOOLEAN jjNAMEOF(leftv res, leftv v)
static BOOLEAN jjGT_BI(leftv res, leftv u, leftv v)
static BOOLEAN jjNVARS(leftv res, leftv v)
static BOOLEAN jjCOLCOL(leftv res, leftv u, leftv v)
BOOLEAN singclap_extgcd(poly f, poly g, poly &res, poly &pa, poly &pb, const ring r)
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
static SArithBase sArithBase
Base entry for arithmetic.
int iiArithFindCmd(const char *szName)
static FORCE_INLINE number n_GetDenom(number &n, const coeffs r)
return the denominator of n (if elements of r are by nature not fractional, result is 1) ...
static bool rIsSCA(const ring r)
static BOOLEAN jjHOMOG_ID_W(leftv res, leftv u, leftv v, leftv)
static BOOLEAN jjUMINUS_BIM(leftv res, leftv u)
void CleanUp(ring r=currRing)
static FORCE_INLINE number n_RePart(number i, const coeffs cf)
int(* SModulFunc_t)(SModulFunctions *)
static BOOLEAN jjMONITOR2(leftv res, leftv u, leftv v)
static Subexpr jjMakeSub(leftv e)
void Clean(ring r=currRing)
static BOOLEAN jjLU_DECOMP(leftv res, leftv v)
static BOOLEAN jjFWALK3(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjCOUNT_BI(leftv res, leftv v)
static BOOLEAN jjrParStr(leftv res, leftv v)
static BOOLEAN jjCOLS_BIM(leftv res, leftv v)
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
static BOOLEAN jjLE_I(leftv res, leftv u, leftv v)
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
static BOOLEAN jjSYZYGY(leftv res, leftv v)
static BOOLEAN jjLIFTSTD3(leftv res, leftv u, leftv v, leftv w)
void show(int mat=0, int spaces=0) const
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit)
static BOOLEAN jjCHINREM_ID(leftv res, leftv u, leftv v)
BOOLEAN slDump(si_link l)
BOOLEAN mp_Equal(matrix a, matrix b, const ring R)
static BOOLEAN jjDIFF_ID_ID(leftv res, leftv u, leftv v)
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
static BOOLEAN jjDIFF_P(leftv res, leftv u, leftv v)
static BOOLEAN jjELIMIN_IV(leftv res, leftv u, leftv v)
void newBuffer(char *s, feBufferTypes t, procinfo *pi, int lineno)
syStrategy syConvList(lists li, BOOLEAN toDel)
void sm_CallBareiss(ideal I, int x, int y, ideal &M, intvec **iv, const ring R)
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
static BOOLEAN jjCALL1MANY(leftv res, leftv u)
static BOOLEAN jjTIMES_P(leftv res, leftv u, leftv v)
static BOOLEAN jjROWS_BIM(leftv res, leftv v)
static BOOLEAN jjLE_BI(leftv res, leftv u, leftv v)
ideal maGetPreimage(ring theImageRing, map theMap, ideal id, const ring dst_r)
static BOOLEAN jjINDEX_IV(leftv res, leftv u, leftv v)
static BOOLEAN jjSBA_1(leftv res, leftv v, leftv u)
static BOOLEAN jjMINUS_IV(leftv res, leftv u, leftv v)
static BOOLEAN jjPOWER_N(leftv res, leftv u, leftv v)
cmdnames * sCmds
array of existing commands
int idElem(const ideal F)
count non-zero elements
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
static BOOLEAN jjMATRIX_Mo(leftv res, leftv u, leftv v, leftv w)
LINLINE number nlInit(long i, const coeffs r)
static BOOLEAN jjidHead(leftv res, leftv v)
void newstruct_setup(const char *n, newstruct_desc d)
static BOOLEAN jjOP_I_IM(leftv res, leftv u, leftv v)
static BOOLEAN jjSort_Id(leftv res, leftv v)
static BOOLEAN jjJET_P_P(leftv res, leftv u, leftv v, leftv w)
newstruct_desc newstructChildFromString(const char *parent, const char *s)
leftv iiMap(map theMap, const char *what)
int n_IsParam(const number m, const ring r)
TODO: rewrite somehow...
static BOOLEAN jjPOWER_I(leftv res, leftv u, leftv v)
static BOOLEAN jjCOMPARE_IV_I(leftv res, leftv u, leftv v)
static BOOLEAN jjPLUSPLUS(leftv, leftv u)
ring rInit(sleftv *pn, sleftv *rv, sleftv *ord)
BOOLEAN iiLoadLIB(FILE *fp, const char *libnamebuf, const char *newlib, idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
BOOLEAN iiExprArith3Tab(leftv res, leftv a, int op, struct sValCmd3 *dA3, int at, struct sConvertTypes *dConvertTypes)
apply an operation 'op' to arguments a, a->next and a->next->next return TRUE on failure ...
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
char * rCharStr(const ring r)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar...
static BOOLEAN jjFACSTD2(leftv res, leftv v, leftv w)
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2), where m is the long representing n in C: TRUE iff (Im(n) != 0 and Im(n) >= 0) or (Im(n) == 0 and Re(n) >= 0) in K(a)/<p(a)>: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
const char * getBlackboxName(const int t)
return the name to the type given by t (r/o)
ideal singclap_factorize(poly f, intvec **v, int with_exps, const ring r)
ideal idAdd(ideal h1, ideal h2)
h1 + h2
static BOOLEAN jjREDUCE4(leftv res, leftv u)
static BOOLEAN jjUNIVARIATE(leftv res, leftv v)
static BOOLEAN jjIDEAL_Ma(leftv res, leftv v)
static BOOLEAN jjSTATUS3(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjIDEAL_R(leftv res, leftv v)
intvec * hFirstSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree, ring tailRing)
ideal id_Vec2Ideal(poly vec, const ring R)
matrix mp_Sub(matrix a, matrix b, const ring R)
static BOOLEAN jjDEG(leftv res, leftv v)
static FORCE_INLINE char * nCoeffString(const coeffs cf)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar...
BOOLEAN slClose(si_link l)
void hLookSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree, ring tailRing)
static BOOLEAN jjCOUNT_L(leftv res, leftv v)
static BOOLEAN jjMATRIX_Id(leftv res, leftv u, leftv v, leftv w)
BOOLEAN slGetDump(si_link l)
static int iin_Int(number &n, coeffs cf)
static BOOLEAN jjOR_I(leftv res, leftv u, leftv v)
static BOOLEAN jjMINUS_MA(leftv res, leftv u, leftv v)
#define omFreeBin(addr, bin)
static BOOLEAN jjLU_SOLVE(leftv res, leftv v)
BOOLEAN rDecompose_CF(leftv res, const coeffs C)
BOOLEAN(* proc1)(leftv, leftv)
static BOOLEAN jjpMaxComp(leftv res, leftv v)
char * iiConvName(const char *libname)
syStrategy syHilb(ideal arg, int *length)
static BOOLEAN currRingIsOverIntegralDomain()
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjPlural_num_poly(leftv res, leftv a, leftv b)
static BOOLEAN jjNUMERATOR(leftv res, leftv v)
Return the numerator of the input number NOTE: the input number is normalized as a side effect...
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg)
static BOOLEAN jjNOT(leftv res, leftv v)
#define IMATELEM(M, I, J)
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
static BOOLEAN jjHOMOG_ID(leftv res, leftv u, leftv v)
#define omRealloc(addr, size)
poly p_Cleardenom(poly p, const ring r)
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
static BOOLEAN jjRESERVEDNAME(leftv res, leftv v)
#define SI_RESTORE_OPT1(A)
static BOOLEAN jjINDEPSET(leftv res, leftv v)
BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport)
static FORCE_INLINE int n_Size(number n, const coeffs r)
return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used fo...
static BOOLEAN jjDET_I(leftv res, leftv v)
ideal id_Matrix2Module(matrix mat, const ring R)
static BOOLEAN jjTRANSP_BIM(leftv res, leftv v)
void nKillChar(coeffs r)
undo all initialisations
static BOOLEAN jjOPPOSITE(leftv res, leftv a)
static BOOLEAN jjCONTRACT(leftv res, leftv u, leftv v)
static BOOLEAN jjHIGHCORNER(leftv res, leftv v)
struct sValCmd3 * psValCmd3
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
void Werror(const char *fmt,...)
static BOOLEAN jjAND_I(leftv res, leftv u, leftv v)
syStrategy syLaScala3(ideal arg, int *length)
static BOOLEAN jjREAD(leftv res, leftv v)
static BOOLEAN jjCHAR(leftv res, leftv v)
const char * lastreserved
static BOOLEAN jjEQUAL_I(leftv res, leftv u, leftv v)
static BOOLEAN jjLEADMONOM(leftv res, leftv v)
static BOOLEAN jjPLUS_ID(leftv res, leftv u, leftv v)
static BOOLEAN jjSIMPL_ID(leftv res, leftv u, leftv v)
static BOOLEAN jjELIMIN_HILB(leftv res, leftv u, leftv v, leftv w)
intvec * ivAdd(intvec *a, intvec *b)
static BOOLEAN jjstrlen(leftv res, leftv v)
static BOOLEAN jjFETCH(leftv res, leftv u, leftv v)
ideal syMinBase(ideal arg)
static BOOLEAN jjTWOSTD(leftv res, leftv a)
static BOOLEAN jjSTD_HILB_WP(leftv res, leftv INPUT)
static BOOLEAN jjDIFF_COEF(leftv res, leftv u, leftv v)
static BOOLEAN jjSTATUS2(leftv res, leftv u, leftv v)
static BOOLEAN jjORD(leftv res, leftv v)
static BOOLEAN jjFIND3(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjDIV_BI(leftv res, leftv u, leftv v)
BOOLEAN jjANY2LIST(leftv res, leftv v, int cnt)
static BOOLEAN jjCOLS_IV(leftv res, leftv v)
syStrategy syMinimize(syStrategy syzstr)
#define pCopy(p)
return a copy of the poly
#define MATELEM(mat, i, j)
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
static BOOLEAN jjCOMPARE_BIM(leftv res, leftv u, leftv v)
int IsCmd(const char *n, int &tok)
static BOOLEAN jjHILBERT3(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjRANDOM_Im(leftv res, leftv u, leftv v, leftv w)
static BOOLEAN jjLT_N(leftv res, leftv u, leftv v)
static BOOLEAN jjidElem(leftv res, leftv v)
static BOOLEAN jjCOEFFS3_Id(leftv res, leftv u, leftv v, leftv w)
ideal twostd(ideal I)
Compute two-sided GB: