230{
232 {
233 const char *sys_cmd=(
char *)(args->
Data());
235
236
237
238 if (strcmp(sys_cmd, "nblocks") == 0)
239 {
240 ring r;
242 {
244 {
246 }
247 else
248 {
251 }
252 }
253 else
254 {
256 {
259 }
260 r = (ring)
h->Data();
261 }
265 }
266
267 if(strcmp(sys_cmd,"version")==0)
268 {
272 }
273 else
274
275 if(strcmp(sys_cmd,"alarm")==0)
276 {
278 {
279
280
281
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);
287 }
288 else
290 }
291 else
292
293 if(strcmp(sys_cmd,"content")==0)
294 {
296 {
298 poly
p=(poly)
h->CopyD();
300 {
303 }
307 }
309 }
310 else
311
312 if(strcmp(sys_cmd,"cpu")==0)
313 {
314 long cpu=1;
315 #ifdef _SC_NPROCESSORS_ONLN
316 cpu=sysconf(_SC_NPROCESSORS_ONLN);
317 #elif defined(_SC_NPROCESSORS_CONF)
318 cpu=sysconf(_SC_NPROCESSORS_CONF);
319 #endif
320 res->data=(
void *)cpu;
323 }
324 else
325
326 if(strcmp(sys_cmd,"executable")==0)
327 {
329 {
336 }
338 }
339 else
340
341 if(strcmp(sys_cmd,"flatten")==0)
342 {
344 {
348 }
349 else
351 }
352 else
353
354 if(strcmp(sys_cmd,"unflatten")==0)
355 {
358 {
362 }
364 }
365 else
366
367 if(strcmp(sys_cmd,"neworder")==0)
368 {
370 {
374 }
375 else
377 }
378 else
379
380
381 if(strcmp(sys_cmd,"nc_hilb") == 0)
382 {
387 int trunDegHs=0;
389 i = (ideal)
h->Data();
390 else
391 {
392 WerrorS(
"nc_Hilb:ideal expected");
394 }
397 lV = (int)(
long)
h->Data();
398 else
399 {
400 WerrorS(
"nc_Hilb:int expected");
402 }
405 {
406 if((
int)(
long)
h->Data() == 1)
408 else if((
int)(
long)
h->Data() == 2)
413 trunDegHs = (int)(
long)
h->Data();
415 }
417 {
418 WerrorS(
"nc_Hilb:int 1,2, total degree for the truncation, and a string for printing the details are expected");
420 }
421
424 }
425 else
426
427 if(strcmp(sys_cmd,"verifyGB")==0)
428 {
430 {
431 WerrorS(
"system(\"verifyGB\",<ideal>,..) expects a commutative ring");
433 }
435 {
436 WerrorS(
"expected system(\"verifyGB\",<ideal>,..)");
438 }
439 ideal F=(ideal)
h->Data();
441 {
442 #ifdef HAVE_VSPACE
444 if (cpus>1)
446 else
447 #endif
449 }
453 }
454 else
455
456 if(strcmp(sys_cmd,"rcolon") == 0)
457 {
460 {
461 ideal
i = (ideal)
h->Data();
463 poly
w=(poly)
h->Data();
465 int lV = (int)(
long)
h->Data();
469 }
470 else
472 }
473 else
474
475
476 if(strcmp(sys_cmd,"sh")==0)
477 {
479 {
480 WerrorS(
"shell execution is disallowed in restricted mode");
482 }
486 res->data = (
void*)(
long)
system((
char*)(
h->Data()));
487 else
490 }
491 else
492
493 if(strcmp(sys_cmd,"reduce_bound")==0)
494 {
502 {
503 p = (poly)
h->CopyD();
504 }
506 {
507 pid = (ideal)
h->CopyD();
508 }
510
512 ideal q = (ideal)
h->next->CopyD();
513 int bound = (int)(
long)
h->next->next->Data();
516 else
519 }
520 else
521
522 if(strcmp(sys_cmd,"uname")==0)
523 {
527 }
528 else
529
530 if(strcmp(sys_cmd,"with")==0)
531 {
533 {
537 }
539 {
540 #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
541 char *
s=(
char *)
h->Data();
543 #ifdef HAVE_DBM
545 #endif
546 #ifdef HAVE_DLD
548 #endif
549
550
551 #ifdef HAVE_READLINE
553 #endif
554 #ifdef TEST_MAC_ORDER
556 #endif
557
559 #ifdef HAVE_DYNAMIC_LOADING
561 #endif
562 #ifdef HAVE_EIGENVAL
564 #endif
565 #ifdef HAVE_GMS
567 #endif
568 #ifdef OM_NDEBUG
570 #endif
571 #ifdef SING_NDEBUG
573 #endif
574 {};
576 #undef TEST_FOR
577 }
579 }
580 else
581
582 if (strcmp(sys_cmd,"browsers")==0)
583 {
589 }
590 else
591
592 if (strcmp(sys_cmd,"pid")==0)
593 {
595 res->data=(
void *)(
long) getpid();
597 }
598 else
599
600 if (strcmp(sys_cmd,"getenv")==0)
601 {
603 {
605 const char *r=
getenv((
char *)
h->Data());
609 }
610 else
611 {
614 }
615 }
616 else
617
618 if (strcmp(sys_cmd,"setenv")==0)
619 {
620 #ifdef HAVE_SETENV
623 {
625 setenv((
char *)
h->Data(), (
char *)
h->next->Data(), 1);
629 }
630 else
631 {
633 }
634 #else
635 WerrorS(
"setenv not supported on this platform");
637 #endif
638 }
639 else
640
641 if (strcmp(sys_cmd, "Singular") == 0)
642 {
648 }
649 else
650 if (strcmp(sys_cmd, "SingularLib") == 0)
651 {
657 }
658 else
659 if (strcmp(sys_cmd, "SingularBin") == 0)
660 {
663 if (r ==
NULL) r=
"/usr/local";
665
666 #define SINGULAR_PROCS_DIR "/libexec/singular/MOD"
669 if ((strstr(r,
".libs/..")==
NULL)
670 &&(strstr(r,
"Singular/..")==
NULL))
671 {
674 if (access(
s,X_OK)==0)
675 {
677 }
678 else
679 {
680
681 strcpy(
s,LIBEXEC_DIR);
682 if (access(
s,X_OK)==0)
683 {
685 }
686 else
687 {
689 }
690 }
691 }
692 else
693 {
696 {
698 }
699 else
700 {
703 }
704 }
705 res->data = (
void*)
s;
707 }
708 else
709
710 if (strstr(sys_cmd, "--") == sys_cmd)
711 {
712 if (strcmp(sys_cmd, "--") == 0)
713 {
716 }
719 {
720 Werror(
"Unknown option %s", sys_cmd);
721 WerrorS(
"Use 'system(\"--\");' for listing of available options");
723 }
724
725
727 {
730 }
732 {
734 {
736 const char *r=(
const char*)
feOptSpec[opt].value;
739 }
740 else
741 {
744 }
746 }
749 {
750 WerrorS(
"Need string or int argument to set option value");
752 }
753 const char* errormsg;
755 {
757 {
758 Werror(
"Need string argument to set value of option %s", sys_cmd);
760 }
762 if (errormsg !=
NULL)
763 Werror(
"Option '--%s=%d' %s", sys_cmd, (
int) ((
long)
h->Data()), errormsg);
764 }
765 else
766 {
768 if (errormsg !=
NULL)
769 Werror(
"Option '--%s=%s' %s", sys_cmd, (
char*)
h->Data(), errormsg);
770 }
773 }
774 else
775
776 if (strcmp(sys_cmd,"HC")==0)
777 {
781 }
782 else
783
784 if(strcmp(sys_cmd,"random")==0)
785 {
788 {
790 {
795 }
796 else
797 {
799 }
800 }
804 }
805 else
806
807 if (strcmp(sys_cmd,"denom_list")==0)
808 {
813 }
814 else
815
816 if(strcmp(sys_cmd,"complexNearZero")==0)
817 {
820 {
822 {
823 WerrorS(
"unsupported ground field!");
825 }
826 else
827 {
830 (int)((
long)(
h->next->Data())));
832 }
833 }
834 else
835 {
837 }
838 }
839 else
840
841 if(strcmp(sys_cmd,"getPrecDigits")==0)
842 {
845 {
846 WerrorS(
"unsupported ground field!");
848 }
851
852
854 }
855 else
856
857 if(strcmp(sys_cmd, "lduDecomp")==0)
858 {
861 {
864 poly
l; poly u; poly prodLU;
865 lduDecomp(aMat, pMat, lMat, dMat, uMat,
l, u, prodLU);
876 res->data = (
char *)L;
878 }
879 else
880 {
882 }
883 }
884 else
885
886 if(strcmp(sys_cmd, "lduSolve")==0)
887 {
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
908 {
910 }
912 {
915 }
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();
926 {
927 Werror(
"first matrix (%d x %d) is not quadratic",
930 }
932 {
933 Werror(
"second matrix (%d x %d) is not quadratic",
936 }
938 {
939 Werror(
"third matrix (%d x %d) is not quadratic",
942 }
944 {
945 Werror(
"third matrix (%d x %d) and fourth matrix (%d x %d) %s",
947 "do not t");
949 }
951 {
952 Werror(
"fourth matrix (%d x %d) and vector (%d x 1) do not fit",
955 }
957 bVec, xVec, homogSolSpace);
958
959
960
962 if (solvable)
963 {
968 }
969 else
970 {
973 }
977 }
978 else
979
980 if (strcmp(sys_cmd, "shared") == 0)
981 {
982 #ifndef SI_COUNTEDREF_AUTOLOAD
985 #endif
988 }
989 else if (strcmp(sys_cmd, "reference") == 0)
990 {
991 #ifndef SI_COUNTEDREF_AUTOLOAD
994 #endif
997 }
998 else
999
1000#ifdef HAVE_SIMPLEIPC
1001 if (strcmp(sys_cmd,"semaphore")==0)
1002 {
1004 {
1006 if ((
h->next->next!=
NULL)&& (
h->next->next->Typ()==
INT_CMD))
1007 v=(int)(
long)
h->next->next->Data();
1011 }
1012 else
1013 {
1014 WerrorS(
"Usage: system(\"semaphore\",<cmd>,int)");
1016 }
1017 }
1018 else
1019#endif
1020
1021 if (strcmp(sys_cmd,"reserve")==0)
1022 {
1026 {
1029 res->data=(
void*)(
long)
p;
1031 }
1033 }
1034 else
1035
1036 if (strcmp(sys_cmd,"reservedLink")==0)
1037 {
1042 }
1043 else
1044
1045 if (strcmp(sys_cmd,"install")==0)
1046 {
1049 {
1051 (
int)(
long)
h->next->next->next->Data(),
1053 }
1055 }
1056 else
1057
1058 if (strcmp(sys_cmd,"newstruct")==0)
1059 {
1062 {
1063 int id=0;
1064 char *n=(
char*)
h->Data();
1066 if (id>0)
1067 {
1070 {
1071 newstruct_desc desc=(newstruct_desc)bb->data;
1074 }
1075 else Werror(
"'%s' is not a newstruct",n);
1076 }
1077 else Werror(
"'%s' is not a blackbox object",n);
1078 }
1080 }
1081 else
1082
1083 if (strcmp(sys_cmd,"blackbox")==0)
1084 {
1087 }
1088 else
1089
1090 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1091 if (strcmp(sys_cmd, "absFact") == 0)
1092 {
1097 {
1101 int n= 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;
1117 }
1119 }
1120 else
1121 #endif
1122
1123 #ifdef HAVE_NTL
1124 if (strcmp(sys_cmd, "LLL") == 0)
1125 {
1127 {
1130 {
1133 }
1135 {
1138 }
1140 }
1142 }
1143 else
1144 #endif
1145
1146 #ifdef HAVE_FLINT
1147 #if __FLINT_RELEASE >= 20500
1148 if (strcmp(sys_cmd, "LLL_Flint") == 0)
1149 {
1151 {
1153 {
1156 {
1159 }
1161 {
1164 }
1166 }
1168 {
1169 WerrorS(
"matrix,int or bigint,int expected");
1171 }
1173 {
1174 if(((
int)((
long)(
h->next->Data())) != 0) && (
int)((
long)(
h->next->Data()) != 1))
1175 {
1176 WerrorS(
"int is different from 0, 1");
1178 }
1180 if((
long)(
h->next->Data()) == 0)
1181 {
1183 {
1186 }
1188 {
1191 }
1193 }
1194
1195 if((
long)(
h->next->Data()) == 1)
1196 {
1198 {
1201 for(
int i = 1;
i<=
m->rows();
i++)
1202 {
1205 }
1214 }
1216 {
1219 for(
int i = 1;
i<=
m->rows();
i++)
1229 }
1231 }
1232 }
1233
1234 }
1236 }
1237 else
1238 #endif
1239 #endif
1240
1241 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1242 if(strcmp(sys_cmd,"rref")==0)
1243 {
1247 {
1249 #if defined(HAVE_FLINT)
1251 #elif defined(HAVE_NTL)
1253 #endif
1256 }
1258 {
1259 ideal
M=(ideal)
h->Data();
1260 #if defined(HAVE_FLINT)
1262 #elif defined(HAVE_NTL)
1264 #endif
1267 }
1268 else
1269 {
1270 WerrorS(
"expected system(\"rref\",<matrix>/<smatrix>)");
1272 }
1273 }
1274 else
1275 #endif
1276
1277 #ifdef HAVE_PCV
1278 if(strcmp(sys_cmd,"pcvLAddL")==0)
1279 {
1281 }
1282 else
1283 if(strcmp(sys_cmd,"pcvPMulL")==0)
1284 {
1286 }
1287 else
1288 if(strcmp(sys_cmd,"pcvMinDeg")==0)
1289 {
1291 }
1292 else
1293 if(strcmp(sys_cmd,"pcvP2CV")==0)
1294 {
1296 }
1297 else
1298 if(strcmp(sys_cmd,"pcvCV2P")==0)
1299 {
1301 }
1302 else
1303 if(strcmp(sys_cmd,"pcvDim")==0)
1304 {
1306 }
1307 else
1308 if(strcmp(sys_cmd,"pcvBasis")==0)
1309 {
1311 }
1312 else
1313 #endif
1314
1315 #ifdef HAVE_EIGENVAL
1316 if(strcmp(sys_cmd,"hessenberg")==0)
1317 {
1319 }
1320 else
1321 #endif
1322
1323 #ifdef HAVE_EIGENVAL
1324 if(strcmp(sys_cmd,"eigenvals")==0)
1325 {
1327 }
1328 else
1329 #endif
1330
1331 #ifdef HAVE_EIGENVAL
1332 if(strcmp(sys_cmd,"rowelim")==0)
1333 {
1335 }
1336 else
1337 #endif
1338
1339 #ifdef HAVE_EIGENVAL
1340 if(strcmp(sys_cmd,"rowcolswap")==0)
1341 {
1343 }
1344 else
1345 #endif
1346
1347 #ifdef HAVE_GMS
1348 if(strcmp(sys_cmd,"gmsnf")==0)
1349 {
1351 }
1352 else
1353 #endif
1354
1355 if(strcmp(sys_cmd,"contributors") == 0)
1356 {
1359 "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");
1361 }
1362 else
1363
1364 #ifdef HAVE_SPECTRUM
1365 if(strcmp(sys_cmd,"spectrum") == 0)
1366 {
1368 {
1371 }
1375 {
1378 }
1379 if(((
long)
h->next->Data())==1L)
1382 }
1383 else
1384
1385 if(strcmp(sys_cmd,"semic") == 0)
1386 {
1390 {
1391 if (
h->next->next==
NULL)
1393 else if (
h->next->next->Typ()==
INT_CMD)
1395 }
1397 }
1398 else
1399
1400 if(strcmp(sys_cmd,"spadd") == 0)
1401 {
1404 {
1406 }
1408 }
1409 else
1410
1411 if(strcmp(sys_cmd,"spmul") == 0)
1412 {
1415 {
1417 }
1419 }
1420 else
1421 #endif
1422
1423 #define HAVE_SHEAFCOH_TRICKS 1
1424
1425 #ifdef HAVE_SHEAFCOH_TRICKS
1426 if(strcmp(sys_cmd,"tensorModuleMult")==0)
1427 {
1429
1431 {
1432 int m = (int)( (
long)
h->Data() );
1433 ideal
M = (ideal)
h->next->Data();
1437 }
1439 }
1440 else
1441 #endif
1442
1443 #ifdef HAVE_PLURAL
1444 if (strcmp(sys_cmd, "twostd") == 0)
1445 {
1446 ideal I;
1448 {
1449 I=(ideal)
h->CopyD();
1455 }
1458 }
1459 else
1460 #endif
1461
1462 #ifdef HAVE_PLURAL
1463 if (strcmp(sys_cmd, "bracket") == 0)
1464 {
1467 {
1468 poly
p=(poly)
h->CopyD();
1470 poly q=(poly)
h->Data();
1474 }
1476 }
1477 else
1478 #endif
1479
1480 #ifdef HAVE_PLURAL
1481 if (strcmp(sys_cmd, "env")==0)
1482 {
1484 {
1485 ring r = (ring)
h->Data();
1489 }
1490 else
1491 {
1492 WerrorS(
"`system(\"env\",<ring>)` expected");
1494 }
1495 }
1496 else
1497 #endif
1498
1499 #ifdef HAVE_PLURAL
1500 if (strcmp(sys_cmd, "opp")==0)
1501 {
1503 {
1504 ring r=(ring)
h->Data();
1508 }
1509 else
1510 {
1511 WerrorS(
"`system(\"opp\",<ring>)` expected");
1513 }
1514 }
1515 else
1516 #endif
1517
1518 #ifdef HAVE_PLURAL
1519 if (strcmp(sys_cmd, "oppose")==0)
1520 {
1522 && (
h->next!=
NULL))
1523 {
1524 ring Rop = (ring)
h->Data();
1528 {
1533 }
1534 }
1535 else
1536 {
1537 WerrorS(
"`system(\"oppose\",<ring>,<poly>)` expected");
1539 }
1540 }
1541 else
1542 #endif
1543
1544
1545 #ifdef HAVE_WALK
1546 #ifdef OWNW
1547 if (strcmp(sys_cmd, "walkNextWeight") == 0)
1548 {
1553 {
1554 Werror(
"system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1557 }
1558 res->data = (
void*) walkNextWeight(((
intvec*)
h->Data()),
1560 (ideal)
h->next->next->Data());
1561 if (
res->data ==
NULL ||
res->data == (
void*) 1L)
1562 {
1564 }
1565 else
1566 {
1568 }
1570 }
1571 else
1572 #endif
1573 #endif
1574
1575 #ifdef HAVE_WALK
1576 #ifdef OWNW
1577 if (strcmp(sys_cmd, "walkInitials") == 0)
1578 {
1580 {
1581 WerrorS(
"system(\"walkInitials\", ideal) expected");
1583 }
1584 res->data = (
void*) walkInitials((ideal)
h->Data());
1587 }
1588 else
1589 #endif
1590 #endif
1591
1592 #ifdef HAVE_WALK
1593 #ifdef WAIV
1594 if (strcmp(sys_cmd, "walkAddIntVec") == 0)
1595 {
1600 res->data = (
intvec*) walkAddIntVec(arg1, arg2);
1603 }
1604 else
1605 #endif
1606 #endif
1607
1608 #ifdef HAVE_WALK
1609 #ifdef MwaklNextWeight
1610 if (strcmp(sys_cmd, "MwalkNextWeight") == 0)
1611 {
1616 {
1617 Werror(
"system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1620 }
1623 ideal arg3 = (ideal)
h->next->next->Data();
1628 }
1629 else
1630 #endif
1631 #endif
1632
1633 #ifdef HAVE_WALK
1634 if(strcmp(sys_cmd, "Mivdp") == 0)
1635 {
1637 {
1638 WerrorS(
"system(\"Mivdp\", int) expected");
1640 }
1641 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1642 {
1643 Werror(
"system(\"Mivdp\" ...) intvecs not of length %d\n",
1646 }
1647 int arg1 = (int) ((
long)(
h->Data()));
1652 }
1653 else
1654 #endif
1655
1656 #ifdef HAVE_WALK
1657 if(strcmp(sys_cmd, "Mivlp") == 0)
1658 {
1660 {
1661 WerrorS(
"system(\"Mivlp\", int) expected");
1663 }
1664 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1665 {
1666 Werror(
"system(\"Mivlp\" ...) intvecs not of length %d\n",
1669 }
1670 int arg1 = (int) ((
long)(
h->Data()));
1675 }
1676 else
1677 #endif
1678
1679 #ifdef HAVE_WALK
1680 #ifdef MpDiv
1681 if(strcmp(sys_cmd, "MpDiv") == 0)
1682 {
1685 poly arg1 = (poly)
h->Data();
1686 poly arg2 = (poly)
h->next->Data();
1687 poly
result = MpDiv(arg1, arg2);
1691 }
1692 else
1693 #endif
1694 #endif
1695
1696 #ifdef HAVE_WALK
1697 #ifdef MpMult
1698 if(strcmp(sys_cmd, "MpMult") == 0)
1699 {
1702 poly arg1 = (poly)
h->Data();
1703 poly arg2 = (poly)
h->next->Data();
1704 poly
result = MpMult(arg1, arg2);
1708 }
1709 else
1710 #endif
1711 #endif
1712
1713 #ifdef HAVE_WALK
1714 if (strcmp(sys_cmd, "MivSame") == 0)
1715 {
1718
1719
1720
1721
1722
1723
1724
1725
1726
1729
1730
1731
1732
1733
1735 res->data = (
void*)(
long)
MivSame(arg1, arg2);
1737 }
1738 else
1739 #endif
1740
1741 #ifdef HAVE_WALK
1742 if (strcmp(sys_cmd, "M3ivSame") == 0)
1743 {
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1759
1760
1761
1762
1763
1765 res->data = (
void*)(
long)
M3ivSame(arg1, arg2, arg3);
1767 }
1768 else
1769 #endif
1770
1771 #ifdef HAVE_WALK
1772 if(strcmp(sys_cmd, "MwalkInitialForm") == 0)
1773 {
1777 {
1778 Werror(
"system \"MwalkInitialForm\"...) intvec not of length %d\n",
1781 }
1782 ideal
id = (ideal)
h->Data();
1788 }
1789 else
1790 #endif
1791
1792 #ifdef HAVE_WALK
1793
1794 if(strcmp(sys_cmd, "MivMatrixOrder") == 0)
1795 {
1797 {
1798 WerrorS(
"system(\"MivMatrixOrder\",intvec) expected");
1800 }
1806 }
1807 else
1808 #endif
1809
1810 #ifdef HAVE_WALK
1811 if(strcmp(sys_cmd, "MivMatrixOrderdp") == 0)
1812 {
1814 {
1815 WerrorS(
"system(\"MivMatrixOrderdp\",intvec) expected");
1817 }
1818 int arg1 = (int) ((
long)(
h->Data()));
1823 }
1824 else
1825 #endif
1826
1827 #ifdef HAVE_WALK
1828 if(strcmp(sys_cmd, "MPertVectors") == 0)
1829 {
1832 ideal arg1 = (ideal)
h->Data();
1834 int arg3 = (int) ((
long)(
h->next->next->Data()));
1839 }
1840 else
1841 #endif
1842
1843 #ifdef HAVE_WALK
1844 if(strcmp(sys_cmd, "MPertVectorslp") == 0)
1845 {
1848 ideal arg1 = (ideal)
h->Data();
1850 int arg3 = (int) ((
long)(
h->next->next->Data()));
1855 }
1856 else
1857 #endif
1858
1859 #ifdef HAVE_WALK
1860 if(strcmp(sys_cmd, "Mfpertvector") == 0)
1861 {
1864 ideal arg1 = (ideal)
h->Data();
1870 }
1871 else
1872 #endif
1873
1874 #ifdef HAVE_WALK
1875 if(strcmp(sys_cmd, "MivUnit") == 0)
1876 {
1879 int arg1 = (int) ((
long)(
h->Data()));
1884 }
1885 else
1886 #endif
1887
1888 #ifdef HAVE_WALK
1889 if(strcmp(sys_cmd, "MivWeightOrderlp") == 0)
1890 {
1898 }
1899 else
1900 #endif
1901
1902 #ifdef HAVE_WALK
1903 if(strcmp(sys_cmd, "MivWeightOrderdp") == 0)
1904 {
1906 {
1907 WerrorS(
"system(\"MivWeightOrderdp\",intvec) expected");
1909 }
1911
1916 }
1917 else
1918 #endif
1919
1920 #ifdef HAVE_WALK
1921 if(strcmp(sys_cmd, "MivMatrixOrderlp") == 0)
1922 {
1924 {
1925 WerrorS(
"system(\"MivMatrixOrderlp\",int) expected");
1927 }
1928 int arg1 = (int) ((
long)(
h->Data()));
1933 }
1934 else
1935 #endif
1936
1937 #ifdef HAVE_WALK
1938 if (strcmp(sys_cmd, "MkInterRedNextWeight") == 0)
1939 {
1944 {
1945 Werror(
"system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1948 }
1951 ideal arg3 = (ideal)
h->next->next->Data();
1956 }
1957 else
1958 #endif
1959
1960 #ifdef HAVE_WALK
1961 #ifdef MPertNextWeight
1962 if (strcmp(sys_cmd, "MPertNextWeight") == 0)
1963 {
1967 {
1968 Werror(
"system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1971 }
1973 ideal arg2 = (ideal)
h->next->Data();
1974 int arg3 = (int)
h->next->next->Data();
1979 }
1980 else
1981 #endif
1982 #endif
1983
1984 #ifdef HAVE_WALK
1985 #ifdef Mivperttarget
1986 if (strcmp(sys_cmd, "Mivperttarget") == 0)
1987 {
1990 ideal arg1 = (ideal)
h->Data();
1991 int arg2 = (int)
h->next->Data();
1996 }
1997 else
1998 #endif
1999 #endif
2000
2001 #ifdef HAVE_WALK
2002 if (strcmp(sys_cmd, "Mwalk") == 0)
2003 {
2008 {
2009 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d\n",
2012 }
2013 ideal arg1 = (ideal)
h->CopyD();
2016 ring arg4 = (ring)
h->next->next->next->Data();
2017 int arg5 = (int) (
long)
h->next->next->next->next->Data();
2018 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2019 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2023 }
2024 else
2025 #endif
2026
2027 #ifdef HAVE_WALK
2028 #ifdef MPWALK_ORIG
2029 if (strcmp(sys_cmd, "Mwalk") == 0)
2030 {
2037 {
2038 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2041 }
2042 ideal arg1 = (ideal)
h->Data();
2045 ring arg4 = (ring)
h->next->next->next->Data();
2046 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3,arg4);
2050 }
2051 else
2052 #else
2053 if (strcmp(sys_cmd, "Mpwalk") == 0)
2054 {
2059 {
2060 Werror(
"system(\"Mpwalk\" ...) intvecs not of length %d\n",
currRing->N);
2062 }
2063 ideal arg1 = (ideal)
h->Data();
2064 int arg2 = (int) (
long)
h->next->Data();
2065 int arg3 = (int) (
long)
h->next->next->Data();
2068 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2069 int arg7 = (int) (
long)
h->next->next->next->next->next->next->Data();
2070 int arg8 = (int) (
long)
h->next->next->next->next->next->next->next->Data();
2071 ideal
result = (ideal)
Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2075 }
2076 else
2077 #endif
2078 #endif
2079
2080 #ifdef HAVE_WALK
2081 if (strcmp(sys_cmd, "Mrwalk") == 0)
2082 {
2089 {
2090 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2093 }
2094 ideal arg1 = (ideal)
h->Data();
2097 int arg4 = (int)(
long)
h->next->next->next->Data();
2098 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2099 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2100 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2101 ideal
result = (ideal)
Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2105 }
2106 else
2107 #endif
2108
2109 #ifdef HAVE_WALK
2110 if (strcmp(sys_cmd, "MAltwalk1") == 0)
2111 {
2116 {
2117 Werror(
"system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2120 }
2121 ideal arg1 = (ideal)
h->Data();
2122 int arg2 = (int) ((
long)(
h->next->Data()));
2123 int arg3 = (int) ((
long)(
h->next->next->Data()));
2130 }
2131 else
2132 #endif
2133
2134 #ifdef HAVE_WALK
2135 #ifdef MFWALK_ALT
2136 if (strcmp(sys_cmd, "Mfwalk_alt") == 0)
2137 {
2142 {
2143 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2146 }
2147 ideal arg1 = (ideal)
h->Data();
2150 int arg4 = (int)
h->next->next->next->Data();
2151 ideal
result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2155 }
2156 else
2157 #endif
2158 #endif
2159
2160 #ifdef HAVE_WALK
2161 if (strcmp(sys_cmd, "Mfwalk") == 0)
2162 {
2167 {
2168 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2171 }
2172 ideal arg1 = (ideal)
h->Data();
2175 int arg4 = (int)(
long)
h->next->next->next->Data();
2176 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2177 ideal
result = (ideal)
Mfwalk(arg1, arg2, arg3, arg4, arg5);
2181 }
2182 else
2183 #endif
2184
2185 #ifdef HAVE_WALK
2186 if (strcmp(sys_cmd, "Mfrwalk") == 0)
2187 {
2190
2191
2192
2193
2194
2195
2196
2197
2202 {
2203 Werror(
"system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2206 }
2207
2208 ideal arg1 = (ideal)
h->Data();
2211 int arg4 = (int)(
long)
h->next->next->next->Data();
2212 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2213 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2214 ideal
result = (ideal)
Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2218 }
2219 else
2220
2221 if (strcmp(sys_cmd, "Mprwalk") == 0)
2222 {
2229 {
2230 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2233 }
2234 ideal arg1 = (ideal)
h->Data();
2237 int arg4 = (int)(
long)
h->next->next->next->Data();
2238 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2239 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2240 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2241 int arg8 = (int)(
long)
h->next->next->next->next->next->next->next->Data();
2242 int arg9 = (int)(
long)
h->next->next->next->next->next->next->next->next->Data();
2243 ideal
result = (ideal)
Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2247 }
2248 else
2249 #endif
2250
2251 #ifdef HAVE_WALK
2252 #ifdef TRAN_Orig
2253 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2254 {
2259 {
2260 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2263 }
2264 ideal arg1 = (ideal)
h->Data();
2271 }
2272 else
2273 #endif
2274 #endif
2275
2276 #ifdef HAVE_WALK
2277 if (strcmp(sys_cmd, "MAltwalk2") == 0)
2278 {
2283 {
2284 Werror(
"system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2287 }
2288 ideal arg1 = (ideal)
h->Data();
2295 }
2296 else
2297 #endif
2298
2299 #ifdef HAVE_WALK
2300 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2301 {
2306 {
2307 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2310 }
2311 ideal arg1 = (ideal)
h->Data();
2314 int arg4 = (int) ((
long)(
h->next->next->next->Data()));
2319 }
2320 else
2321 #endif
2322
2323 #if 0
2324 #ifdef HAVE_WALK
2325 if (strcmp(sys_cmd, "TranMrImprovwalk") == 0)
2326 {
2330 h->next->next->next ==
NULL ||
h->next->next->next->Typ() !=
INT_CMD ||
2331 h->next->next->next ==
NULL ||
h->next->next->next->next->Typ() !=
INT_CMD ||
2332 h->next->next->next ==
NULL ||
h->next->next->next->next->next->Typ() !=
INT_CMD)
2333 {
2334 WerrorS(
"system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2336 }
2339 {
2340 Werror(
"system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n",
currRing->N);
2342 }
2343 ideal arg1 = (ideal)
h->Data();
2346 int arg4 = (int)(
long)
h->next->next->next->Data();
2347 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2348 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2349 ideal
result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2353 }
2354 else
2355 #endif
2356 #endif
2357
2358 {
2359 #ifndef MAKE_DISTRIBUTION
2361 #else
2363 #endif
2364 }
2365 }
2367}
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)
static CanonicalForm bound(const CFMatrix &M)
void factoryseed(int s)
random seed initializer
matrix singntl_rref(matrix m, const ring R)
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
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
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.
void countedref_reference_load()
Initialize blackbox types 'reference' and 'shared', or both.
void countedref_shared_load()
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)
feOptIndex feGetOptIndex(const char *name)
const char * feSetOptValue(feOptIndex opt, char *optarg)
EXTERN_VAR struct fe_option feOptSpec[]
static char * feResource(feResourceConfig config, int warn)
void feStringAppendBrowsers(int warn)
matrix singflint_rref(matrix m, const ring R)
bigintmat * singflint_LLL(bigintmat *A, bigintmat *T)
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 BOOLEAN length(leftv result, leftv arg)
#define IMATELEM(M, I, J)
BOOLEAN spaddProc(leftv result, leftv first, leftv second)
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)
BOOLEAN semicProc(leftv res, leftv u, leftv v)
poly kNFBound(ideal F, ideal Q, poly p, int bound, int syzComp, int lazyReduce)
BOOLEAN kVerify2(ideal F, ideal Q)
BOOLEAN kVerify1(ideal F, ideal Q)
poly pOppose(ring Rop_src, poly p, const ring Rop_dst)
opposes a vector p from Rop to currRing (dst!)
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
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 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...
ideal sm_UnFlatten(ideal a, int col, const ring R)
ideal sm_Flatten(ideal a, const ring R)
EXTERN_VAR size_t gmp_output_digits
bool complexNearZero(gmp_complex *c, int digits)
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)
char * omFindExec(const char *name, char *exec)
void p_Content(poly ph, const ring r)
poly p_Cleardenom(poly p, const ring r)
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)
void StringSetS(const char *st)
static int rBlocks(ring r)
static BOOLEAN rField_is_long_C(const ring r)
static BOOLEAN rIsNCRing(const ring r)
#define rField_is_Ring(R)
int simpleipc_cmd(char *cmd, int id, int v)
int ssiReservePort(int clients)
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)