18 #include "ccluster/ccluster.h"
21 #include "factory/factory.h"
23 #ifdef TIME_WITH_SYS_TIME
25 # ifdef HAVE_SYS_TIME_H
26 # include <sys/time.h>
29 # ifdef HAVE_SYS_TIME_H
30 # include <sys/time.h>
35 #ifdef HAVE_SYS_TIMES_H
36 #include <sys/times.h>
140 #ifndef MAKE_DISTRIBUTION
141 #define HAVE_EXTENDED_SYSTEM 1
158 #ifdef HAVE_SIMPLEIPC
166 #ifndef MAKE_DISTRIBUTION
177 int n = singularMatrix->
rows();
179 unsigned long **longMatrix = 0;
180 longMatrix =
new unsigned long *[n] ;
181 for (
int i = 0 ;
i < n;
i++)
182 longMatrix[
i] =
new unsigned long [n];
184 for (
int r = 0; r < n; r++)
185 for (
int c = 0; c < n; c++)
187 poly
p=
MATELEM(singularMatrix, r + 1, c + 1);
197 longMatrix[r][c] = (
unsigned long)entryAsInt;
212 if ((
int)polyCoeffs[
i] != 0)
234 const char *sys_cmd=(
char *)(args->
Data());
239 if (strcmp(sys_cmd,
"nblocks") == 0)
261 r = (ring)
h->Data();
268 if(strcmp(sys_cmd,
"version")==0)
276 if(strcmp(sys_cmd,
"alarm")==0)
283 struct itimerval t,o;
284 memset(&t,0,
sizeof(t));
285 t.it_value.tv_sec =(unsigned)((
unsigned long)
h->Data());
286 setitimer(ITIMER_VIRTUAL,&t,&o);
294 if(strcmp(sys_cmd,
"cpu")==0)
297 #ifdef _SC_NPROCESSORS_ONLN
298 cpu=sysconf(_SC_NPROCESSORS_ONLN);
299 #elif defined(_SC_NPROCESSORS_CONF)
300 cpu=sysconf(_SC_NPROCESSORS_CONF);
302 res->data=(
void *)cpu;
308 if(strcmp(sys_cmd,
"executable")==0)
323 if(strcmp(sys_cmd,
"flatten")==0)
336 if(strcmp(sys_cmd,
"unflatten")==0)
349 if(strcmp(sys_cmd,
"neworder")==0)
363 if(strcmp(sys_cmd,
"nc_hilb") == 0)
371 i = (ideal)
h->Data();
374 WerrorS(
"nc_Hilb:ideal expected");
379 lV = (int)(
long)
h->Data();
382 WerrorS(
"nc_Hilb:int expected");
388 if((
int)(
long)
h->Data() == 1)
390 else if((
int)(
long)
h->Data() == 2)
395 trunDegHs = (int)(
long)
h->Data();
400 WerrorS(
"nc_Hilb:int 1,2, total degree for the truncation, and a string for printing the details are expected");
409 if(strcmp(sys_cmd,
"verifyGB")==0)
413 WerrorS(
"system(\"verifyGB\",<ideal>,..) expects a commutative ring");
418 WerrorS(
"expected system(\"verifyGB\",<ideal>,..)");
421 ideal F=(ideal)
h->Data();
434 if(strcmp(sys_cmd,
"rcolon") == 0)
439 ideal
i = (ideal)
h->Data();
441 poly
w=(poly)
h->Data();
443 int lV = (int)(
long)
h->Data();
454 if(strcmp(sys_cmd,
"sh")==0)
458 WerrorS(
"shell execution is disallowed in restricted mode");
464 res->data = (
void*)(
long)
system((
char*)(
h->Data()));
471 if(strcmp(sys_cmd,
"reduce_bound")==0)
481 p = (poly)
h->CopyD();
485 pid = (ideal)
h->CopyD();
490 ideal q = (ideal)
h->next->CopyD();
491 int bound = (int)(
long)
h->next->next->Data();
500 if(strcmp(sys_cmd,
"uname")==0)
508 if(strcmp(sys_cmd,
"with")==0)
518 #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
519 char *
s=(
char *)
h->Data();
532 #ifdef TEST_MAC_ORDER
537 #ifdef HAVE_DYNAMIC_LOADING
560 if (strcmp(sys_cmd,
"browsers")==0)
570 if (strcmp(sys_cmd,
"pid")==0)
573 res->data=(
void *)(
long) getpid();
578 if (strcmp(sys_cmd,
"getenv")==0)
583 const char *r=
getenv((
char *)
h->Data());
596 if (strcmp(sys_cmd,
"setenv")==0)
603 setenv((
char *)
h->Data(), (
char *)
h->next->Data(), 1);
613 WerrorS(
"setenv not supported on this platform");
619 if (strcmp(sys_cmd,
"Singular") == 0)
628 if (strcmp(sys_cmd,
"SingularLib") == 0)
638 if (strstr(sys_cmd,
"--") == sys_cmd)
640 if (strcmp(sys_cmd,
"--") == 0)
648 Werror(
"Unknown option %s", sys_cmd);
649 WerrorS(
"Use 'system(\"--\");' for listing of available options");
664 const char *r=(
const char*)
feOptSpec[opt].value;
678 WerrorS(
"Need string or int argument to set option value");
681 const char* errormsg;
686 Werror(
"Need string argument to set value of option %s", sys_cmd);
690 if (errormsg !=
NULL)
691 Werror(
"Option '--%s=%d' %s", sys_cmd, (
int) ((
long)
h->Data()), errormsg);
696 if (errormsg !=
NULL)
697 Werror(
"Option '--%s=%s' %s", sys_cmd, (
char*)
h->Data(), errormsg);
704 if (strcmp(sys_cmd,
"HC")==0)
712 if(strcmp(sys_cmd,
"random")==0)
735 if (strcmp(sys_cmd,
"denom_list")==0)
744 if(strcmp(sys_cmd,
"complexNearZero")==0)
751 WerrorS(
"unsupported ground field!");
758 (int)((
long)(
h->next->Data())));
769 if(strcmp(sys_cmd,
"getPrecDigits")==0)
774 WerrorS(
"unsupported ground field!");
785 if(strcmp(sys_cmd,
"lduDecomp")==0)
792 poly
l; poly u; poly prodLU;
793 lduDecomp(aMat, pMat, lMat, dMat, uMat,
l, u, prodLU);
804 res->data = (
char *)L;
814 if(strcmp(sys_cmd,
"lduSolve")==0)
848 poly
l = (poly)
h->next->next->next->next->Data();
849 poly u = (poly)
h->next->next->next->next->next->Data();
850 poly lTimesU = (poly)
h->next->next->next->next->next->next->Data();
851 matrix bVec = (
matrix)
h->next->next->next->next->next->next->next->Data();
855 Werror(
"first matrix (%d x %d) is not quadratic",
861 Werror(
"second matrix (%d x %d) is not quadratic",
867 Werror(
"third matrix (%d x %d) is not quadratic",
873 Werror(
"third matrix (%d x %d) and fourth matrix (%d x %d) %s",
880 Werror(
"fourth matrix (%d x %d) and vector (%d x 1) do not fit",
885 bVec, xVec, homogSolSpace);
908 if (strcmp(sys_cmd,
"shared") == 0)
910 #ifndef SI_COUNTEDREF_AUTOLOAD
917 else if (strcmp(sys_cmd,
"reference") == 0)
919 #ifndef SI_COUNTEDREF_AUTOLOAD
928 #ifdef HAVE_SIMPLEIPC
929 if (strcmp(sys_cmd,
"semaphore")==0)
935 v=(int)(
long)
h->next->next->Data();
942 WerrorS(
"Usage: system(\"semaphore\",<cmd>,int)");
949 if (strcmp(sys_cmd,
"reserve")==0)
957 res->data=(
void*)(
long)
p;
964 if (strcmp(sys_cmd,
"reservedLink")==0)
973 if (strcmp(sys_cmd,
"install")==0)
979 (
int)(
long)
h->next->next->next->Data(),
986 if (strcmp(sys_cmd,
"newstruct")==0)
992 char *n=(
char*)
h->Data();
999 newstruct_desc desc=(newstruct_desc)bb->data;
1003 else Werror(
"'%s' is not a newstruct",n);
1005 else Werror(
"'%s' is not a blackbox object",n);
1011 if (strcmp(sys_cmd,
"blackbox")==0)
1018 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1019 if (strcmp(sys_cmd,
"absFact") == 0)
1036 l->m[0].data=(
void *)
f;
1038 l->m[1].data=(
void *)
v;
1040 l->m[2].data=(
void*) mipos;
1042 l->m[3].data=(
void*) (
long) n;
1043 res->data=(
void *)
l;
1052 if (strcmp(sys_cmd,
"LLL") == 0)
1075 #if __FLINT_RELEASE >= 20500
1076 if (strcmp(sys_cmd,
"LLL_Flint") == 0)
1097 WerrorS(
"matrix,int or bigint,int expected");
1102 if(((
int)((
long)(
h->next->Data())) != 0) && (
int)((
long)(
h->next->Data()) != 1))
1104 WerrorS(
"int is different from 0, 1");
1108 if((
long)(
h->next->Data()) == 0)
1123 if((
long)(
h->next->Data()) == 1)
1129 for(
int i = 1;
i<=
m->rows();
i++)
1147 for(
int i = 1;
i<=
m->rows();
i++)
1170 if(strcmp(sys_cmd,
"pcvLAddL")==0)
1175 if(strcmp(sys_cmd,
"pcvPMulL")==0)
1180 if(strcmp(sys_cmd,
"pcvMinDeg")==0)
1185 if(strcmp(sys_cmd,
"pcvP2CV")==0)
1190 if(strcmp(sys_cmd,
"pcvCV2P")==0)
1195 if(strcmp(sys_cmd,
"pcvDim")==0)
1200 if(strcmp(sys_cmd,
"pcvBasis")==0)
1207 #ifdef HAVE_EIGENVAL
1208 if(strcmp(sys_cmd,
"hessenberg")==0)
1215 #ifdef HAVE_EIGENVAL
1216 if(strcmp(sys_cmd,
"eigenvals")==0)
1223 #ifdef HAVE_EIGENVAL
1224 if(strcmp(sys_cmd,
"rowelim")==0)
1231 #ifdef HAVE_EIGENVAL
1232 if(strcmp(sys_cmd,
"rowcolswap")==0)
1240 if(strcmp(sys_cmd,
"gmsnf")==0)
1247 if(strcmp(sys_cmd,
"contributors") == 0)
1251 "Olaf Bachmann, Michael Brickenstein, Hubert Grassmann, Kai Krueger, Victor Levandovskyy, Wolfgang Neumann, Thomas Nuessler, Wilfred Pohl, Jens Schmidt, Mathias Schulze, Thomas Siebert, Ruediger Stobbe, Moritz Wenk, Tim Wichmann");
1256 #ifdef HAVE_SPECTRUM
1257 if(strcmp(sys_cmd,
"spectrum") == 0)
1271 if(((
long)
h->next->Data())==1L)
1277 if(strcmp(sys_cmd,
"semic") == 0)
1283 if (
h->next->next==
NULL)
1285 else if (
h->next->next->Typ()==
INT_CMD)
1292 if(strcmp(sys_cmd,
"spadd") == 0)
1303 if(strcmp(sys_cmd,
"spmul") == 0)
1315 #define HAVE_SHEAFCOH_TRICKS 1
1317 #ifdef HAVE_SHEAFCOH_TRICKS
1318 if(strcmp(sys_cmd,
"tensorModuleMult")==0)
1324 int m = (int)( (
long)
h->Data() );
1325 ideal
M = (ideal)
h->next->Data();
1336 if (strcmp(sys_cmd,
"twostd") == 0)
1341 I=(ideal)
h->CopyD();
1355 if (strcmp(sys_cmd,
"bracket") == 0)
1360 poly
p=(poly)
h->CopyD();
1362 poly q=(poly)
h->Data();
1373 if (strcmp(sys_cmd,
"env")==0)
1377 ring r = (ring)
h->Data();
1384 WerrorS(
"`system(\"env\",<ring>)` expected");
1392 if (strcmp(sys_cmd,
"opp")==0)
1396 ring r=(ring)
h->Data();
1403 WerrorS(
"`system(\"opp\",<ring>)` expected");
1411 if (strcmp(sys_cmd,
"oppose")==0)
1414 && (
h->next!=
NULL))
1416 ring Rop = (ring)
h->Data();
1429 WerrorS(
"`system(\"oppose\",<ring>,<poly>)` expected");
1439 if (strcmp(sys_cmd,
"walkNextWeight") == 0)
1446 Werror(
"system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1450 res->data = (
void*) walkNextWeight(((
intvec*)
h->Data()),
1452 (ideal)
h->next->next->Data());
1453 if (
res->data ==
NULL ||
res->data == (
void*) 1L)
1469 if (strcmp(sys_cmd,
"walkInitials") == 0)
1473 WerrorS(
"system(\"walkInitials\", ideal) expected");
1476 res->data = (
void*) walkInitials((ideal)
h->Data());
1486 if (strcmp(sys_cmd,
"walkAddIntVec") == 0)
1492 res->data = (
intvec*) walkAddIntVec(arg1, arg2);
1501 #ifdef MwaklNextWeight
1502 if (strcmp(sys_cmd,
"MwalkNextWeight") == 0)
1509 Werror(
"system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1515 ideal arg3 = (ideal)
h->next->next->Data();
1526 if(strcmp(sys_cmd,
"Mivdp") == 0)
1530 WerrorS(
"system(\"Mivdp\", int) expected");
1533 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1535 Werror(
"system(\"Mivdp\" ...) intvecs not of length %d\n",
1539 int arg1 = (int) ((
long)(
h->Data()));
1549 if(strcmp(sys_cmd,
"Mivlp") == 0)
1553 WerrorS(
"system(\"Mivlp\", int) expected");
1556 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1558 Werror(
"system(\"Mivlp\" ...) intvecs not of length %d\n",
1562 int arg1 = (int) ((
long)(
h->Data()));
1573 if(strcmp(sys_cmd,
"MpDiv") == 0)
1577 poly arg1 = (poly)
h->Data();
1578 poly arg2 = (poly)
h->next->Data();
1579 poly
result = MpDiv(arg1, arg2);
1590 if(strcmp(sys_cmd,
"MpMult") == 0)
1594 poly arg1 = (poly)
h->Data();
1595 poly arg2 = (poly)
h->next->Data();
1596 poly
result = MpMult(arg1, arg2);
1606 if (strcmp(sys_cmd,
"MivSame") == 0)
1627 res->data = (
void*)(
long)
MivSame(arg1, arg2);
1634 if (strcmp(sys_cmd,
"M3ivSame") == 0)
1657 res->data = (
void*)(
long)
M3ivSame(arg1, arg2, arg3);
1664 if(strcmp(sys_cmd,
"MwalkInitialForm") == 0)
1670 Werror(
"system \"MwalkInitialForm\"...) intvec not of length %d\n",
1674 ideal
id = (ideal)
h->Data();
1686 if(strcmp(sys_cmd,
"MivMatrixOrder") == 0)
1690 WerrorS(
"system(\"MivMatrixOrder\",intvec) expected");
1703 if(strcmp(sys_cmd,
"MivMatrixOrderdp") == 0)
1707 WerrorS(
"system(\"MivMatrixOrderdp\",intvec) expected");
1710 int arg1 = (int) ((
long)(
h->Data()));
1720 if(strcmp(sys_cmd,
"MPertVectors") == 0)
1724 ideal arg1 = (ideal)
h->Data();
1726 int arg3 = (int) ((
long)(
h->next->next->Data()));
1736 if(strcmp(sys_cmd,
"MPertVectorslp") == 0)
1740 ideal arg1 = (ideal)
h->Data();
1742 int arg3 = (int) ((
long)(
h->next->next->Data()));
1752 if(strcmp(sys_cmd,
"Mfpertvector") == 0)
1756 ideal arg1 = (ideal)
h->Data();
1767 if(strcmp(sys_cmd,
"MivUnit") == 0)
1771 int arg1 = (int) ((
long)(
h->Data()));
1781 if(strcmp(sys_cmd,
"MivWeightOrderlp") == 0)
1795 if(strcmp(sys_cmd,
"MivWeightOrderdp") == 0)
1799 WerrorS(
"system(\"MivWeightOrderdp\",intvec) expected");
1813 if(strcmp(sys_cmd,
"MivMatrixOrderlp") == 0)
1817 WerrorS(
"system(\"MivMatrixOrderlp\",int) expected");
1820 int arg1 = (int) ((
long)(
h->Data()));
1830 if (strcmp(sys_cmd,
"MkInterRedNextWeight") == 0)
1837 Werror(
"system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1843 ideal arg3 = (ideal)
h->next->next->Data();
1853 #ifdef MPertNextWeight
1854 if (strcmp(sys_cmd,
"MPertNextWeight") == 0)
1860 Werror(
"system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1865 ideal arg2 = (ideal)
h->next->Data();
1866 int arg3 = (int)
h->next->next->Data();
1877 #ifdef Mivperttarget
1878 if (strcmp(sys_cmd,
"Mivperttarget") == 0)
1882 ideal arg1 = (ideal)
h->Data();
1883 int arg2 = (int)
h->next->Data();
1894 if (strcmp(sys_cmd,
"Mwalk") == 0)
1901 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d\n",
1905 ideal arg1 = (ideal)
h->CopyD();
1908 ring arg4 = (ring)
h->next->next->next->Data();
1909 int arg5 = (int) (
long)
h->next->next->next->next->Data();
1910 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
1911 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
1921 if (strcmp(sys_cmd,
"Mwalk") == 0)
1930 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
1934 ideal arg1 = (ideal)
h->Data();
1937 ring arg4 = (ring)
h->next->next->next->Data();
1938 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3,arg4);
1945 if (strcmp(sys_cmd,
"Mpwalk") == 0)
1952 Werror(
"system(\"Mpwalk\" ...) intvecs not of length %d\n",
currRing->N);
1955 ideal arg1 = (ideal)
h->Data();
1956 int arg2 = (int) (
long)
h->next->Data();
1957 int arg3 = (int) (
long)
h->next->next->Data();
1960 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
1961 int arg7 = (int) (
long)
h->next->next->next->next->next->next->Data();
1962 int arg8 = (int) (
long)
h->next->next->next->next->next->next->next->Data();
1963 ideal
result = (ideal)
Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
1973 if (strcmp(sys_cmd,
"Mrwalk") == 0)
1982 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
1986 ideal arg1 = (ideal)
h->Data();
1989 int arg4 = (int)(
long)
h->next->next->next->Data();
1990 int arg5 = (int)(
long)
h->next->next->next->next->Data();
1991 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
1992 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
1993 ideal
result = (ideal)
Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2002 if (strcmp(sys_cmd,
"MAltwalk1") == 0)
2009 Werror(
"system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2013 ideal arg1 = (ideal)
h->Data();
2014 int arg2 = (int) ((
long)(
h->next->Data()));
2015 int arg3 = (int) ((
long)(
h->next->next->Data()));
2028 if (strcmp(sys_cmd,
"Mfwalk_alt") == 0)
2035 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2039 ideal arg1 = (ideal)
h->Data();
2042 int arg4 = (int)
h->next->next->next->Data();
2043 ideal
result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2053 if (strcmp(sys_cmd,
"Mfwalk") == 0)
2060 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2064 ideal arg1 = (ideal)
h->Data();
2067 int arg4 = (int)(
long)
h->next->next->next->Data();
2068 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2069 ideal
result = (ideal)
Mfwalk(arg1, arg2, arg3, arg4, arg5);
2078 if (strcmp(sys_cmd,
"Mfrwalk") == 0)
2095 Werror(
"system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2100 ideal arg1 = (ideal)
h->Data();
2103 int arg4 = (int)(
long)
h->next->next->next->Data();
2104 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2105 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2106 ideal
result = (ideal)
Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2113 if (strcmp(sys_cmd,
"Mprwalk") == 0)
2122 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2126 ideal arg1 = (ideal)
h->Data();
2129 int arg4 = (int)(
long)
h->next->next->next->Data();
2130 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2131 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2132 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2133 int arg8 = (int)(
long)
h->next->next->next->next->next->next->next->Data();
2134 int arg9 = (int)(
long)
h->next->next->next->next->next->next->next->next->Data();
2135 ideal
result = (ideal)
Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2145 if (strcmp(sys_cmd,
"TranMImprovwalk") == 0)
2152 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2156 ideal arg1 = (ideal)
h->Data();
2169 if (strcmp(sys_cmd,
"MAltwalk2") == 0)
2176 Werror(
"system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2180 ideal arg1 = (ideal)
h->Data();
2192 if (strcmp(sys_cmd,
"TranMImprovwalk") == 0)
2199 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2203 ideal arg1 = (ideal)
h->Data();
2206 int arg4 = (int) ((
long)(
h->next->next->next->Data()));
2217 if (strcmp(sys_cmd,
"TranMrImprovwalk") == 0)
2222 h->next->next->next ==
NULL ||
h->next->next->next->Typ() !=
INT_CMD ||
2223 h->next->next->next ==
NULL ||
h->next->next->next->next->Typ() !=
INT_CMD ||
2224 h->next->next->next ==
NULL ||
h->next->next->next->next->next->Typ() !=
INT_CMD)
2226 WerrorS(
"system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2232 Werror(
"system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n",
currRing->N);
2235 ideal arg1 = (ideal)
h->Data();
2238 int arg4 = (int)(
long)
h->next->next->next->Data();
2239 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2240 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2241 ideal
result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2251 #ifndef MAKE_DISTRIBUTION
2262 #ifdef HAVE_EXTENDED_SYSTEM
2266 # include "hc_newton.h"
2273 char *sys_cmd=(
char *)(
h->Data());
2276 if (strcmp(sys_cmd,
"syz") == 0)
2280 const char *
s=(
const char *)
h->Data();
2281 if (strcmp(
s,
"posInT_EcartFDegpLength")==0)
2283 else if (strcmp(
s,
"posInT_FDegpLength")==0)
2285 else if (strcmp(
s,
"posInT_pLength")==0)
2287 else if (strcmp(
s,
"posInT0")==0)
2289 else if (strcmp(
s,
"posInT1")==0)
2291 else if (strcmp(
s,
"posInT2")==0)
2293 else if (strcmp(
s,
"posInT11")==0)
2295 else if (strcmp(
s,
"posInT110")==0)
2297 else if (strcmp(
s,
"posInT13")==0)
2299 else if (strcmp(
s,
"posInT15")==0)
2301 else if (strcmp(
s,
"posInT17")==0)
2303 else if (strcmp(
s,
"posInT17_c")==0)
2305 else if (strcmp(
s,
"posInT19")==0)
2307 else PrintS(
"valid posInT:0,1,2,11,110,13,15,17,17_c,19,_EcartFDegpLength,_FDegpLength,_pLength,_EcartpLength\n");
2319 if(strcmp(sys_cmd,
"locNF")==0)
2324 poly
f=(poly)
h->Data();
2326 ideal
m=(ideal)
h->Data();
2329 int n=(int)((
long)
h->Data());
2394 if(strcmp(sys_cmd,
"p")==0)
2399 WarnS(
"Sorry: not available for release build!");
2405 if(strcmp(sys_cmd,
"setsyzcomp")==0)
2409 int k = (int)(
long)
h->Data();
2417 if(strcmp(sys_cmd,
"r")==0)
2422 WarnS(
"Sorry: not available for release build!");
2434 if(strcmp(sys_cmd,
"changeRing")==0)
2438 for (
int i = 1;
i <= varN;
i++)
2441 sprintf(
h,
"x%d",
i);
2446 res->data = (
void*)0L;
2451 if(strcmp(sys_cmd,
"mtrack")==0)
2462 char *fn=(
char*)
h->Data();
2463 fd = fopen(fn,
"w");
2465 Warn(
"Can not open %s for writing og mtrack. Using stdout",fn);
2469 max = (int)(
long)
h->Data();
2478 WerrorS(
"system(\"mtrack\",..) is not implemented in this version");
2485 if(strcmp(sys_cmd,
"backtrace")==0)
2493 #if !defined(OM_NDEBUG)
2495 if (strcmp(sys_cmd,
"omMemoryTest")==0)
2499 PrintS(
"\n[om_Info]: \n");
2501 #define OM_PRINT(name) Print(" %-22s : %10ld \n", #name, om_Info . name)
2502 OM_PRINT(MaxBytesSystem);
2503 OM_PRINT(CurrentBytesSystem);
2504 OM_PRINT(MaxBytesSbrk);
2505 OM_PRINT(CurrentBytesSbrk);
2506 OM_PRINT(MaxBytesMmap);
2507 OM_PRINT(CurrentBytesMmap);
2508 OM_PRINT(UsedBytes);
2509 OM_PRINT(AvailBytes);
2510 OM_PRINT(UsedBytesMalloc);
2511 OM_PRINT(AvailBytesMalloc);
2512 OM_PRINT(MaxBytesFromMalloc);
2513 OM_PRINT(CurrentBytesFromMalloc);
2514 OM_PRINT(MaxBytesFromValloc);
2515 OM_PRINT(CurrentBytesFromValloc);
2516 OM_PRINT(UsedBytesFromValloc);
2517 OM_PRINT(AvailBytesFromValloc);
2519 OM_PRINT(UsedPages);
2520 OM_PRINT(AvailPages);
2521 OM_PRINT(MaxRegionsAlloc);
2522 OM_PRINT(CurrentRegionsAlloc);
2527 PrintS(
"\n[om_Opts]: \n");
2528 #define OM_PRINT(format, name) Print(" %-22s : %10" format"\n", #name, om_Opts . name)
2529 OM_PRINT(
"d", MinTrack);
2530 OM_PRINT(
"d", MinCheck);
2531 OM_PRINT(
"d", MaxTrack);
2532 OM_PRINT(
"d", MaxCheck);
2533 OM_PRINT(
"d", Keep);
2534 OM_PRINT(
"d", HowToReportErrors);
2535 OM_PRINT(
"d", MarkAsStatic);
2536 OM_PRINT(
"u", PagesPerRegion);
2537 OM_PRINT(
"p", OutOfMemoryFunc);
2538 OM_PRINT(
"p", MemoryLowFunc);
2539 OM_PRINT(
"p", ErrorHook);
2544 Print(
"\n\n[om_ErrorStatus] : '%s' (%s)\n",
2547 Print(
"[om_InternalErrorStatus]: '%s' (%s)\n",
2560 #if defined(PDEBUG) || defined(PDIV_DEBUG)
2561 if(strcmp(sys_cmd,
"pDivStat")==0)
2571 if(strcmp(sys_cmd,
"red")==0)
2586 if(strcmp(sys_cmd,
"fastcomb")==0)
2594 WarnS(
"Wrong types for poly= comb(ideal,poly)");
2599 (ideal)
h->Data(),(poly)
h->next->Data());
2607 if(strcmp(sys_cmd,
"comb")==0)
2615 WarnS(
"Wrong types for poly= comb(ideal,poly)");
2620 (ideal)
h->Data(),(poly)
h->next->Data());
2629 if(strcmp(sys_cmd,
"listall")==0)
2631 void listall(
int showproc);
2633 if ((
h!=
NULL) && (
h->Typ()==
INT_CMD)) showproc=(int)((
long)
h->Data());
2641 if(strcmp(sys_cmd,
"proclist")==0)
2643 void piShowProcList();
2651 if(strcmp(sys_cmd,
"newton")==0)
2655 || (
h->next->next->Typ()!=
INT_CMD))
2657 WerrorS(
"system(\"newton\",<poly>,<int>,<int>) expected");
2660 poly
p=(poly)(
h->Data());
2679 (
int) (
h->next->Data()),
2680 (
int) (
h->next->next->Data())
2693 L->
m[1].
data=(
void *)(
long)r.achse;
2695 L->
m[2].
data=(
void *)(
long)r.deg;
2699 L->
m[3].
data=(
void *)(
long)r.anz_punkte;
2701 int anz = r.anz_punkte;
2704 for (
i=0;
i<anz*
dim;
i++)
2714 (*w)[
i] = r.deg_tab[
i];
2717 while (r.deg_tab[
i-1] != -2);
2728 res->data=(
void *)L;
2751 if (strcmp(sys_cmd,
"minpoly") == 0)
2755 Werror(
"expected exactly one argument: %s",
2756 "a square matrix with number entries");
2766 WerrorS(
"expected exactly one argument: "
2767 "a square matrix with number entries");
2774 res->data = (
void *)theMinPoly;
2775 for (
int i = 0;
i < n;
i++)
delete[] ml[
i];
2777 delete[] polyCoeffs;
2784 if (strcmp(sys_cmd,
"sdb_flags") == 0)
2792 WerrorS(
"system(\"sdb_flags\",`int`) expected");
2801 if (strcmp(sys_cmd,
"sdb_edit") == 0)
2810 WerrorS(
"system(\"sdb_edit\",`proc`) expected");
2819 if (strcmp(sys_cmd,
"GF") == 0)
2836 if (strcmp(sys_cmd,
"svd") == 0)
2847 if (strcmp(sys_cmd,
"redNF_ring")==0)
2850 poly
f = (poly)
h->Data();
2852 ideal
G = (ideal)
h->Data();
2860 if (strcmp(sys_cmd,
"hilbroune") == 0)
2872 if (strcmp(sys_cmd,
"f5")==0)
2881 ideal
G = (ideal)
h->Data();
2885 opt = (int) (
long)
h->Data();
2893 plus = (int) (
long)
h->Data();
2901 termination = (int) (
long)
h->Data();
2907 res->data=(ideal)
F5main(
G,r,opt,plus,termination);
2914 if (strcmp(sys_cmd,
"NF_ring")==0)
2917 poly
f = (poly)
h->Data();
2919 ideal
G = (ideal)
h->Data();
2925 if (strcmp(sys_cmd,
"spoly")==0)
2927 poly
f =
pCopy((poly)
h->Data());
2929 poly
g =
pCopy((poly)
h->Data());
2936 if (strcmp(sys_cmd,
"testGB")==0)
2938 ideal I = (ideal)
h->Data();
2940 ideal GI = (ideal)
h->Data();
2942 res->data = (
void *)(
long)
testGB(I, GI);
2949 if ( (strcmp(sys_cmd,
"AltVarStart") == 0) || (strcmp(sys_cmd,
"AltVarEnd") == 0) )
2955 WerrorS(
"`system(\"AltVarStart/End\"[,<ring>])` expected");
2963 if(strcmp(sys_cmd,
"AltVarStart") == 0)
2970 WerrorS(
"`system(\"AltVarStart/End\",<ring>) requires a SCA ring");
2976 #ifdef HAVE_RATGRING
2977 if (strcmp(sys_cmd,
"intratNF") == 0)
2992 I=(ideal)
h->CopyD();
3000 is=(int)((
long)(
h->Data()));
3008 for(
k=0;
k < id;
k++)
3012 PrintS(
"starting redRat\n");
3030 if (strcmp(sys_cmd,
"ratNF") == 0)
3049 is=(int)((
long)(
h->Data()));
3064 if (strcmp(sys_cmd,
"ratSpoly") == 0)
3082 is=(int)((
long)(
h->Data()));
3098 if (strcmp(sys_cmd,
"ratVar") == 0)
3115 return (start==0)||(end==0)||(start>end);
3119 if (strcmp(sys_cmd,
"unifastmult")==0)
3121 poly
f = (poly)
h->Data();
3123 poly
g=(poly)
h->Data();
3129 if (strcmp(sys_cmd,
"multifastmult")==0)
3131 poly
f = (poly)
h->Data();
3133 poly
g=(poly)
h->Data();
3139 if (strcmp(sys_cmd,
"mults")==0)
3146 if (strcmp(sys_cmd,
"fastpower")==0)
3149 poly
f = (poly)
h->Data();
3151 int n=(int)((
long)
h->Data());
3157 if (strcmp(sys_cmd,
"normalpower")==0)
3159 poly
f = (poly)
h->Data();
3161 int n=(int)((
long)
h->Data());
3167 if (strcmp(sys_cmd,
"MCpower")==0)
3170 poly
f = (poly)
h->Data();
3172 int n=(int)((
long)
h->Data());
3178 if (strcmp(sys_cmd,
"bit_subst")==0)
3181 poly outer = (poly)
h->Data();
3183 poly inner=(poly)
h->Data();
3190 if (strcmp(sys_cmd,
"gcd") == 0)
3210 int d=(int)(
long)
h->next->Data();
3211 char *
s=(
char *)
h->Data();
3229 if (strcmp(sys_cmd,
"subring") == 0)
3243 if (strcmp(sys_cmd,
"HNF") == 0)
3265 WerrorS(
"expected `system(\"HNF\",<matrix|intmat|bigintmat>)`");
3273 if (strcmp (sys_cmd,
"probIrredTest") == 0)
3278 char *
s=(
char *)
h->next->Data();
3290 if(strcmp(sys_cmd,
"GNUmpLoad")==0)
3294 char* filename = (
char*)
h->Data();
3295 FILE*
f = fopen(filename,
"r");
3298 WerrorS(
"invalid file name (in paths use '/')");
3301 mpz_t
m; mpz_init(
m);
3302 mpz_inp_str(
m,
f, 10);
3306 res->data = (
void*)n;
3311 WerrorS(
"expected valid file name as a string");
3323 if(strcmp(sys_cmd,
"intvecMatchingSegments")==0)
3327 (
h->next->next ==
NULL))
3332 int validEntries = 0;
3333 for (
int k = 0;
k <= ivec->
rows() - jvec->
rows();
k++)
3335 if (memcmp(&(*ivec)[
k], &(*jvec)[0],
3336 sizeof(
int) * jvec->
rows()) == 0)
3338 if (validEntries == 0)
3342 r->
resize(validEntries + 1);
3343 (*r)[validEntries] =
k + 1;
3349 res->data = (
void*)r;
3354 WerrorS(
"expected two non-empty intvecs as arguments");
3365 if(strcmp(sys_cmd,
"intvecOverlap")==0)
3369 (
h->next->next ==
NULL))
3373 int ir = ivec->
rows();
int jr = jvec->
rows();
3374 int r = jr;
if (ir < jr) r = ir;
3375 while ((r >= 1) && (memcmp(&(*ivec)[ir - r], &(*jvec)[0],
3376 sizeof(
int) * r) != 0))
3379 res->data = (
void*)(
long)r;
3384 WerrorS(
"expected two non-empty intvecs as arguments");
3390 if(strcmp(sys_cmd,
"henselfactors")==0)
3395 (
h->next->next->next !=
NULL) &&
3396 (
h->next->next->next->Typ() ==
POLY_CMD) &&
3397 (
h->next->next->next->next !=
NULL) &&
3398 (
h->next->next->next->next->Typ() ==
POLY_CMD) &&
3399 (
h->next->next->next->next->next !=
NULL) &&
3400 (
h->next->next->next->next->next->Typ() ==
INT_CMD) &&
3401 (
h->next->next->next->next->next->next ==
NULL))
3403 int xIndex = (int)(
long)
h->Data();
3404 int yIndex = (int)(
long)
h->next->Data();
3405 poly hh = (poly)
h->next->next->Data();
3406 poly f0 = (poly)
h->next->next->next->Data();
3407 poly g0 = (poly)
h->next->next->next->next->Data();
3408 int d = (int)(
long)
h->next->next->next->next->next->Data();
3416 res->data = (
char *)L;
3421 WerrorS(
"expected argument list (int, int, poly, poly, poly, int)");
3428 if (strcmp(sys_cmd,
"astep") == 0)
3433 I=(ideal)
h->CopyD();
3446 if (strcmp(sys_cmd,
"PrintMat") == 0)
3456 a=(int)((
long)(
h->Data()));
3461 b=(int)((
long)(
h->Data()));
3476 metric=(int)((
long)(
h->Data()));
3487 if(strcmp(sys_cmd,
"NCUseExtensions")==0)
3500 if(strcmp(sys_cmd,
"NCGetType")==0)
3506 res->data=(
void *)(-1L);
3513 if(strcmp(sys_cmd,
"ForceSCA")==0)
3520 b = (int)((
long)(
h->Data()));
3526 e = (int)((
long)(
h->Data()));
3537 if(strcmp(sys_cmd,
"ForceNewNCMultiplication")==0)
3549 if(strcmp(sys_cmd,
"ForceNewOldNCMultiplication")==0)
3561 if(strcmp(sys_cmd,
"test64")==0)
3577 Print(
"SIZEOF_LONG=%d\n",SIZEOF_LONG);
3583 if(strcmp(sys_cmd,
"cache_chinrem")==0)
3594 if(strcmp(sys_cmd,
"LU")==0)
3604 res->data=(
char*)bb;
3609 WerrorS(
"system(\"LU\",<cmatrix>) expected");
3616 if(strcmp(sys_cmd,
"sort")==0)
3626 if(strcmp(sys_cmd,
"uniq")==0)
3636 if(strcmp(sys_cmd,
"GF")==0)
3641 int p=(int)(
long)
h->Data();
3642 int n=(int)(
long)
h->next->Data();
3643 char *
v=(
char*)
h->next->next->CopyD();
3659 if(strcmp(sys_cmd,
"power1")==0)
3662 poly
f=(poly)
h->CopyD();
3664 res->data=(
void *)
g;
3668 if(strcmp(sys_cmd,
"power2")==0)
3671 poly
f=(poly)
h->Data();
3673 for(
int i=0;
i<2000;
i++)
3675 res->data=(
void *)
g;
3678 if(strcmp(sys_cmd,
"power3")==0)
3681 poly
f=(poly)
h->Data();
3692 poly p1536=
pMult(p1024,p512);
3693 poly p1792=
pMult(p1536,p256);
3694 poly p1920=
pMult(p1792,p128);
3695 poly p1984=
pMult(p1920,p64);
3696 poly p2000=
pMult(p1984,p16);
3697 res->data=(
void *)p2000;
3717 #ifdef HAVE_CCLUSTER
3718 if(strcmp(sys_cmd,
"ccluster")==0)
3728 int pol_with_complex_coeffs=0;
3730 pol_with_complex_coeffs=1;
3736 fmpq_poly_t fre, fim;
3738 if (pol_with_complex_coeffs==1)
3743 fmpq_t center_re,center_im,boxsize,eps;
3749 int n=fmpq_poly_length(fre);
3750 fmpq_t* re_part=(fmpq_t*)
omAlloc(n*
sizeof(fmpq_t));
3751 fmpq_t* im_part=(fmpq_t*)
omAlloc(n*
sizeof(fmpq_t));
3753 for(
int i=0;
i<n;
i++)
3754 { fmpq_init(re_part[
i]); fmpq_init(im_part[
i]); }
3759 long nb_threads = (long)
feOptValue(FE_OPT_CPUS);
3760 strategy = strategy+(nb_threads<<6);
3763 if (pol_with_complex_coeffs==0)
3764 nn=ccluster_interface_poly_real(re_part,im_part,
mult,fre,center_re,center_im,boxsize,eps,strategy,verbosity);
3766 nn=ccluster_interface_poly_real_imag(re_part,im_part,
mult,fre,fim,center_re,center_im,boxsize,eps,strategy,verbosity);
3770 for(
int i=0;
i<nn;
i++)
3784 for(
int i=n-1;
i>=0;
i--) { fmpq_clear(re_part[
i]); fmpq_clear(im_part[
i]); }
3788 fmpq_clear(center_re); fmpq_clear(center_im); fmpq_clear(boxsize); fmpq_clear(eps);
3789 fmpq_poly_clear(fre);
3790 if (pol_with_complex_coeffs==1) fmpq_poly_clear(fim);
3802 if(strcmp(sys_cmd,
"evaluate")==0)
3804 extern number
maEvalAt(
const poly
p,
const number* pt,
const ring r);
3807 WerrorS(
"expected system(\"evaluate\",<poly>,..)");
3810 poly
p=(poly)
h->Data();
3817 WerrorS(
"system(\"evaluate\",<poly>,<number>..) - expect number");
3820 pt[
i]=(number)
h->Data();
#define BIMATELEM(M, I, J)
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
void printBlackboxTypes()
list all defined type (for debugging)
EXTERN_VAR int singular_homog_flag
static const int SW_USE_CHINREM_GCD
set to 1 to use modular gcd over Z
static const int SW_USE_FL_GCD_P
set to 1 to use Flints gcd over F_p
static const int SW_USE_EZGCD_P
set to 1 to use EZGCD over F_q
static const int SW_USE_EZGCD
set to 1 to use EZGCD over Z
static const int SW_USE_FL_GCD_0
set to 1 to use Flints gcd over Q/Z
static CanonicalForm bound(const CFMatrix &M)
void factoryseed(int s)
random seed initializer
CanonicalForm convSingPFactoryP(poly p, const ring r)
char * singclap_neworder(ideal I, const ring r)
matrix singntl_HNF(matrix m, const ring s)
matrix singntl_LLL(matrix m, const ring s)
ideal singclap_absFactorize(poly f, ideal &mipos, intvec **exps, int &numFactors, const ring r)
gmp_complex numbers based on
void resize(int new_length)
Class used for (list of) interpreter objects.
INLINE_THIS void Init(int l=0)
Coefficient rings, fields and other domains suitable for Singular polynomials.
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 ....
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
CanonicalForm n_convSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
void n_Print(number &a, const coeffs r)
print a number (BEWARE of string buffers!) mostly for debugging
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
number n_convFactoryNSingN(const CanonicalForm n, const coeffs r)
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE number n_InitMPZ(mpz_t n, const coeffs r)
conversion of a GMP integer to number
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Creation data needed for finite fields.
void countedref_reference_load()
Initialize blackbox types 'reference' and 'shared', or both.
void countedref_shared_load()
poly uni_subst_bits(poly outer_uni, poly inner_multi, ring r)
matrix evRowElim(matrix M, int i, int j, int k)
matrix evHessenberg(matrix M)
matrix evSwap(matrix M, int i, int j)
lists evEigenvals(matrix M)
void error(const char *fmt,...)
ideal F5main(ideal id, ring r, int opt, int plus, int termination)
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
CFList int bool & irred
[in,out] Is A irreducible?
int probIrredTest(const CanonicalForm &F, double error)
given some error probIrredTest detects irreducibility or reducibility of F with confidence level 1-er...
poly unifastmult(poly f, poly g, ring r)
poly pFastPowerMC(poly f, int n, ring r)
static int max(int a, int b)
poly pFastPower(poly f, int n, ring r)
poly multifastmult(poly f, poly g, ring r)
void WerrorS(const char *s)
const char * feSetOptValue(feOptIndex opt, char *optarg)
feOptIndex feGetOptIndex(const char *name)
static void * feOptValue(feOptIndex opt)
EXTERN_VAR struct fe_option feOptSpec[]
static char * feResource(feResourceConfig config, int warn)
void feStringAppendBrowsers(int warn)
STATIC_VAR int nfMinPoly[16]
This file is work in progress and currently not part of the official Singular.
void convSingPFlintP(fmpq_poly_t res, poly p, const ring r)
void convSingNFlintN(fmpz_t f, mpz_t z)
bigintmat * singflint_LLL(bigintmat *A, bigintmat *T)
void convFlintNSingN(mpz_t z, fmpz_t f)
number maEvalAt(const poly p, const number *pt, const ring r)
evaluate the polynomial p at the pt given by the array pt
lists gmsNF(ideal p, ideal g, matrix B, int D, int K)
void HilbertSeries_OrbitData(ideal S, int lV, bool IG_CASE, bool mgrad, bool odp, int trunDegHs)
ideal RightColonOperation(ideal S, poly w, int lV)
ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing)
STATIC_VAR coordinates * points
static BOOLEAN length(leftv result, leftv arg)
#define IMATELEM(M, I, J)
BOOLEAN jjSORTLIST(leftv, leftv arg)
BOOLEAN jjUNIQLIST(leftv, leftv arg)
BOOLEAN spaddProc(leftv result, leftv first, leftv second)
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 (...
BOOLEAN semicProc3(leftv res, leftv u, leftv v, leftv w)
BOOLEAN spectrumfProc(leftv result, leftv first)
BOOLEAN spmulProc(leftv result, leftv first, leftv second)
BOOLEAN spectrumProc(leftv result, leftv first)
ring rSubring(ring org_ring, sleftv *rv)
BOOLEAN semicProc(leftv res, leftv u, leftv v)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
poly fglmLinearCombination(ideal source, poly monset)
poly fglmNewLinearCombination(ideal source, poly monset)
poly kNFBound(ideal F, ideal Q, poly p, int bound, int syzComp, int lazyReduce)
VAR int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
VAR int(* test_PosInT)(const TSet T, const int tl, LObject &h)
int posInT17(const TSet set, const int length, LObject &p)
int posInT11(const TSet set, const int length, LObject &p)
int posInT1(const TSet set, const int length, LObject &p)
int posInT0(const TSet, const int length, LObject &)
int posInT2(const TSet set, const int length, LObject &p)
int posInT_pLength(const TSet set, const int length, LObject &p)
int posInT13(const TSet set, const int length, LObject &p)
int posInT17_c(const TSet set, const int length, LObject &p)
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
int posInT15(const TSet set, const int length, LObject &p)
int posInT110(const TSet set, const int length, LObject &p)
int posInT19(const TSet set, const int length, LObject &p)
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
BOOLEAN kVerify2(ideal F, ideal Q)
BOOLEAN kVerify1(ideal F, ideal Q)
static bool rIsSCA(const ring r)
poly pOppose(ring Rop_src, poly p, const ring Rop_dst)
opposes a vector p from Rop to currRing (dst!)
int setNCExtensions(int iMask)
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
static nc_type & ncRingType(nc_struct *p)
matrix nc_PrintMat(int a, int b, ring r, int metric)
returns matrix with the info on noncomm multiplication
bool sca_Force(ring rGR, int b, int e)
bool luSolveViaLDUDecomp(const matrix pMat, const matrix lMat, const matrix dMat, const matrix uMat, const poly l, const poly u, const poly lTimesU, 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 LDU-decomposit...
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,...
void lduDecomp(const matrix aMat, matrix &pMat, matrix &lMat, matrix &dMat, matrix &uMat, poly &l, poly &u, poly &lTimesU)
LU-decomposition of a given (m x n)-matrix with performing only those divisions that yield zero remai...
matrix mp_Transp(matrix a, const ring R)
ideal sm_UnFlatten(ideal a, int col, const ring R)
matrix mp_InitI(int r, int c, int v, const ring R)
make it a v * unit matrix
matrix mpNew(int r, int c)
create a r x c zero-matrix
ideal sm_Flatten(ideal a, const ring R)
#define MATELEM(mat, i, j)
1-based access to matrix
unsigned long * computeMinimalPolynomial(unsigned long **matrix, unsigned n, unsigned long p)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
This file provides miscellaneous functionality.
EXTERN_VAR size_t gmp_output_digits
bool complexNearZero(gmp_complex *c, int digits)
The main handler for Singular numbers which are suitable for Singular polynomials.
BOOLEAN ncInitSpecialPairMultiplication(ring r)
ideal Approx_Step(ideal L)
Ann: ???
ideal twostd(ideal I)
Compute two-sided GB:
void newstructShow(newstruct_desc d)
BOOLEAN newstruct_set_proc(const char *bbname, const char *func, int args, procinfov pr)
#define omFreeSize(addr, size)
void omMarkAsStaticAddr(void *addr)
const char * omError2String(omError_t error)
const char * omError2Serror(omError_t error)
omError_t om_InternalErrorStatus
char * omFindExec(const char *name, char *exec)
#define omPrintCurrentBackTrace(fd)
void pPrintDivisbleByStat()
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static poly p_Add_q(poly p, poly q, const ring r)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
static void p_Setm(poly p, const ring r)
static unsigned pLength(poly a)
poly pcvP2CV(poly p, int d0, int d1)
int pcvBasis(lists b, int i, poly m, int d, int n)
int pcvDim(int d0, int d1)
lists pcvPMulL(poly p, lists l1)
poly pcvCV2P(poly cv, int d0, int d1)
lists pcvLAddL(lists l1, lists l2)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatiblity 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 pLmDeleteAndNext(p)
like pLmDelete, returns pNext(p)
#define pGetExp(p, i)
Exponent.
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
#define pCopy(p)
return a copy of the poly
poly nc_rat_CreateSpoly(poly pp1, poly pp2, int ishift, const ring r)
int redRat(poly *h, poly *reducer, int *red_length, int rl, int ishift, ring r)
poly nc_rat_ReduceSpolyNew(const poly p1, poly p2, int ishift, const ring r)
void StringSetS(const char *st)
const char feNotImplemented[]
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...
void p_DebugPrint(poly p, const ring r)
void rDebugPrint(const ring r)
void rSetSyzComp(int k, const ring r)
static BOOLEAN rField_is_Ring(const ring r)
static BOOLEAN rField_is_R(const ring r)
static int rBlocks(ring r)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
static BOOLEAN rField_is_long_C(const ring r)
static BOOLEAN rField_is_Q(const ring r)
static BOOLEAN rIsNCRing(const ring r)
static BOOLEAN rField_is_long_R(const ring r)
poly ringNF(poly f, ideal G, ring r)
poly plain_spoly(poly f, poly g)
poly ringRedNF(poly f, ideal G, ring r)
int testGB(ideal I, ideal GI)
static short scaLastAltVar(ring r)
static short scaFirstAltVar(ring r)
void sdb_edit(procinfo *pi)
int simpleipc_cmd(char *cmd, int id, int v)
ideal id_Vec2Ideal(poly vec, const ring R)
int ssiReservePort(int clients)
BOOLEAN assumeStdFlag(leftv h)
int M3ivSame(intvec *temp, intvec *u, intvec *v)
intvec * MivMatrixOrderlp(int nV)
intvec * MivMatrixOrder(intvec *iv)
intvec * MkInterRedNextWeight(intvec *iva, intvec *ivb, ideal G)
intvec * Mfpertvector(ideal G, intvec *ivtarget)
ideal TranMImprovwalk(ideal G, intvec *curr_weight, intvec *target_tmp, int nP)
ideal Mfwalk(ideal G, intvec *ivstart, intvec *ivtarget, int reduction, int printout)
intvec * MPertVectors(ideal G, intvec *ivtarget, int pdeg)
intvec * MPertVectorslp(ideal G, intvec *ivtarget, int pdeg)
ideal Mprwalk(ideal Go, intvec *orig_M, intvec *target_M, int weight_rad, int op_deg, int tp_deg, int nP, int reduction, int printout)
intvec * MivWeightOrderdp(intvec *ivstart)
intvec * MivMatrixOrderdp(int nV)
intvec * MivWeightOrderlp(intvec *ivstart)
ideal MAltwalk2(ideal Go, intvec *curr_weight, intvec *target_weight)
ideal MAltwalk1(ideal Go, int op_deg, int tp_deg, intvec *curr_weight, intvec *target_weight)
ideal Mrwalk(ideal Go, intvec *orig_M, intvec *target_M, int weight_rad, int pert_deg, int reduction, int printout)
ideal Mfrwalk(ideal G, intvec *ivstart, intvec *ivtarget, int weight_rad, int reduction, int printout)
ideal Mwalk(ideal Go, intvec *orig_M, intvec *target_M, ring baseRing, int reduction, int printout)
ideal Mpwalk(ideal Go, int op_deg, int tp_deg, intvec *curr_weight, intvec *target_weight, int nP, int reduction, int printout)
int MivSame(intvec *u, intvec *v)
ideal MwalkInitialForm(ideal G, intvec *ivw)
intvec * MPertNextWeight(intvec *iva, ideal G, int deg)
intvec * MwalkNextWeight(intvec *curr_weight, intvec *target_weight, ideal G)
intvec * Mivperttarget(ideal G, int ndeg)
int * iv2array(intvec *iv, const ring R)
#define omPrintUsedTrackAddrs(F, max)