18#include "ccluster/ccluster.h"
21#include "factory/factory.h"
23#ifdef TIME_WITH_SYS_TIME
25# ifdef HAVE_SYS_TIME_H
29# ifdef HAVE_SYS_TIME_H
35#ifdef HAVE_SYS_TIMES_H
140#ifndef MAKE_DISTRIBUTION
141#define HAVE_EXTENDED_SYSTEM 1
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)
233 const char *sys_cmd=(
char *)(args->
Data());
238 if (strcmp(sys_cmd,
"nblocks") == 0)
260 r = (ring)
h->Data();
267 if(strcmp(sys_cmd,
"version")==0)
275 if(strcmp(sys_cmd,
"alarm")==0)
282 struct itimerval t,o;
283 memset(&t,0,
sizeof(t));
284 t.it_value.tv_sec =(unsigned)((
unsigned long)
h->Data());
285 setitimer(ITIMER_VIRTUAL,&t,&o);
293 if(strcmp(sys_cmd,
"content")==0)
298 poly
p=(poly)
h->CopyD();
312 if(strcmp(sys_cmd,
"cpu")==0)
315 #ifdef _SC_NPROCESSORS_ONLN
316 cpu=sysconf(_SC_NPROCESSORS_ONLN);
317 #elif defined(_SC_NPROCESSORS_CONF)
318 cpu=sysconf(_SC_NPROCESSORS_CONF);
320 res->data=(
void *)cpu;
326 if(strcmp(sys_cmd,
"executable")==0)
341 if(strcmp(sys_cmd,
"flatten")==0)
354 if(strcmp(sys_cmd,
"unflatten")==0)
367 if(strcmp(sys_cmd,
"neworder")==0)
381 if(strcmp(sys_cmd,
"nc_hilb") == 0)
389 i = (ideal)
h->Data();
392 WerrorS(
"nc_Hilb:ideal expected");
397 lV = (int)(
long)
h->Data();
400 WerrorS(
"nc_Hilb:int expected");
406 if((
int)(
long)
h->Data() == 1)
408 else if((
int)(
long)
h->Data() == 2)
413 trunDegHs = (int)(
long)
h->Data();
418 WerrorS(
"nc_Hilb:int 1,2, total degree for the truncation, and a string for printing the details are expected");
427 if(strcmp(sys_cmd,
"verifyGB")==0)
431 WerrorS(
"system(\"verifyGB\",<ideal>,..) expects a commutative ring");
436 WerrorS(
"expected system(\"verifyGB\",<ideal>,..)");
439 ideal F=(ideal)
h->Data();
456 if(strcmp(sys_cmd,
"rcolon") == 0)
461 ideal
i = (ideal)
h->Data();
463 poly
w=(poly)
h->Data();
465 int lV = (int)(
long)
h->Data();
476 if(strcmp(sys_cmd,
"sh")==0)
480 WerrorS(
"shell execution is disallowed in restricted mode");
486 res->data = (
void*)(
long)
system((
char*)(
h->Data()));
493 if(strcmp(sys_cmd,
"reduce_bound")==0)
503 p = (poly)
h->CopyD();
507 pid = (ideal)
h->CopyD();
512 ideal q = (ideal)
h->next->CopyD();
513 int bound = (int)(
long)
h->next->next->Data();
522 if(strcmp(sys_cmd,
"uname")==0)
530 if(strcmp(sys_cmd,
"with")==0)
540 #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
541 char *
s=(
char *)
h->Data();
554 #ifdef TEST_MAC_ORDER
559 #ifdef HAVE_DYNAMIC_LOADING
582 if (strcmp(sys_cmd,
"browsers")==0)
592 if (strcmp(sys_cmd,
"pid")==0)
595 res->data=(
void *)(
long) getpid();
600 if (strcmp(sys_cmd,
"getenv")==0)
605 const char *r=
getenv((
char *)
h->Data());
618 if (strcmp(sys_cmd,
"setenv")==0)
625 setenv((
char *)
h->Data(), (
char *)
h->next->Data(), 1);
635 WerrorS(
"setenv not supported on this platform");
641 if (strcmp(sys_cmd,
"Singular") == 0)
650 if (strcmp(sys_cmd,
"SingularLib") == 0)
659 if (strcmp(sys_cmd,
"SingularBin") == 0)
663 if (r ==
NULL) r=
"/usr/local";
666 #define SINGULAR_PROCS_DIR "/libexec/singular/MOD"
669 if ((strstr(r,
".libs/..")==
NULL)
670 &&(strstr(r,
"Singular/..")==
NULL))
674 if (access(
s,X_OK)==0)
681 strcpy(
s,LIBEXEC_DIR);
682 if (access(
s,X_OK)==0)
705 res->data = (
void*)
s;
710 if (strstr(sys_cmd,
"--") == sys_cmd)
712 if (strcmp(sys_cmd,
"--") == 0)
720 Werror(
"Unknown option %s", sys_cmd);
721 WerrorS(
"Use 'system(\"--\");' for listing of available options");
736 const char *r=(
const char*)
feOptSpec[opt].value;
750 WerrorS(
"Need string or int argument to set option value");
753 const char* errormsg;
758 Werror(
"Need string argument to set value of option %s", sys_cmd);
762 if (errormsg !=
NULL)
763 Werror(
"Option '--%s=%d' %s", sys_cmd, (
int) ((
long)
h->Data()), errormsg);
768 if (errormsg !=
NULL)
769 Werror(
"Option '--%s=%s' %s", sys_cmd, (
char*)
h->Data(), errormsg);
776 if (strcmp(sys_cmd,
"HC")==0)
784 if(strcmp(sys_cmd,
"random")==0)
807 if (strcmp(sys_cmd,
"denom_list")==0)
816 if(strcmp(sys_cmd,
"complexNearZero")==0)
823 WerrorS(
"unsupported ground field!");
830 (int)((
long)(
h->next->Data())));
841 if(strcmp(sys_cmd,
"getPrecDigits")==0)
846 WerrorS(
"unsupported ground field!");
857 if(strcmp(sys_cmd,
"lduDecomp")==0)
864 poly
l; poly u; poly prodLU;
865 lduDecomp(aMat, pMat, lMat, dMat, uMat,
l, u, prodLU);
876 res->data = (
char *)L;
886 if(strcmp(sys_cmd,
"lduSolve")==0)
920 poly
l = (poly)
h->next->next->next->next->Data();
921 poly u = (poly)
h->next->next->next->next->next->Data();
922 poly lTimesU = (poly)
h->next->next->next->next->next->next->Data();
923 matrix bVec = (
matrix)
h->next->next->next->next->next->next->next->Data();
927 Werror(
"first matrix (%d x %d) is not quadratic",
933 Werror(
"second matrix (%d x %d) is not quadratic",
939 Werror(
"third matrix (%d x %d) is not quadratic",
945 Werror(
"third matrix (%d x %d) and fourth matrix (%d x %d) %s",
952 Werror(
"fourth matrix (%d x %d) and vector (%d x 1) do not fit",
957 bVec, xVec, homogSolSpace);
980 if (strcmp(sys_cmd,
"shared") == 0)
982 #ifndef SI_COUNTEDREF_AUTOLOAD
989 else if (strcmp(sys_cmd,
"reference") == 0)
991 #ifndef SI_COUNTEDREF_AUTOLOAD
1000#ifdef HAVE_SIMPLEIPC
1001 if (strcmp(sys_cmd,
"semaphore")==0)
1006 if ((
h->next->next!=
NULL)&& (
h->next->next->Typ()==
INT_CMD))
1007 v=(int)(
long)
h->next->next->Data();
1014 WerrorS(
"Usage: system(\"semaphore\",<cmd>,int)");
1021 if (strcmp(sys_cmd,
"reserve")==0)
1029 res->data=(
void*)(
long)
p;
1036 if (strcmp(sys_cmd,
"reservedLink")==0)
1045 if (strcmp(sys_cmd,
"install")==0)
1051 (
int)(
long)
h->next->next->next->Data(),
1058 if (strcmp(sys_cmd,
"newstruct")==0)
1064 char *n=(
char*)
h->Data();
1071 newstruct_desc desc=(newstruct_desc)bb->data;
1075 else Werror(
"'%s' is not a newstruct",n);
1077 else Werror(
"'%s' is not a blackbox object",n);
1083 if (strcmp(sys_cmd,
"blackbox")==0)
1090 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1091 if (strcmp(sys_cmd,
"absFact") == 0)
1108 l->m[0].data=(
void *)
f;
1110 l->m[1].data=(
void *)
v;
1112 l->m[2].data=(
void*) mipos;
1114 l->m[3].data=(
void*) (
long) n;
1115 res->data=(
void *)
l;
1124 if (strcmp(sys_cmd,
"LLL") == 0)
1147 #if __FLINT_RELEASE >= 20500
1148 if (strcmp(sys_cmd,
"LLL_Flint") == 0)
1169 WerrorS(
"matrix,int or bigint,int expected");
1174 if(((
int)((
long)(
h->next->Data())) != 0) && (
int)((
long)(
h->next->Data()) != 1))
1176 WerrorS(
"int is different from 0, 1");
1180 if((
long)(
h->next->Data()) == 0)
1195 if((
long)(
h->next->Data()) == 1)
1201 for(
int i = 1;
i<=
m->rows();
i++)
1219 for(
int i = 1;
i<=
m->rows();
i++)
1242 if(strcmp(sys_cmd,
"rref")==0)
1254 WerrorS(
"expected system(\"rref\",<matrix>)");
1262 if(strcmp(sys_cmd,
"pcvLAddL")==0)
1267 if(strcmp(sys_cmd,
"pcvPMulL")==0)
1272 if(strcmp(sys_cmd,
"pcvMinDeg")==0)
1277 if(strcmp(sys_cmd,
"pcvP2CV")==0)
1282 if(strcmp(sys_cmd,
"pcvCV2P")==0)
1287 if(strcmp(sys_cmd,
"pcvDim")==0)
1292 if(strcmp(sys_cmd,
"pcvBasis")==0)
1299 #ifdef HAVE_EIGENVAL
1300 if(strcmp(sys_cmd,
"hessenberg")==0)
1307 #ifdef HAVE_EIGENVAL
1308 if(strcmp(sys_cmd,
"eigenvals")==0)
1315 #ifdef HAVE_EIGENVAL
1316 if(strcmp(sys_cmd,
"rowelim")==0)
1323 #ifdef HAVE_EIGENVAL
1324 if(strcmp(sys_cmd,
"rowcolswap")==0)
1332 if(strcmp(sys_cmd,
"gmsnf")==0)
1339 if(strcmp(sys_cmd,
"contributors") == 0)
1343 "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");
1348 #ifdef HAVE_SPECTRUM
1349 if(strcmp(sys_cmd,
"spectrum") == 0)
1363 if(((
long)
h->next->Data())==1L)
1369 if(strcmp(sys_cmd,
"semic") == 0)
1375 if (
h->next->next==
NULL)
1377 else if (
h->next->next->Typ()==
INT_CMD)
1384 if(strcmp(sys_cmd,
"spadd") == 0)
1395 if(strcmp(sys_cmd,
"spmul") == 0)
1407 #define HAVE_SHEAFCOH_TRICKS 1
1409 #ifdef HAVE_SHEAFCOH_TRICKS
1410 if(strcmp(sys_cmd,
"tensorModuleMult")==0)
1416 int m = (int)( (
long)
h->Data() );
1417 ideal
M = (ideal)
h->next->Data();
1428 if (strcmp(sys_cmd,
"twostd") == 0)
1433 I=(ideal)
h->CopyD();
1447 if (strcmp(sys_cmd,
"bracket") == 0)
1452 poly
p=(poly)
h->CopyD();
1454 poly q=(poly)
h->Data();
1465 if (strcmp(sys_cmd,
"env")==0)
1469 ring r = (ring)
h->Data();
1476 WerrorS(
"`system(\"env\",<ring>)` expected");
1484 if (strcmp(sys_cmd,
"opp")==0)
1488 ring r=(ring)
h->Data();
1495 WerrorS(
"`system(\"opp\",<ring>)` expected");
1503 if (strcmp(sys_cmd,
"oppose")==0)
1506 && (
h->next!=
NULL))
1508 ring Rop = (ring)
h->Data();
1521 WerrorS(
"`system(\"oppose\",<ring>,<poly>)` expected");
1531 if (strcmp(sys_cmd,
"walkNextWeight") == 0)
1538 Werror(
"system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1542 res->data = (
void*) walkNextWeight(((
intvec*)
h->Data()),
1544 (ideal)
h->next->next->Data());
1545 if (
res->data ==
NULL ||
res->data == (
void*) 1L)
1561 if (strcmp(sys_cmd,
"walkInitials") == 0)
1565 WerrorS(
"system(\"walkInitials\", ideal) expected");
1568 res->data = (
void*) walkInitials((ideal)
h->Data());
1578 if (strcmp(sys_cmd,
"walkAddIntVec") == 0)
1584 res->data = (
intvec*) walkAddIntVec(arg1, arg2);
1593 #ifdef MwaklNextWeight
1594 if (strcmp(sys_cmd,
"MwalkNextWeight") == 0)
1601 Werror(
"system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1607 ideal arg3 = (ideal)
h->next->next->Data();
1618 if(strcmp(sys_cmd,
"Mivdp") == 0)
1622 WerrorS(
"system(\"Mivdp\", int) expected");
1625 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1627 Werror(
"system(\"Mivdp\" ...) intvecs not of length %d\n",
1631 int arg1 = (int) ((
long)(
h->Data()));
1641 if(strcmp(sys_cmd,
"Mivlp") == 0)
1645 WerrorS(
"system(\"Mivlp\", int) expected");
1648 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1650 Werror(
"system(\"Mivlp\" ...) intvecs not of length %d\n",
1654 int arg1 = (int) ((
long)(
h->Data()));
1665 if(strcmp(sys_cmd,
"MpDiv") == 0)
1669 poly arg1 = (poly)
h->Data();
1670 poly arg2 = (poly)
h->next->Data();
1671 poly
result = MpDiv(arg1, arg2);
1682 if(strcmp(sys_cmd,
"MpMult") == 0)
1686 poly arg1 = (poly)
h->Data();
1687 poly arg2 = (poly)
h->next->Data();
1688 poly
result = MpMult(arg1, arg2);
1698 if (strcmp(sys_cmd,
"MivSame") == 0)
1719 res->data = (
void*)(
long)
MivSame(arg1, arg2);
1726 if (strcmp(sys_cmd,
"M3ivSame") == 0)
1749 res->data = (
void*)(
long)
M3ivSame(arg1, arg2, arg3);
1756 if(strcmp(sys_cmd,
"MwalkInitialForm") == 0)
1762 Werror(
"system \"MwalkInitialForm\"...) intvec not of length %d\n",
1766 ideal
id = (ideal)
h->Data();
1778 if(strcmp(sys_cmd,
"MivMatrixOrder") == 0)
1782 WerrorS(
"system(\"MivMatrixOrder\",intvec) expected");
1795 if(strcmp(sys_cmd,
"MivMatrixOrderdp") == 0)
1799 WerrorS(
"system(\"MivMatrixOrderdp\",intvec) expected");
1802 int arg1 = (int) ((
long)(
h->Data()));
1812 if(strcmp(sys_cmd,
"MPertVectors") == 0)
1816 ideal arg1 = (ideal)
h->Data();
1818 int arg3 = (int) ((
long)(
h->next->next->Data()));
1828 if(strcmp(sys_cmd,
"MPertVectorslp") == 0)
1832 ideal arg1 = (ideal)
h->Data();
1834 int arg3 = (int) ((
long)(
h->next->next->Data()));
1844 if(strcmp(sys_cmd,
"Mfpertvector") == 0)
1848 ideal arg1 = (ideal)
h->Data();
1859 if(strcmp(sys_cmd,
"MivUnit") == 0)
1863 int arg1 = (int) ((
long)(
h->Data()));
1873 if(strcmp(sys_cmd,
"MivWeightOrderlp") == 0)
1887 if(strcmp(sys_cmd,
"MivWeightOrderdp") == 0)
1891 WerrorS(
"system(\"MivWeightOrderdp\",intvec) expected");
1905 if(strcmp(sys_cmd,
"MivMatrixOrderlp") == 0)
1909 WerrorS(
"system(\"MivMatrixOrderlp\",int) expected");
1912 int arg1 = (int) ((
long)(
h->Data()));
1922 if (strcmp(sys_cmd,
"MkInterRedNextWeight") == 0)
1929 Werror(
"system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1935 ideal arg3 = (ideal)
h->next->next->Data();
1945 #ifdef MPertNextWeight
1946 if (strcmp(sys_cmd,
"MPertNextWeight") == 0)
1952 Werror(
"system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1957 ideal arg2 = (ideal)
h->next->Data();
1958 int arg3 = (int)
h->next->next->Data();
1969 #ifdef Mivperttarget
1970 if (strcmp(sys_cmd,
"Mivperttarget") == 0)
1974 ideal arg1 = (ideal)
h->Data();
1975 int arg2 = (int)
h->next->Data();
1986 if (strcmp(sys_cmd,
"Mwalk") == 0)
1993 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d\n",
1997 ideal arg1 = (ideal)
h->CopyD();
2000 ring arg4 = (ring)
h->next->next->next->Data();
2001 int arg5 = (int) (
long)
h->next->next->next->next->Data();
2002 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2003 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2013 if (strcmp(sys_cmd,
"Mwalk") == 0)
2022 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2026 ideal arg1 = (ideal)
h->Data();
2029 ring arg4 = (ring)
h->next->next->next->Data();
2030 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3,arg4);
2037 if (strcmp(sys_cmd,
"Mpwalk") == 0)
2044 Werror(
"system(\"Mpwalk\" ...) intvecs not of length %d\n",
currRing->N);
2047 ideal arg1 = (ideal)
h->Data();
2048 int arg2 = (int) (
long)
h->next->Data();
2049 int arg3 = (int) (
long)
h->next->next->Data();
2052 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2053 int arg7 = (int) (
long)
h->next->next->next->next->next->next->Data();
2054 int arg8 = (int) (
long)
h->next->next->next->next->next->next->next->Data();
2055 ideal
result = (ideal)
Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2065 if (strcmp(sys_cmd,
"Mrwalk") == 0)
2074 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2078 ideal arg1 = (ideal)
h->Data();
2081 int arg4 = (int)(
long)
h->next->next->next->Data();
2082 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2083 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2084 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2085 ideal
result = (ideal)
Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2094 if (strcmp(sys_cmd,
"MAltwalk1") == 0)
2101 Werror(
"system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2105 ideal arg1 = (ideal)
h->Data();
2106 int arg2 = (int) ((
long)(
h->next->Data()));
2107 int arg3 = (int) ((
long)(
h->next->next->Data()));
2120 if (strcmp(sys_cmd,
"Mfwalk_alt") == 0)
2127 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2131 ideal arg1 = (ideal)
h->Data();
2134 int arg4 = (int)
h->next->next->next->Data();
2135 ideal
result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2145 if (strcmp(sys_cmd,
"Mfwalk") == 0)
2152 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2156 ideal arg1 = (ideal)
h->Data();
2159 int arg4 = (int)(
long)
h->next->next->next->Data();
2160 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2161 ideal
result = (ideal)
Mfwalk(arg1, arg2, arg3, arg4, arg5);
2170 if (strcmp(sys_cmd,
"Mfrwalk") == 0)
2187 Werror(
"system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2192 ideal arg1 = (ideal)
h->Data();
2195 int arg4 = (int)(
long)
h->next->next->next->Data();
2196 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2197 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2198 ideal
result = (ideal)
Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2205 if (strcmp(sys_cmd,
"Mprwalk") == 0)
2214 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2218 ideal arg1 = (ideal)
h->Data();
2221 int arg4 = (int)(
long)
h->next->next->next->Data();
2222 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2223 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2224 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2225 int arg8 = (int)(
long)
h->next->next->next->next->next->next->next->Data();
2226 int arg9 = (int)(
long)
h->next->next->next->next->next->next->next->next->Data();
2227 ideal
result = (ideal)
Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2237 if (strcmp(sys_cmd,
"TranMImprovwalk") == 0)
2244 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2248 ideal arg1 = (ideal)
h->Data();
2261 if (strcmp(sys_cmd,
"MAltwalk2") == 0)
2268 Werror(
"system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2272 ideal arg1 = (ideal)
h->Data();
2284 if (strcmp(sys_cmd,
"TranMImprovwalk") == 0)
2291 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2295 ideal arg1 = (ideal)
h->Data();
2298 int arg4 = (int) ((
long)(
h->next->next->next->Data()));
2309 if (strcmp(sys_cmd,
"TranMrImprovwalk") == 0)
2314 h->next->next->next ==
NULL ||
h->next->next->next->Typ() !=
INT_CMD ||
2315 h->next->next->next ==
NULL ||
h->next->next->next->next->Typ() !=
INT_CMD ||
2316 h->next->next->next ==
NULL ||
h->next->next->next->next->next->Typ() !=
INT_CMD)
2318 WerrorS(
"system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2324 Werror(
"system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n",
currRing->N);
2327 ideal arg1 = (ideal)
h->Data();
2330 int arg4 = (int)(
long)
h->next->next->next->Data();
2331 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2332 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2333 ideal
result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2343 #ifndef MAKE_DISTRIBUTION
2354#ifdef HAVE_EXTENDED_SYSTEM
2358# include "hc_newton.h"
2365 char *sys_cmd=(
char *)(
h->Data());
2368 if (strcmp(sys_cmd,
"syz") == 0)
2372 const char *
s=(
const char *)
h->Data();
2373 if (strcmp(
s,
"posInT_EcartFDegpLength")==0)
2375 else if (strcmp(
s,
"posInT_FDegpLength")==0)
2377 else if (strcmp(
s,
"posInT_pLength")==0)
2379 else if (strcmp(
s,
"posInT0")==0)
2381 else if (strcmp(
s,
"posInT1")==0)
2383 else if (strcmp(
s,
"posInT2")==0)
2385 else if (strcmp(
s,
"posInT11")==0)
2387 else if (strcmp(
s,
"posInT110")==0)
2389 else if (strcmp(
s,
"posInT13")==0)
2391 else if (strcmp(
s,
"posInT15")==0)
2393 else if (strcmp(
s,
"posInT17")==0)
2395 else if (strcmp(
s,
"posInT17_c")==0)
2397 else if (strcmp(
s,
"posInT19")==0)
2399 else PrintS(
"valid posInT:0,1,2,11,110,13,15,17,17_c,19,_EcartFDegpLength,_FDegpLength,_pLength,_EcartpLength\n");
2411 if(strcmp(sys_cmd,
"locNF")==0)
2416 poly
f=(poly)
h->Data();
2418 ideal
m=(ideal)
h->Data();
2421 int n=(int)((
long)
h->Data());
2486 if(strcmp(sys_cmd,
"p")==0)
2491 WarnS(
"Sorry: not available for release build!");
2497 if(strcmp(sys_cmd,
"setsyzcomp")==0)
2501 int k = (int)(
long)
h->Data();
2509 if(strcmp(sys_cmd,
"r")==0)
2514 WarnS(
"Sorry: not available for release build!");
2526 if(strcmp(sys_cmd,
"changeRing")==0)
2530 for (
int i = 1;
i <= varN;
i++)
2533 sprintf(
h,
"x%d",
i);
2538 res->data = (
void*)0L;
2543 if(strcmp(sys_cmd,
"mtrack")==0)
2554 char *fn=(
char*)
h->Data();
2555 fd = fopen(fn,
"w");
2557 Warn(
"Can not open %s for writing og mtrack. Using stdout",fn);
2561 max = (int)(
long)
h->Data();
2570 WerrorS(
"system(\"mtrack\",..) is not implemented in this version");
2577 if(strcmp(sys_cmd,
"backtrace")==0)
2585#if !defined(OM_NDEBUG)
2587 if (strcmp(sys_cmd,
"omMemoryTest")==0)
2591 PrintS(
"\n[om_Info]: \n");
2593#define OM_PRINT(name) Print(" %-22s : %10ld \n", #name, om_Info . name)
2594 OM_PRINT(MaxBytesSystem);
2595 OM_PRINT(CurrentBytesSystem);
2596 OM_PRINT(MaxBytesSbrk);
2597 OM_PRINT(CurrentBytesSbrk);
2598 OM_PRINT(MaxBytesMmap);
2599 OM_PRINT(CurrentBytesMmap);
2600 OM_PRINT(UsedBytes);
2601 OM_PRINT(AvailBytes);
2602 OM_PRINT(UsedBytesMalloc);
2603 OM_PRINT(AvailBytesMalloc);
2604 OM_PRINT(MaxBytesFromMalloc);
2605 OM_PRINT(CurrentBytesFromMalloc);
2606 OM_PRINT(MaxBytesFromValloc);
2607 OM_PRINT(CurrentBytesFromValloc);
2608 OM_PRINT(UsedBytesFromValloc);
2609 OM_PRINT(AvailBytesFromValloc);
2611 OM_PRINT(UsedPages);
2612 OM_PRINT(AvailPages);
2613 OM_PRINT(MaxRegionsAlloc);
2614 OM_PRINT(CurrentRegionsAlloc);
2619 PrintS(
"\n[om_Opts]: \n");
2620#define OM_PRINT(format, name) Print(" %-22s : %10" format"\n", #name, om_Opts . name)
2621 OM_PRINT(
"d", MinTrack);
2622 OM_PRINT(
"d", MinCheck);
2623 OM_PRINT(
"d", MaxTrack);
2624 OM_PRINT(
"d", MaxCheck);
2625 OM_PRINT(
"d", Keep);
2626 OM_PRINT(
"d", HowToReportErrors);
2627 OM_PRINT(
"d", MarkAsStatic);
2628 OM_PRINT(
"u", PagesPerRegion);
2629 OM_PRINT(
"p", OutOfMemoryFunc);
2630 OM_PRINT(
"p", MemoryLowFunc);
2631 OM_PRINT(
"p", ErrorHook);
2636 Print(
"\n\n[om_ErrorStatus] : '%s' (%s)\n",
2639 Print(
"[om_InternalErrorStatus]: '%s' (%s)\n",
2652 #if defined(PDEBUG) || defined(PDIV_DEBUG)
2653 if(strcmp(sys_cmd,
"pDivStat")==0)
2663 if(strcmp(sys_cmd,
"red")==0)
2678 if(strcmp(sys_cmd,
"fastcomb")==0)
2686 WarnS(
"Wrong types for poly= comb(ideal,poly)");
2691 (ideal)
h->Data(),(poly)
h->next->Data());
2699 if(strcmp(sys_cmd,
"comb")==0)
2707 WarnS(
"Wrong types for poly= comb(ideal,poly)");
2712 (ideal)
h->Data(),(poly)
h->next->Data());
2721 if(strcmp(sys_cmd,
"listall")==0)
2723 void listall(
int showproc);
2725 if ((
h!=
NULL) && (
h->Typ()==
INT_CMD)) showproc=(int)((
long)
h->Data());
2733 if(strcmp(sys_cmd,
"proclist")==0)
2735 void piShowProcList();
2743 if(strcmp(sys_cmd,
"newton")==0)
2747 || (
h->next->next->Typ()!=
INT_CMD))
2749 WerrorS(
"system(\"newton\",<poly>,<int>,<int>) expected");
2752 poly
p=(poly)(
h->Data());
2771 (
int) (
h->next->Data()),
2772 (
int) (
h->next->next->Data())
2785 L->
m[1].
data=(
void *)(
long)r.achse;
2787 L->
m[2].
data=(
void *)(
long)r.deg;
2791 L->
m[3].
data=(
void *)(
long)r.anz_punkte;
2793 int anz = r.anz_punkte;
2796 for (
i=0;
i<anz*
dim;
i++)
2806 (*w)[
i] = r.deg_tab[
i];
2809 while (r.deg_tab[
i-1] != -2);
2820 res->data=(
void *)L;
2843 if (strcmp(sys_cmd,
"minpoly") == 0)
2847 Werror(
"expected exactly one argument: %s",
2848 "a square matrix with number entries");
2858 WerrorS(
"expected exactly one argument: "
2859 "a square matrix with number entries");
2866 res->data = (
void *)theMinPoly;
2867 for (
int i = 0;
i < n;
i++)
delete[] ml[
i];
2869 delete[] polyCoeffs;
2876 if (strcmp(sys_cmd,
"sdb_flags") == 0)
2884 WerrorS(
"system(\"sdb_flags\",`int`) expected");
2893 if (strcmp(sys_cmd,
"sdb_edit") == 0)
2902 WerrorS(
"system(\"sdb_edit\",`proc`) expected");
2911 if (strcmp(sys_cmd,
"GF") == 0)
2928 if (strcmp(sys_cmd,
"svd") == 0)
2939 if (strcmp(sys_cmd,
"redNF_ring")==0)
2942 poly
f = (poly)
h->Data();
2944 ideal
G = (ideal)
h->Data();
2952 if (strcmp(sys_cmd,
"hilbroune") == 0)
2964 if (strcmp(sys_cmd,
"f5")==0)
2973 ideal
G = (ideal)
h->Data();
2977 opt = (int) (
long)
h->Data();
2985 plus = (int) (
long)
h->Data();
2993 termination = (int) (
long)
h->Data();
2999 res->data=(ideal)
F5main(
G,r,opt,plus,termination);
3006 if (strcmp(sys_cmd,
"NF_ring")==0)
3009 poly
f = (poly)
h->Data();
3011 ideal
G = (ideal)
h->Data();
3017 if (strcmp(sys_cmd,
"spoly")==0)
3019 poly
f =
pCopy((poly)
h->Data());
3021 poly
g =
pCopy((poly)
h->Data());
3028 if (strcmp(sys_cmd,
"testGB")==0)
3030 ideal I = (ideal)
h->Data();
3032 ideal GI = (ideal)
h->Data();
3034 res->data = (
void *)(
long)
testGB(I, GI);
3041 if ( (strcmp(sys_cmd,
"AltVarStart") == 0) || (strcmp(sys_cmd,
"AltVarEnd") == 0) )
3047 WerrorS(
"`system(\"AltVarStart/End\"[,<ring>])` expected");
3055 if(strcmp(sys_cmd,
"AltVarStart") == 0)
3062 WerrorS(
"`system(\"AltVarStart/End\",<ring>) requires a SCA ring");
3068 #ifdef HAVE_RATGRING
3069 if (strcmp(sys_cmd,
"intratNF") == 0)
3084 I=(ideal)
h->CopyD();
3092 is=(int)((
long)(
h->Data()));
3100 for(
k=0;
k < id;
k++)
3104 PrintS(
"starting redRat\n");
3122 if (strcmp(sys_cmd,
"ratNF") == 0)
3141 is=(int)((
long)(
h->Data()));
3156 if (strcmp(sys_cmd,
"ratSpoly") == 0)
3174 is=(int)((
long)(
h->Data()));
3190 if (strcmp(sys_cmd,
"ratVar") == 0)
3207 return (start==0)||(end==0)||(start>end);
3211 if (strcmp(sys_cmd,
"unifastmult")==0)
3213 poly
f = (poly)
h->Data();
3215 poly
g=(poly)
h->Data();
3221 if (strcmp(sys_cmd,
"multifastmult")==0)
3223 poly
f = (poly)
h->Data();
3225 poly
g=(poly)
h->Data();
3231 if (strcmp(sys_cmd,
"mults")==0)
3238 if (strcmp(sys_cmd,
"fastpower")==0)
3241 poly
f = (poly)
h->Data();
3243 int n=(int)((
long)
h->Data());
3249 if (strcmp(sys_cmd,
"normalpower")==0)
3251 poly
f = (poly)
h->Data();
3253 int n=(int)((
long)
h->Data());
3259 if (strcmp(sys_cmd,
"MCpower")==0)
3262 poly
f = (poly)
h->Data();
3264 int n=(int)((
long)
h->Data());
3270 if (strcmp(sys_cmd,
"bit_subst")==0)
3273 poly outer = (poly)
h->Data();
3275 poly inner=(poly)
h->Data();
3282 if (strcmp(sys_cmd,
"gcd") == 0)
3302 int d=(int)(
long)
h->next->Data();
3303 char *
s=(
char *)
h->Data();
3321 if (strcmp(sys_cmd,
"subring") == 0)
3335 if (strcmp(sys_cmd,
"HNF") == 0)
3357 WerrorS(
"expected `system(\"HNF\",<matrix|intmat|bigintmat>)`");
3365 if (strcmp (sys_cmd,
"probIrredTest") == 0)
3370 char *
s=(
char *)
h->next->Data();
3382 if(strcmp(sys_cmd,
"GNUmpLoad")==0)
3386 char* filename = (
char*)
h->Data();
3387 FILE*
f = fopen(filename,
"r");
3390 WerrorS(
"invalid file name (in paths use '/')");
3393 mpz_t
m; mpz_init(
m);
3394 mpz_inp_str(
m,
f, 10);
3398 res->data = (
void*)n;
3403 WerrorS(
"expected valid file name as a string");
3415 if(strcmp(sys_cmd,
"intvecMatchingSegments")==0)
3419 (
h->next->next ==
NULL))
3424 int validEntries = 0;
3425 for (
int k = 0;
k <= ivec->
rows() - jvec->
rows();
k++)
3427 if (memcmp(&(*ivec)[
k], &(*jvec)[0],
3428 sizeof(
int) * jvec->
rows()) == 0)
3430 if (validEntries == 0)
3434 r->
resize(validEntries + 1);
3435 (*r)[validEntries] =
k + 1;
3441 res->data = (
void*)r;
3446 WerrorS(
"expected two non-empty intvecs as arguments");
3457 if(strcmp(sys_cmd,
"intvecOverlap")==0)
3461 (
h->next->next ==
NULL))
3465 int ir = ivec->
rows();
int jr = jvec->
rows();
3466 int r = jr;
if (ir < jr) r = ir;
3467 while ((r >= 1) && (memcmp(&(*ivec)[ir - r], &(*jvec)[0],
3468 sizeof(
int) * r) != 0))
3471 res->data = (
void*)(
long)r;
3476 WerrorS(
"expected two non-empty intvecs as arguments");
3482 if(strcmp(sys_cmd,
"henselfactors")==0)
3487 (
h->next->next->next !=
NULL) &&
3488 (
h->next->next->next->Typ() ==
POLY_CMD) &&
3489 (
h->next->next->next->next !=
NULL) &&
3490 (
h->next->next->next->next->Typ() ==
POLY_CMD) &&
3491 (
h->next->next->next->next->next !=
NULL) &&
3492 (
h->next->next->next->next->next->Typ() ==
INT_CMD) &&
3493 (
h->next->next->next->next->next->next ==
NULL))
3495 int xIndex = (int)(
long)
h->Data();
3496 int yIndex = (int)(
long)
h->next->Data();
3497 poly hh = (poly)
h->next->next->Data();
3498 poly f0 = (poly)
h->next->next->next->Data();
3499 poly g0 = (poly)
h->next->next->next->next->Data();
3500 int d = (int)(
long)
h->next->next->next->next->next->Data();
3508 res->data = (
char *)L;
3513 WerrorS(
"expected argument list (int, int, poly, poly, poly, int)");
3520 if (strcmp(sys_cmd,
"astep") == 0)
3525 I=(ideal)
h->CopyD();
3538 if (strcmp(sys_cmd,
"PrintMat") == 0)
3548 a=(int)((
long)(
h->Data()));
3553 b=(int)((
long)(
h->Data()));
3568 metric=(int)((
long)(
h->Data()));
3579 if(strcmp(sys_cmd,
"NCUseExtensions")==0)
3592 if(strcmp(sys_cmd,
"NCGetType")==0)
3598 res->data=(
void *)(-1L);
3605 if(strcmp(sys_cmd,
"ForceSCA")==0)
3612 b = (int)((
long)(
h->Data()));
3618 e = (int)((
long)(
h->Data()));
3629 if(strcmp(sys_cmd,
"ForceNewNCMultiplication")==0)
3641 if(strcmp(sys_cmd,
"ForceNewOldNCMultiplication")==0)
3653 if(strcmp(sys_cmd,
"test64")==0)
3669 Print(
"SIZEOF_LONG=%d\n",SIZEOF_LONG);
3675 if(strcmp(sys_cmd,
"cache_chinrem")==0)
3686 if(strcmp(sys_cmd,
"LU")==0)
3696 res->data=(
char*)bb;
3701 WerrorS(
"system(\"LU\",<cmatrix>) expected");
3708 if(strcmp(sys_cmd,
"sort")==0)
3718 if(strcmp(sys_cmd,
"uniq")==0)
3728 if(strcmp(sys_cmd,
"GF")==0)
3733 int p=(int)(
long)
h->Data();
3734 int n=(int)(
long)
h->next->Data();
3735 char *
v=(
char*)
h->next->next->CopyD();
3751 if(strcmp(sys_cmd,
"power1")==0)
3754 poly
f=(poly)
h->CopyD();
3756 res->data=(
void *)
g;
3760 if(strcmp(sys_cmd,
"power2")==0)
3763 poly
f=(poly)
h->Data();
3765 for(
int i=0;
i<2000;
i++)
3767 res->data=(
void *)
g;
3770 if(strcmp(sys_cmd,
"power3")==0)
3773 poly
f=(poly)
h->Data();
3784 poly p1536=
pMult(p1024,p512);
3785 poly p1792=
pMult(p1536,p256);
3786 poly p1920=
pMult(p1792,p128);
3787 poly p1984=
pMult(p1920,p64);
3788 poly p2000=
pMult(p1984,p16);
3789 res->data=(
void *)p2000;
3810 if(strcmp(sys_cmd,
"ccluster")==0)
3820 int pol_with_complex_coeffs=0;
3822 pol_with_complex_coeffs=1;
3828 fmpq_poly_t fre, fim;
3830 if (pol_with_complex_coeffs==1)
3835 fmpq_t center_re,center_im,boxsize,eps;
3841 int n=fmpq_poly_length(fre);
3842 fmpq_t* re_part=(fmpq_t*)
omAlloc(n*
sizeof(fmpq_t));
3843 fmpq_t* im_part=(fmpq_t*)
omAlloc(n*
sizeof(fmpq_t));
3845 for(
int i=0;
i<n;
i++)
3846 { fmpq_init(re_part[
i]); fmpq_init(im_part[
i]); }
3851 long nb_threads = (long)
feOptValue(FE_OPT_CPUS);
3852 strategy = strategy+(nb_threads<<6);
3855 if (pol_with_complex_coeffs==0)
3856 nn=ccluster_interface_poly_real(re_part,im_part,
mult,fre,center_re,center_im,boxsize,eps,strategy,verbosity);
3858 nn=ccluster_interface_poly_real_imag(re_part,im_part,
mult,fre,fim,center_re,center_im,boxsize,eps,strategy,verbosity);
3862 for(
int i=0;
i<nn;
i++)
3876 for(
int i=n-1;
i>=0;
i--) { fmpq_clear(re_part[
i]); fmpq_clear(im_part[
i]); }
3880 fmpq_clear(center_re); fmpq_clear(center_im); fmpq_clear(boxsize); fmpq_clear(eps);
3881 fmpq_poly_clear(fre);
3882 if (pol_with_complex_coeffs==1) fmpq_poly_clear(fim);
3894 if(strcmp(sys_cmd,
"evaluate")==0)
3896 extern number
maEvalAt(
const poly
p,
const number* pt,
const ring r);
3899 WerrorS(
"expected system(\"evaluate\",<poly>,..)");
3902 poly
p=(poly)
h->Data();
3909 WerrorS(
"system(\"evaluate\",<poly>,<number>..) - expect number");
3912 pt[
i]=(number)
h->Data();
3920 if(strcmp(sys_cmd,
"DivRem")==0)
3925 poly
p=(poly)
h->CopyD();
3926 poly q=(poly)
h->next->CopyD();
3935 WerrorS(
"expected system(\"DivRem\",<poly>,<poly>)");
static int si_max(const int a, const int b)
#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)
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)
char * singclap_neworder(ideal I, 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...
static FORCE_INLINE number n_convFactoryNSingN(const CanonicalForm n, const coeffs r)
void n_Print(number &a, const coeffs r)
print a number (BEWARE of string buffers!) mostly for debugging
static FORCE_INLINE CanonicalForm n_convSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(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)
feOptIndex feGetOptIndex(const char *name)
const char * feSetOptValue(feOptIndex opt, char *optarg)
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)
void convFlintNSingN(mpz_t z, fmpz_t f)
matrix singflint_rref(matrix m, const ring R)
bigintmat * singflint_LLL(bigintmat *A, bigintmat *T)
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!)
static nc_type & ncRingType(nc_struct *p)
int setNCExtensions(int iMask)
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys 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
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
unsigned long * computeMinimalPolynomial(unsigned long **matrix, unsigned n, unsigned long p)
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()
void p_Content(poly ph, const ring r)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
poly p_Cleardenom(poly p, const ring r)
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 ...
poly p_DivRem(poly p, poly q, poly &rest, const ring r)
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_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)
#define rField_is_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 * MivWeightOrderdp(intvec *ivstart)
ideal TranMImprovwalk(ideal G, intvec *curr_weight, intvec *target_tmp, int nP)
intvec * MivMatrixOrderdp(int nV)
ideal Mfwalk(ideal G, intvec *ivstart, intvec *ivtarget, int reduction, int printout)
intvec * MPertVectors(ideal G, intvec *ivtarget, int pdeg)
intvec * MivWeightOrderlp(intvec *ivstart)
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 * MivMatrixOrder(intvec *iv)
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 * MivMatrixOrderlp(int nV)
intvec * Mfpertvector(ideal G, intvec *ivtarget)
intvec * MPertVectorslp(ideal G, intvec *ivtarget, int pdeg)
intvec * MkInterRedNextWeight(intvec *iva, intvec *ivb, ideal G)
intvec * MwalkNextWeight(intvec *curr_weight, intvec *target_weight, ideal G)
intvec * Mivperttarget(ideal G, int ndeg)
intvec * MPertNextWeight(intvec *iva, ideal G, int deg)
int * iv2array(intvec *iv, const ring R)
#define omPrintUsedTrackAddrs(F, max)