233{
235 {
236 const char *sys_cmd=(
char *)(args->
Data());
238
239
240
241 if (strcmp(sys_cmd, "nblocks") == 0)
242 {
243 ring r;
245 {
247 {
249 }
250 else
251 {
254 }
255 }
256 else
257 {
259 {
262 }
263 r = (ring)
h->Data();
264 }
268 }
269
270 if(strcmp(sys_cmd,"version")==0)
271 {
275 }
276 else
277
278 if(strcmp(sys_cmd,"alarm")==0)
279 {
281 {
282
283
284
285 struct itimerval t,o;
286 memset(&t,0,sizeof(t));
287 t.it_value.tv_sec =(unsigned)((
unsigned long)
h->Data());
288 setitimer(ITIMER_VIRTUAL,&t,&o);
290 }
291 else
293 }
294 else
295
296 if(strcmp(sys_cmd,"content")==0)
297 {
299 {
301 poly
p=(poly)
h->CopyD();
303 {
306 }
310 }
312 }
313 else
314
315 if(strcmp(sys_cmd,"cpu")==0)
316 {
317 long cpu=1;
318 #ifdef _SC_NPROCESSORS_ONLN
319 cpu=sysconf(_SC_NPROCESSORS_ONLN);
320 #elif defined(_SC_NPROCESSORS_CONF)
321 cpu=sysconf(_SC_NPROCESSORS_CONF);
322 #endif
323 res->data=(
void *)cpu;
326 }
327 else
328
329 if(strcmp(sys_cmd,"executable")==0)
330 {
332 {
339 }
341 }
342 else
343
344 if(strcmp(sys_cmd,"flatten")==0)
345 {
347 {
351 }
352 else
354 }
355 else
356
357 if(strcmp(sys_cmd,"unflatten")==0)
358 {
361 {
365 }
367 }
368 else
369
370 if(strcmp(sys_cmd,"neworder")==0)
371 {
373 {
377 }
378 else
380 }
381 else
382
383
384 if(strcmp(sys_cmd,"nc_hilb") == 0)
385 {
390 int trunDegHs=0;
392 i = (ideal)
h->Data();
393 else
394 {
395 WerrorS(
"nc_Hilb:ideal expected");
397 }
400 lV = (int)(
long)
h->Data();
401 else
402 {
403 WerrorS(
"nc_Hilb:int expected");
405 }
408 {
409 if((
int)(
long)
h->Data() == 1)
411 else if((
int)(
long)
h->Data() == 2)
416 trunDegHs = (int)(
long)
h->Data();
418 }
420 {
421 WerrorS(
"nc_Hilb:int 1,2, total degree for the truncation, and a string for printing the details are expected");
423 }
424
427 }
428 else
429
430 if(strcmp(sys_cmd,"verifyGB")==0)
431 {
433 {
434 WerrorS(
"system(\"verifyGB\",<ideal>,..) expects a commutative ring");
436 }
438 {
439 WerrorS(
"expected system(\"verifyGB\",<ideal>,..)");
441 }
442 ideal F=(ideal)
h->Data();
444 {
445 #ifdef HAVE_VSPACE
447 if (cpus>1)
449 else
450 #endif
452 }
456 }
457 else
458
459 if(strcmp(sys_cmd,"rcolon") == 0)
460 {
463 {
464 ideal
i = (ideal)
h->Data();
466 poly
w=(poly)
h->Data();
468 int lV = (int)(
long)
h->Data();
472 }
473 else
475 }
476 else
477
478
479 if(strcmp(sys_cmd,"sh")==0)
480 {
482 {
483 WerrorS(
"shell execution is disallowed in restricted mode");
485 }
487 if (
h==
NULL)
res->data = (
void *)(
long) system(
"sh");
489 res->data = (
void*)(
long) system((
char*)(
h->Data()));
490 else
493 }
494 else
495
496 if(strcmp(sys_cmd,"reduce_bound")==0)
497 {
505 {
506 p = (poly)
h->CopyD();
507 }
509 {
510 pid = (ideal)
h->CopyD();
511 }
513
515 ideal q = (ideal)
h->next->CopyD();
516 int bound = (int)(
long)
h->next->next->Data();
519 else
522 }
523 else
524
525 if(strcmp(sys_cmd,"uname")==0)
526 {
530 }
531 else
532
533 if(strcmp(sys_cmd,"with")==0)
534 {
536 {
540 }
542 {
543 #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
544 char *
s=(
char *)
h->Data();
546 #ifdef HAVE_DBM
548 #endif
549 #ifdef HAVE_DLD
551 #endif
552
553
554 #ifdef HAVE_READLINE
556 #endif
557 #ifdef TEST_MAC_ORDER
559 #endif
560
562 #ifdef HAVE_DYNAMIC_LOADING
564 #endif
565 #ifdef HAVE_EIGENVAL
567 #endif
568 #ifdef HAVE_GMS
570 #endif
571 #ifdef OM_NDEBUG
573 #endif
574 #ifdef SING_NDEBUG
576 #endif
577 {};
579 #undef TEST_FOR
580 }
582 }
583 else
584
585 if (strcmp(sys_cmd,"browsers")==0)
586 {
592 }
593 else
594
595 if (strcmp(sys_cmd,"pid")==0)
596 {
598 res->data=(
void *)(
long) getpid();
600 }
601 else
602
603 if (strcmp(sys_cmd,"getenv")==0)
604 {
606 {
608 const char *r=
getenv((
char *)
h->Data());
612 }
613 else
614 {
617 }
618 }
619 else
620
621 if (strcmp(sys_cmd,"setenv")==0)
622 {
623 #ifdef HAVE_SETENV
626 {
628 setenv((
char *)
h->Data(), (
char *)
h->next->Data(), 1);
632 }
633 else
634 {
636 }
637 #else
638 WerrorS(
"setenv not supported on this platform");
640 #endif
641 }
642 else
643
644 if (strcmp(sys_cmd, "Singular") == 0)
645 {
651 }
652 else
653 if (strcmp(sys_cmd, "SingularLib") == 0)
654 {
660 }
661 else
662 if (strcmp(sys_cmd, "SingularBin") == 0)
663 {
666 if (r ==
NULL) r=
"/usr/local";
668
669 #define SINGULAR_PROCS_DIR "/libexec/singular/MOD"
672 if ((strstr(r,
".libs/..")==
NULL)
673 &&(strstr(r,
"Singular/..")==
NULL))
674 {
677 if (access(
s,X_OK)==0)
678 {
680 }
681 else
682 {
683
684 strcpy(
s,LIBEXEC_DIR);
685 if (access(
s,X_OK)==0)
686 {
688 }
689 else
690 {
692 }
693 }
694 }
695 else
696 {
699 {
701 }
702 else
703 {
706 }
707 }
708 res->data = (
void*)
s;
710 }
711 else
712
713 if (strstr(sys_cmd, "--") == sys_cmd)
714 {
715 if (strcmp(sys_cmd, "--") == 0)
716 {
719 }
722 {
723 Werror(
"Unknown option %s", sys_cmd);
724 WerrorS(
"Use 'system(\"--\");' for listing of available options");
726 }
727
728
730 {
733 }
735 {
737 {
739 const char *r=(
const char*)
feOptSpec[opt].value;
742 }
743 else
744 {
747 }
749 }
752 {
753 WerrorS(
"Need string or int argument to set option value");
755 }
756 const char* errormsg;
758 {
760 {
761 Werror(
"Need string argument to set value of option %s", sys_cmd);
763 }
765 if (errormsg !=
NULL)
766 Werror(
"Option '--%s=%d' %s", sys_cmd, (
int) ((
long)
h->Data()), errormsg);
767 }
768 else
769 {
771 if (errormsg !=
NULL)
772 Werror(
"Option '--%s=%s' %s", sys_cmd, (
char*)
h->Data(), errormsg);
773 }
776 }
777 else
778
779 if (strcmp(sys_cmd,"HC")==0)
780 {
784 }
785 else
786
787 if(strcmp(sys_cmd,"random")==0)
788 {
791 {
793 {
798 }
799 else
800 {
802 }
803 }
807 }
808 else
809
810 if (strcmp(sys_cmd,"denom_list")==0)
811 {
816 }
817 else
818
819 if(strcmp(sys_cmd,"complexNearZero")==0)
820 {
823 {
825 {
826 WerrorS(
"unsupported ground field!");
828 }
829 else
830 {
833 (int)((
long)(
h->next->Data())));
835 }
836 }
837 else
838 {
840 }
841 }
842 else
843
844 if(strcmp(sys_cmd,"getPrecDigits")==0)
845 {
848 {
849 WerrorS(
"unsupported ground field!");
851 }
854
855
857 }
858 else
859
860 if(strcmp(sys_cmd, "lduDecomp")==0)
861 {
864 {
867 poly
l; poly u; poly prodLU;
868 lduDecomp(aMat, pMat, lMat, dMat, uMat,
l, u, prodLU);
879 res->data = (
char *)L;
881 }
882 else
883 {
885 }
886 }
887 else
888
889 if(strcmp(sys_cmd, "lduSolve")==0)
890 {
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
911 {
913 }
915 {
918 }
923 poly
l = (poly)
h->next->next->next->next->Data();
924 poly u = (poly)
h->next->next->next->next->next->Data();
925 poly lTimesU = (poly)
h->next->next->next->next->next->next->Data();
926 matrix bVec = (
matrix)
h->next->next->next->next->next->next->next->Data();
929 {
930 Werror(
"first matrix (%d x %d) is not quadratic",
933 }
935 {
936 Werror(
"second matrix (%d x %d) is not quadratic",
939 }
941 {
942 Werror(
"third matrix (%d x %d) is not quadratic",
945 }
947 {
948 Werror(
"third matrix (%d x %d) and fourth matrix (%d x %d) %s",
950 "do not t");
952 }
954 {
955 Werror(
"fourth matrix (%d x %d) and vector (%d x 1) do not fit",
958 }
960 bVec, xVec, homogSolSpace);
961
962
963
965 if (solvable)
966 {
971 }
972 else
973 {
976 }
980 }
981 else
982
983 if (strcmp(sys_cmd, "shared") == 0)
984 {
985 #ifndef SI_COUNTEDREF_AUTOLOAD
988 #endif
991 }
992 else if (strcmp(sys_cmd, "reference") == 0)
993 {
994 #ifndef SI_COUNTEDREF_AUTOLOAD
997 #endif
1000 }
1001 else
1002
1003#ifdef HAVE_SIMPLEIPC
1004 if (strcmp(sys_cmd,"semaphore")==0)
1005 {
1007 {
1009 if ((
h->next->next!=
NULL)&& (
h->next->next->Typ()==
INT_CMD))
1010 v=(int)(
long)
h->next->next->Data();
1014 }
1015 else
1016 {
1017 WerrorS(
"Usage: system(\"semaphore\",<cmd>,int)");
1019 }
1020 }
1021 else
1022#endif
1023
1024 if (strcmp(sys_cmd,"reserve")==0)
1025 {
1029 {
1032 res->data=(
void*)(
long)
p;
1034 }
1036 }
1037 else
1038
1039 if (strcmp(sys_cmd,"reservedLink")==0)
1040 {
1045 }
1046 else
1047
1048 if (strcmp(sys_cmd,"install")==0)
1049 {
1052 {
1054 (
int)(
long)
h->next->next->next->Data(),
1056 }
1058 }
1059 else
1060
1061 if (strcmp(sys_cmd,"newstruct")==0)
1062 {
1065 {
1066 int id=0;
1067 char *n=(
char*)
h->Data();
1069 if (id>0)
1070 {
1073 {
1074 newstruct_desc desc=(newstruct_desc)bb->data;
1077 }
1078 else Werror(
"'%s' is not a newstruct",n);
1079 }
1080 else Werror(
"'%s' is not a blackbox object",n);
1081 }
1083 }
1084 else
1085
1086 if (strcmp(sys_cmd,"blackbox")==0)
1087 {
1090 }
1091 else
1092
1093 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1094 if (strcmp(sys_cmd, "absFact") == 0)
1095 {
1100 {
1104 int n= 0;
1111 l->m[0].data=(
void *)
f;
1113 l->m[1].data=(
void *)
v;
1115 l->m[2].data=(
void*) mipos;
1117 l->m[3].data=(
void*) (
long) n;
1118 res->data=(
void *)
l;
1120 }
1122 }
1123 else
1124 #endif
1125
1126 #ifdef HAVE_NTL
1127 if (strcmp(sys_cmd, "LLL") == 0)
1128 {
1130 {
1133 {
1136 }
1138 {
1141 }
1143 }
1145 }
1146 else
1147 #endif
1148
1149 #ifdef HAVE_FLINT
1150 #if __FLINT_RELEASE >= 20500
1151 if (strcmp(sys_cmd, "LLL_Flint") == 0)
1152 {
1154 {
1156 {
1159 {
1162 }
1164 {
1167 }
1169 }
1171 {
1172 WerrorS(
"matrix,int or bigint,int expected");
1174 }
1176 {
1177 if(((
int)((
long)(
h->next->Data())) != 0) && (
int)((
long)(
h->next->Data()) != 1))
1178 {
1179 WerrorS(
"int is different from 0, 1");
1181 }
1183 if((
long)(
h->next->Data()) == 0)
1184 {
1186 {
1189 }
1191 {
1194 }
1196 }
1197
1198 if((
long)(
h->next->Data()) == 1)
1199 {
1201 {
1204 for(
int i = 1;
i<=
m->rows();
i++)
1205 {
1208 }
1217 }
1219 {
1222 for(
int i = 1;
i<=
m->rows();
i++)
1232 }
1234 }
1235 }
1236
1237 }
1239 }
1240 else
1241 #endif
1242 #endif
1243
1244 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1245 if(strcmp(sys_cmd,"rref")==0)
1246 {
1250 {
1252 #if defined(HAVE_FLINT)
1254 #elif defined(HAVE_NTL)
1256 #endif
1259 }
1261 {
1262 ideal
M=(ideal)
h->Data();
1263 #if defined(HAVE_FLINT)
1265 #elif defined(HAVE_NTL)
1267 #endif
1270 }
1271 else
1272 {
1273 WerrorS(
"expected system(\"rref\",<matrix>/<smatrix>)");
1275 }
1276 }
1277 else
1278 #endif
1279
1280 #ifdef HAVE_PCV
1281 if(strcmp(sys_cmd,"pcvLAddL")==0)
1282 {
1284 }
1285 else
1286 if(strcmp(sys_cmd,"pcvPMulL")==0)
1287 {
1289 }
1290 else
1291 if(strcmp(sys_cmd,"pcvMinDeg")==0)
1292 {
1294 }
1295 else
1296 if(strcmp(sys_cmd,"pcvP2CV")==0)
1297 {
1299 }
1300 else
1301 if(strcmp(sys_cmd,"pcvCV2P")==0)
1302 {
1304 }
1305 else
1306 if(strcmp(sys_cmd,"pcvDim")==0)
1307 {
1309 }
1310 else
1311 if(strcmp(sys_cmd,"pcvBasis")==0)
1312 {
1314 }
1315 else
1316 #endif
1317
1318 #ifdef HAVE_EIGENVAL
1319 if(strcmp(sys_cmd,"hessenberg")==0)
1320 {
1322 }
1323 else
1324 #endif
1325
1326 #ifdef HAVE_EIGENVAL
1327 if(strcmp(sys_cmd,"eigenvals")==0)
1328 {
1330 }
1331 else
1332 #endif
1333
1334 #ifdef HAVE_EIGENVAL
1335 if(strcmp(sys_cmd,"rowelim")==0)
1336 {
1338 }
1339 else
1340 #endif
1341
1342 #ifdef HAVE_EIGENVAL
1343 if(strcmp(sys_cmd,"rowcolswap")==0)
1344 {
1346 }
1347 else
1348 #endif
1349
1350 #ifdef HAVE_GMS
1351 if(strcmp(sys_cmd,"gmsnf")==0)
1352 {
1354 }
1355 else
1356 #endif
1357
1358 if(strcmp(sys_cmd,"contributors") == 0)
1359 {
1362 "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");
1364 }
1365 else
1366
1367 #ifdef HAVE_SPECTRUM
1368 if(strcmp(sys_cmd,"spectrum") == 0)
1369 {
1371 {
1374 }
1378 {
1381 }
1382 if(((
long)
h->next->Data())==1L)
1385 }
1386 else
1387
1388 if(strcmp(sys_cmd,"semic") == 0)
1389 {
1393 {
1394 if (
h->next->next==
NULL)
1396 else if (
h->next->next->Typ()==
INT_CMD)
1398 }
1400 }
1401 else
1402
1403 if(strcmp(sys_cmd,"spadd") == 0)
1404 {
1407 {
1409 }
1411 }
1412 else
1413
1414 if(strcmp(sys_cmd,"spmul") == 0)
1415 {
1418 {
1420 }
1422 }
1423 else
1424 #endif
1425
1426 #define HAVE_SHEAFCOH_TRICKS 1
1427
1428 #ifdef HAVE_SHEAFCOH_TRICKS
1429 if(strcmp(sys_cmd,"tensorModuleMult")==0)
1430 {
1432
1434 {
1435 int m = (int)( (
long)
h->Data() );
1436 ideal
M = (ideal)
h->next->Data();
1440 }
1442 }
1443 else
1444 #endif
1445
1446 #ifdef HAVE_PLURAL
1447 if (strcmp(sys_cmd, "twostd") == 0)
1448 {
1449 ideal I;
1451 {
1452 I=(ideal)
h->CopyD();
1458 }
1461 }
1462 else
1463 #endif
1464
1465 #ifdef HAVE_PLURAL
1466 if (strcmp(sys_cmd, "bracket") == 0)
1467 {
1470 {
1471 poly
p=(poly)
h->CopyD();
1473 poly q=(poly)
h->Data();
1477 }
1479 }
1480 else
1481 #endif
1482
1483 #ifdef HAVE_PLURAL
1484 if (strcmp(sys_cmd, "env")==0)
1485 {
1487 {
1488 ring r = (ring)
h->Data();
1492 }
1493 else
1494 {
1495 WerrorS(
"`system(\"env\",<ring>)` expected");
1497 }
1498 }
1499 else
1500 #endif
1501
1502 #ifdef HAVE_PLURAL
1503 if (strcmp(sys_cmd, "opp")==0)
1504 {
1506 {
1507 ring r=(ring)
h->Data();
1511 }
1512 else
1513 {
1514 WerrorS(
"`system(\"opp\",<ring>)` expected");
1516 }
1517 }
1518 else
1519 #endif
1520
1521 #ifdef HAVE_PLURAL
1522 if (strcmp(sys_cmd, "oppose")==0)
1523 {
1525 && (
h->next!=
NULL))
1526 {
1527 ring Rop = (ring)
h->Data();
1531 {
1536 }
1537 }
1538 else
1539 {
1540 WerrorS(
"`system(\"oppose\",<ring>,<poly>)` expected");
1542 }
1543 }
1544 else
1545 #endif
1546
1547
1548 #ifdef HAVE_WALK
1549 #ifdef OWNW
1550 if (strcmp(sys_cmd, "walkNextWeight") == 0)
1551 {
1556 {
1557 Werror(
"system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1560 }
1561 res->data = (
void*) walkNextWeight(((
intvec*)
h->Data()),
1563 (ideal)
h->next->next->Data());
1564 if (
res->data ==
NULL ||
res->data == (
void*) 1L)
1565 {
1567 }
1568 else
1569 {
1571 }
1573 }
1574 else
1575 #endif
1576 #endif
1577
1578 #ifdef HAVE_WALK
1579 #ifdef OWNW
1580 if (strcmp(sys_cmd, "walkInitials") == 0)
1581 {
1583 {
1584 WerrorS(
"system(\"walkInitials\", ideal) expected");
1586 }
1587 res->data = (
void*) walkInitials((ideal)
h->Data());
1590 }
1591 else
1592 #endif
1593 #endif
1594
1595 #ifdef HAVE_WALK
1596 #ifdef WAIV
1597 if (strcmp(sys_cmd, "walkAddIntVec") == 0)
1598 {
1603 res->data = (
intvec*) walkAddIntVec(arg1, arg2);
1606 }
1607 else
1608 #endif
1609 #endif
1610
1611 #ifdef HAVE_WALK
1612 #ifdef MwaklNextWeight
1613 if (strcmp(sys_cmd, "MwalkNextWeight") == 0)
1614 {
1619 {
1620 Werror(
"system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1623 }
1626 ideal arg3 = (ideal)
h->next->next->Data();
1631 }
1632 else
1633 #endif
1634 #endif
1635
1636 #ifdef HAVE_WALK
1637 if(strcmp(sys_cmd, "Mivdp") == 0)
1638 {
1640 {
1641 WerrorS(
"system(\"Mivdp\", int) expected");
1643 }
1644 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1645 {
1646 Werror(
"system(\"Mivdp\" ...) intvecs not of length %d\n",
1649 }
1650 int arg1 = (int) ((
long)(
h->Data()));
1655 }
1656 else
1657 #endif
1658
1659 #ifdef HAVE_WALK
1660 if(strcmp(sys_cmd, "Mivlp") == 0)
1661 {
1663 {
1664 WerrorS(
"system(\"Mivlp\", int) expected");
1666 }
1667 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1668 {
1669 Werror(
"system(\"Mivlp\" ...) intvecs not of length %d\n",
1672 }
1673 int arg1 = (int) ((
long)(
h->Data()));
1678 }
1679 else
1680 #endif
1681
1682 #ifdef HAVE_WALK
1683 #ifdef MpDiv
1684 if(strcmp(sys_cmd, "MpDiv") == 0)
1685 {
1688 poly arg1 = (poly)
h->Data();
1689 poly arg2 = (poly)
h->next->Data();
1690 poly
result = MpDiv(arg1, arg2);
1694 }
1695 else
1696 #endif
1697 #endif
1698
1699 #ifdef HAVE_WALK
1700 #ifdef MpMult
1701 if(strcmp(sys_cmd, "MpMult") == 0)
1702 {
1705 poly arg1 = (poly)
h->Data();
1706 poly arg2 = (poly)
h->next->Data();
1707 poly
result = MpMult(arg1, arg2);
1711 }
1712 else
1713 #endif
1714 #endif
1715
1716 #ifdef HAVE_WALK
1717 if (strcmp(sys_cmd, "MivSame") == 0)
1718 {
1721
1722
1723
1724
1725
1726
1727
1728
1729
1732
1733
1734
1735
1736
1738 res->data = (
void*)(
long)
MivSame(arg1, arg2);
1740 }
1741 else
1742 #endif
1743
1744 #ifdef HAVE_WALK
1745 if (strcmp(sys_cmd, "M3ivSame") == 0)
1746 {
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1762
1763
1764
1765
1766
1768 res->data = (
void*)(
long)
M3ivSame(arg1, arg2, arg3);
1770 }
1771 else
1772 #endif
1773
1774 #ifdef HAVE_WALK
1775 if(strcmp(sys_cmd, "MwalkInitialForm") == 0)
1776 {
1780 {
1781 Werror(
"system \"MwalkInitialForm\"...) intvec not of length %d\n",
1784 }
1785 ideal
id = (ideal)
h->Data();
1791 }
1792 else
1793 #endif
1794
1795 #ifdef HAVE_WALK
1796
1797 if(strcmp(sys_cmd, "MivMatrixOrder") == 0)
1798 {
1800 {
1801 WerrorS(
"system(\"MivMatrixOrder\",intvec) expected");
1803 }
1809 }
1810 else
1811 #endif
1812
1813 #ifdef HAVE_WALK
1814 if(strcmp(sys_cmd, "MivMatrixOrderdp") == 0)
1815 {
1817 {
1818 WerrorS(
"system(\"MivMatrixOrderdp\",intvec) expected");
1820 }
1821 int arg1 = (int) ((
long)(
h->Data()));
1826 }
1827 else
1828 #endif
1829
1830 #ifdef HAVE_WALK
1831 if(strcmp(sys_cmd, "MPertVectors") == 0)
1832 {
1835 ideal arg1 = (ideal)
h->Data();
1837 int arg3 = (int) ((
long)(
h->next->next->Data()));
1842 }
1843 else
1844 #endif
1845
1846 #ifdef HAVE_WALK
1847 if(strcmp(sys_cmd, "MPertVectorslp") == 0)
1848 {
1851 ideal arg1 = (ideal)
h->Data();
1853 int arg3 = (int) ((
long)(
h->next->next->Data()));
1858 }
1859 else
1860 #endif
1861
1862 #ifdef HAVE_WALK
1863 if(strcmp(sys_cmd, "Mfpertvector") == 0)
1864 {
1867 ideal arg1 = (ideal)
h->Data();
1873 }
1874 else
1875 #endif
1876
1877 #ifdef HAVE_WALK
1878 if(strcmp(sys_cmd, "MivUnit") == 0)
1879 {
1882 int arg1 = (int) ((
long)(
h->Data()));
1887 }
1888 else
1889 #endif
1890
1891 #ifdef HAVE_WALK
1892 if(strcmp(sys_cmd, "MivWeightOrderlp") == 0)
1893 {
1901 }
1902 else
1903 #endif
1904
1905 #ifdef HAVE_WALK
1906 if(strcmp(sys_cmd, "MivWeightOrderdp") == 0)
1907 {
1909 {
1910 WerrorS(
"system(\"MivWeightOrderdp\",intvec) expected");
1912 }
1914
1919 }
1920 else
1921 #endif
1922
1923 #ifdef HAVE_WALK
1924 if(strcmp(sys_cmd, "MivMatrixOrderlp") == 0)
1925 {
1927 {
1928 WerrorS(
"system(\"MivMatrixOrderlp\",int) expected");
1930 }
1931 int arg1 = (int) ((
long)(
h->Data()));
1936 }
1937 else
1938 #endif
1939
1940 #ifdef HAVE_WALK
1941 if (strcmp(sys_cmd, "MkInterRedNextWeight") == 0)
1942 {
1947 {
1948 Werror(
"system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1951 }
1954 ideal arg3 = (ideal)
h->next->next->Data();
1959 }
1960 else
1961 #endif
1962
1963 #ifdef HAVE_WALK
1964 #ifdef MPertNextWeight
1965 if (strcmp(sys_cmd, "MPertNextWeight") == 0)
1966 {
1970 {
1971 Werror(
"system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1974 }
1976 ideal arg2 = (ideal)
h->next->Data();
1977 int arg3 = (int)
h->next->next->Data();
1982 }
1983 else
1984 #endif
1985 #endif
1986
1987 #ifdef HAVE_WALK
1988 #ifdef Mivperttarget
1989 if (strcmp(sys_cmd, "Mivperttarget") == 0)
1990 {
1993 ideal arg1 = (ideal)
h->Data();
1994 int arg2 = (int)
h->next->Data();
1999 }
2000 else
2001 #endif
2002 #endif
2003
2004 #ifdef HAVE_WALK
2005 if (strcmp(sys_cmd, "Mwalk") == 0)
2006 {
2011 {
2012 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d\n",
2015 }
2016 ideal arg1 = (ideal)
h->CopyD();
2019 ring arg4 = (ring)
h->next->next->next->Data();
2020 int arg5 = (int) (
long)
h->next->next->next->next->Data();
2021 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2022 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2026 }
2027 else
2028 #endif
2029
2030 #ifdef HAVE_WALK
2031 #ifdef MPWALK_ORIG
2032 if (strcmp(sys_cmd, "Mwalk") == 0)
2033 {
2040 {
2041 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2044 }
2045 ideal arg1 = (ideal)
h->Data();
2048 ring arg4 = (ring)
h->next->next->next->Data();
2049 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3,arg4);
2053 }
2054 else
2055 #else
2056 if (strcmp(sys_cmd, "Mpwalk") == 0)
2057 {
2062 {
2063 Werror(
"system(\"Mpwalk\" ...) intvecs not of length %d\n",
currRing->N);
2065 }
2066 ideal arg1 = (ideal)
h->Data();
2067 int arg2 = (int) (
long)
h->next->Data();
2068 int arg3 = (int) (
long)
h->next->next->Data();
2071 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2072 int arg7 = (int) (
long)
h->next->next->next->next->next->next->Data();
2073 int arg8 = (int) (
long)
h->next->next->next->next->next->next->next->Data();
2074 ideal
result = (ideal)
Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2078 }
2079 else
2080 #endif
2081 #endif
2082
2083 #ifdef HAVE_WALK
2084 if (strcmp(sys_cmd, "Mrwalk") == 0)
2085 {
2092 {
2093 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2096 }
2097 ideal arg1 = (ideal)
h->Data();
2100 int arg4 = (int)(
long)
h->next->next->next->Data();
2101 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2102 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2103 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2104 ideal
result = (ideal)
Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2108 }
2109 else
2110 #endif
2111
2112 #ifdef HAVE_WALK
2113 if (strcmp(sys_cmd, "MAltwalk1") == 0)
2114 {
2119 {
2120 Werror(
"system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2123 }
2124 ideal arg1 = (ideal)
h->Data();
2125 int arg2 = (int) ((
long)(
h->next->Data()));
2126 int arg3 = (int) ((
long)(
h->next->next->Data()));
2133 }
2134 else
2135 #endif
2136
2137 #ifdef HAVE_WALK
2138 #ifdef MFWALK_ALT
2139 if (strcmp(sys_cmd, "Mfwalk_alt") == 0)
2140 {
2145 {
2146 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2149 }
2150 ideal arg1 = (ideal)
h->Data();
2153 int arg4 = (int)
h->next->next->next->Data();
2154 ideal
result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2158 }
2159 else
2160 #endif
2161 #endif
2162
2163 #ifdef HAVE_WALK
2164 if (strcmp(sys_cmd, "Mfwalk") == 0)
2165 {
2170 {
2171 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2174 }
2175 ideal arg1 = (ideal)
h->Data();
2178 int arg4 = (int)(
long)
h->next->next->next->Data();
2179 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2180 ideal
result = (ideal)
Mfwalk(arg1, arg2, arg3, arg4, arg5);
2184 }
2185 else
2186 #endif
2187
2188 #ifdef HAVE_WALK
2189 if (strcmp(sys_cmd, "Mfrwalk") == 0)
2190 {
2193
2194
2195
2196
2197
2198
2199
2200
2205 {
2206 Werror(
"system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2209 }
2210
2211 ideal arg1 = (ideal)
h->Data();
2214 int arg4 = (int)(
long)
h->next->next->next->Data();
2215 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2216 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2217 ideal
result = (ideal)
Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2221 }
2222 else
2223
2224 if (strcmp(sys_cmd, "Mprwalk") == 0)
2225 {
2232 {
2233 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2236 }
2237 ideal arg1 = (ideal)
h->Data();
2240 int arg4 = (int)(
long)
h->next->next->next->Data();
2241 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2242 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2243 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2244 int arg8 = (int)(
long)
h->next->next->next->next->next->next->next->Data();
2245 int arg9 = (int)(
long)
h->next->next->next->next->next->next->next->next->Data();
2246 ideal
result = (ideal)
Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2250 }
2251 else
2252 #endif
2253
2254 #ifdef HAVE_WALK
2255 #ifdef TRAN_Orig
2256 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2257 {
2262 {
2263 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2266 }
2267 ideal arg1 = (ideal)
h->Data();
2274 }
2275 else
2276 #endif
2277 #endif
2278
2279 #ifdef HAVE_WALK
2280 if (strcmp(sys_cmd, "MAltwalk2") == 0)
2281 {
2286 {
2287 Werror(
"system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2290 }
2291 ideal arg1 = (ideal)
h->Data();
2298 }
2299 else
2300 #endif
2301
2302 #ifdef HAVE_WALK
2303 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2304 {
2309 {
2310 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2313 }
2314 ideal arg1 = (ideal)
h->Data();
2317 int arg4 = (int) ((
long)(
h->next->next->next->Data()));
2322 }
2323 else
2324 #endif
2325
2326 #if 0
2327 #ifdef HAVE_WALK
2328 if (strcmp(sys_cmd, "TranMrImprovwalk") == 0)
2329 {
2333 h->next->next->next ==
NULL ||
h->next->next->next->Typ() !=
INT_CMD ||
2334 h->next->next->next ==
NULL ||
h->next->next->next->next->Typ() !=
INT_CMD ||
2335 h->next->next->next ==
NULL ||
h->next->next->next->next->next->Typ() !=
INT_CMD)
2336 {
2337 WerrorS(
"system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2339 }
2342 {
2343 Werror(
"system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n",
currRing->N);
2345 }
2346 ideal arg1 = (ideal)
h->Data();
2349 int arg4 = (int)(
long)
h->next->next->next->Data();
2350 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2351 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2352 ideal
result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2356 }
2357 else
2358 #endif
2359 #endif
2360
2361 {
2362 #ifndef MAKE_DISTRIBUTION
2364 #else
2366 #endif
2367 }
2368 }
2370}
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 BOOLEAN rField_is_long_C(const ring r)
static int rBlocks(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)