232{
234 {
235 const char *sys_cmd=(
char *)(args->
Data());
237
238
239
240 if (strcmp(sys_cmd, "nblocks") == 0)
241 {
242 ring r;
244 {
246 {
248 }
249 else
250 {
253 }
254 }
255 else
256 {
258 {
261 }
262 r = (ring)
h->Data();
263 }
267 }
268
269 if(strcmp(sys_cmd,"version")==0)
270 {
274 }
275 else
276
277 if(strcmp(sys_cmd,"alarm")==0)
278 {
280 {
281
282
283
284 struct itimerval t,o;
285 memset(&t,0,sizeof(t));
286 t.it_value.tv_sec =(unsigned)((
unsigned long)
h->Data());
287 setitimer(ITIMER_VIRTUAL,&t,&o);
289 }
290 else
292 }
293 else
294
295 if(strcmp(sys_cmd,"content")==0)
296 {
298 {
300 poly
p=(poly)
h->CopyD();
302 {
305 }
309 }
311 }
312 else
313
314 if(strcmp(sys_cmd,"cpu")==0)
315 {
316 long cpu=1;
317 #ifdef _SC_NPROCESSORS_ONLN
318 cpu=sysconf(_SC_NPROCESSORS_ONLN);
319 #elif defined(_SC_NPROCESSORS_CONF)
320 cpu=sysconf(_SC_NPROCESSORS_CONF);
321 #endif
322 res->data=(
void *)cpu;
325 }
326 else
327
328 if(strcmp(sys_cmd,"executable")==0)
329 {
331 {
338 }
340 }
341 else
342
343 if(strcmp(sys_cmd,"flatten")==0)
344 {
346 {
350 }
351 else
353 }
354 else
355
356 if(strcmp(sys_cmd,"unflatten")==0)
357 {
360 {
364 }
366 }
367 else
368
369 if(strcmp(sys_cmd,"neworder")==0)
370 {
372 {
376 }
377 else
379 }
380 else
381
382
383 if(strcmp(sys_cmd,"nc_hilb") == 0)
384 {
389 int trunDegHs=0;
391 i = (ideal)
h->Data();
392 else
393 {
394 WerrorS(
"nc_Hilb:ideal expected");
396 }
399 lV = (int)(
long)
h->Data();
400 else
401 {
402 WerrorS(
"nc_Hilb:int expected");
404 }
407 {
408 if((
int)(
long)
h->Data() == 1)
410 else if((
int)(
long)
h->Data() == 2)
415 trunDegHs = (int)(
long)
h->Data();
417 }
419 {
420 WerrorS(
"nc_Hilb:int 1,2, total degree for the truncation, and a string for printing the details are expected");
422 }
423
426 }
427 else
428
429 if(strcmp(sys_cmd,"verifyGB")==0)
430 {
432 {
433 WerrorS(
"system(\"verifyGB\",<ideal>,..) expects a commutative ring");
435 }
437 {
438 WerrorS(
"expected system(\"verifyGB\",<ideal>,..)");
440 }
441 ideal F=(ideal)
h->Data();
443 {
444 #ifdef HAVE_VSPACE
446 if (cpus>1)
448 else
449 #endif
451 }
455 }
456 else
457
458 if(strcmp(sys_cmd,"rcolon") == 0)
459 {
462 {
463 ideal
i = (ideal)
h->Data();
465 poly
w=(poly)
h->Data();
467 int lV = (int)(
long)
h->Data();
471 }
472 else
474 }
475 else
476
477
478 if(strcmp(sys_cmd,"sh")==0)
479 {
481 {
482 WerrorS(
"shell execution is disallowed in restricted mode");
484 }
486 if (
h==
NULL)
res->data = (
void *)(
long) system(
"sh");
488 res->data = (
void*)(
long) system((
char*)(
h->Data()));
489 else
492 }
493 else
494
495 if(strcmp(sys_cmd,"reduce_bound")==0)
496 {
504 {
505 p = (poly)
h->CopyD();
506 }
508 {
509 pid = (ideal)
h->CopyD();
510 }
512
514 ideal q = (ideal)
h->next->CopyD();
515 int bound = (int)(
long)
h->next->next->Data();
518 else
521 }
522 else
523
524 if(strcmp(sys_cmd,"uname")==0)
525 {
529 }
530 else
531
532 if(strcmp(sys_cmd,"with")==0)
533 {
535 {
539 }
541 {
542 #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
543 char *
s=(
char *)
h->Data();
545 #ifdef HAVE_DBM
547 #endif
548 #ifdef HAVE_DLD
550 #endif
551
552
553 #ifdef HAVE_READLINE
555 #endif
556 #ifdef TEST_MAC_ORDER
558 #endif
559
561 #ifdef HAVE_DYNAMIC_LOADING
563 #endif
564 #ifdef HAVE_EIGENVAL
566 #endif
567 #ifdef HAVE_GMS
569 #endif
570 #ifdef OM_NDEBUG
572 #endif
573 #ifdef SING_NDEBUG
575 #endif
576 {};
578 #undef TEST_FOR
579 }
581 }
582 else
583
584 if (strcmp(sys_cmd,"browsers")==0)
585 {
591 }
592 else
593
594 if (strcmp(sys_cmd,"pid")==0)
595 {
597 res->data=(
void *)(
long) getpid();
599 }
600 else
601
602 if (strcmp(sys_cmd,"getenv")==0)
603 {
605 {
607 const char *r=
getenv((
char *)
h->Data());
611 }
612 else
613 {
616 }
617 }
618 else
619
620 if (strcmp(sys_cmd,"setenv")==0)
621 {
622 #ifdef HAVE_SETENV
625 {
627 setenv((
char *)
h->Data(), (
char *)
h->next->Data(), 1);
631 }
632 else
633 {
635 }
636 #else
637 WerrorS(
"setenv not supported on this platform");
639 #endif
640 }
641 else
642
643 if (strcmp(sys_cmd, "Singular") == 0)
644 {
650 }
651 else
652 if (strcmp(sys_cmd, "SingularLib") == 0)
653 {
659 }
660 else
661 if (strcmp(sys_cmd, "SingularBin") == 0)
662 {
665 if (r ==
NULL) r=
"/usr/local";
667
668 #define SINGULAR_PROCS_DIR "/libexec/singular/MOD"
671 if ((strstr(r,
".libs/..")==
NULL)
672 &&(strstr(r,
"Singular/..")==
NULL))
673 {
676 if (access(
s,X_OK)==0)
677 {
679 }
680 else
681 {
682
683 strcpy(
s,LIBEXEC_DIR);
684 if (access(
s,X_OK)==0)
685 {
687 }
688 else
689 {
691 }
692 }
693 }
694 else
695 {
698 {
700 }
701 else
702 {
705 }
706 }
707 res->data = (
void*)
s;
709 }
710 else
711
712 if (strstr(sys_cmd, "--") == sys_cmd)
713 {
714 if (strcmp(sys_cmd, "--") == 0)
715 {
718 }
721 {
722 Werror(
"Unknown option %s", sys_cmd);
723 WerrorS(
"Use 'system(\"--\");' for listing of available options");
725 }
726
727
729 {
732 }
734 {
736 {
738 const char *r=(
const char*)
feOptSpec[opt].value;
741 }
742 else
743 {
746 }
748 }
751 {
752 WerrorS(
"Need string or int argument to set option value");
754 }
755 const char* errormsg;
757 {
759 {
760 Werror(
"Need string argument to set value of option %s", sys_cmd);
762 }
764 if (errormsg !=
NULL)
765 Werror(
"Option '--%s=%d' %s", sys_cmd, (
int) ((
long)
h->Data()), errormsg);
766 }
767 else
768 {
770 if (errormsg !=
NULL)
771 Werror(
"Option '--%s=%s' %s", sys_cmd, (
char*)
h->Data(), errormsg);
772 }
775 }
776 else
777
778 if (strcmp(sys_cmd,"HC")==0)
779 {
783 }
784 else
785
786 if(strcmp(sys_cmd,"random")==0)
787 {
790 {
792 {
797 }
798 else
799 {
801 }
802 }
806 }
807 else
808
809 if (strcmp(sys_cmd,"denom_list")==0)
810 {
815 }
816 else
817
818 if(strcmp(sys_cmd,"complexNearZero")==0)
819 {
822 {
824 {
825 WerrorS(
"unsupported ground field!");
827 }
828 else
829 {
832 (int)((
long)(
h->next->Data())));
834 }
835 }
836 else
837 {
839 }
840 }
841 else
842
843 if(strcmp(sys_cmd,"getPrecDigits")==0)
844 {
847 {
848 WerrorS(
"unsupported ground field!");
850 }
853
854
856 }
857 else
858
859 if(strcmp(sys_cmd, "lduDecomp")==0)
860 {
863 {
866 poly
l; poly u; poly prodLU;
867 lduDecomp(aMat, pMat, lMat, dMat, uMat,
l, u, prodLU);
878 res->data = (
char *)L;
880 }
881 else
882 {
884 }
885 }
886 else
887
888 if(strcmp(sys_cmd, "lduSolve")==0)
889 {
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
910 {
912 }
914 {
917 }
922 poly
l = (poly)
h->next->next->next->next->Data();
923 poly u = (poly)
h->next->next->next->next->next->Data();
924 poly lTimesU = (poly)
h->next->next->next->next->next->next->Data();
925 matrix bVec = (
matrix)
h->next->next->next->next->next->next->next->Data();
928 {
929 Werror(
"first matrix (%d x %d) is not quadratic",
932 }
934 {
935 Werror(
"second matrix (%d x %d) is not quadratic",
938 }
940 {
941 Werror(
"third matrix (%d x %d) is not quadratic",
944 }
946 {
947 Werror(
"third matrix (%d x %d) and fourth matrix (%d x %d) %s",
949 "do not t");
951 }
953 {
954 Werror(
"fourth matrix (%d x %d) and vector (%d x 1) do not fit",
957 }
959 bVec, xVec, homogSolSpace);
960
961
962
964 if (solvable)
965 {
970 }
971 else
972 {
975 }
979 }
980 else
981
982 if (strcmp(sys_cmd, "shared") == 0)
983 {
984 #ifndef SI_COUNTEDREF_AUTOLOAD
987 #endif
990 }
991 else if (strcmp(sys_cmd, "reference") == 0)
992 {
993 #ifndef SI_COUNTEDREF_AUTOLOAD
996 #endif
999 }
1000 else
1001
1002#ifdef HAVE_SIMPLEIPC
1003 if (strcmp(sys_cmd,"semaphore")==0)
1004 {
1006 {
1008 if ((
h->next->next!=
NULL)&& (
h->next->next->Typ()==
INT_CMD))
1009 v=(int)(
long)
h->next->next->Data();
1013 }
1014 else
1015 {
1016 WerrorS(
"Usage: system(\"semaphore\",<cmd>,int)");
1018 }
1019 }
1020 else
1021#endif
1022
1023 if (strcmp(sys_cmd,"reserve")==0)
1024 {
1028 {
1031 res->data=(
void*)(
long)
p;
1033 }
1035 }
1036 else
1037
1038 if (strcmp(sys_cmd,"reservedLink")==0)
1039 {
1044 }
1045 else
1046
1047 if (strcmp(sys_cmd,"install")==0)
1048 {
1051 {
1053 (
int)(
long)
h->next->next->next->Data(),
1055 }
1057 }
1058 else
1059
1060 if (strcmp(sys_cmd,"newstruct")==0)
1061 {
1064 {
1065 int id=0;
1066 char *n=(
char*)
h->Data();
1068 if (id>0)
1069 {
1072 {
1073 newstruct_desc desc=(newstruct_desc)bb->data;
1076 }
1077 else Werror(
"'%s' is not a newstruct",n);
1078 }
1079 else Werror(
"'%s' is not a blackbox object",n);
1080 }
1082 }
1083 else
1084
1085 if (strcmp(sys_cmd,"blackbox")==0)
1086 {
1089 }
1090 else
1091
1092 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1093 if (strcmp(sys_cmd, "absFact") == 0)
1094 {
1099 {
1103 int n= 0;
1110 l->m[0].data=(
void *)
f;
1112 l->m[1].data=(
void *)
v;
1114 l->m[2].data=(
void*) mipos;
1116 l->m[3].data=(
void*) (
long) n;
1117 res->data=(
void *)
l;
1119 }
1121 }
1122 else
1123 #endif
1124
1125 #ifdef HAVE_NTL
1126 if (strcmp(sys_cmd, "LLL") == 0)
1127 {
1129 {
1132 {
1135 }
1137 {
1140 }
1142 }
1144 }
1145 else
1146 #endif
1147
1148 #ifdef HAVE_FLINT
1149 #if __FLINT_RELEASE >= 20500
1150 if (strcmp(sys_cmd, "LLL_Flint") == 0)
1151 {
1153 {
1155 {
1158 {
1161 }
1163 {
1166 }
1168 }
1170 {
1171 WerrorS(
"matrix,int or bigint,int expected");
1173 }
1175 {
1176 if(((
int)((
long)(
h->next->Data())) != 0) && (
int)((
long)(
h->next->Data()) != 1))
1177 {
1178 WerrorS(
"int is different from 0, 1");
1180 }
1182 if((
long)(
h->next->Data()) == 0)
1183 {
1185 {
1188 }
1190 {
1193 }
1195 }
1196
1197 if((
long)(
h->next->Data()) == 1)
1198 {
1200 {
1203 for(
int i = 1;
i<=
m->rows();
i++)
1204 {
1207 }
1216 }
1218 {
1221 for(
int i = 1;
i<=
m->rows();
i++)
1231 }
1233 }
1234 }
1235
1236 }
1238 }
1239 else
1240 #endif
1241 #endif
1242
1243 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1244 if(strcmp(sys_cmd,"rref")==0)
1245 {
1249 {
1251 #if defined(HAVE_FLINT)
1253 #elif defined(HAVE_NTL)
1255 #endif
1258 }
1260 {
1261 ideal
M=(ideal)
h->Data();
1262 #if defined(HAVE_FLINT)
1264 #elif defined(HAVE_NTL)
1266 #endif
1269 }
1270 else
1271 {
1272 WerrorS(
"expected system(\"rref\",<matrix>/<smatrix>)");
1274 }
1275 }
1276 else
1277 #endif
1278
1279 #ifdef HAVE_PCV
1280 if(strcmp(sys_cmd,"pcvLAddL")==0)
1281 {
1283 }
1284 else
1285 if(strcmp(sys_cmd,"pcvPMulL")==0)
1286 {
1288 }
1289 else
1290 if(strcmp(sys_cmd,"pcvMinDeg")==0)
1291 {
1293 }
1294 else
1295 if(strcmp(sys_cmd,"pcvP2CV")==0)
1296 {
1298 }
1299 else
1300 if(strcmp(sys_cmd,"pcvCV2P")==0)
1301 {
1303 }
1304 else
1305 if(strcmp(sys_cmd,"pcvDim")==0)
1306 {
1308 }
1309 else
1310 if(strcmp(sys_cmd,"pcvBasis")==0)
1311 {
1313 }
1314 else
1315 #endif
1316
1317 #ifdef HAVE_EIGENVAL
1318 if(strcmp(sys_cmd,"hessenberg")==0)
1319 {
1321 }
1322 else
1323 #endif
1324
1325 #ifdef HAVE_EIGENVAL
1326 if(strcmp(sys_cmd,"eigenvals")==0)
1327 {
1329 }
1330 else
1331 #endif
1332
1333 #ifdef HAVE_EIGENVAL
1334 if(strcmp(sys_cmd,"rowelim")==0)
1335 {
1337 }
1338 else
1339 #endif
1340
1341 #ifdef HAVE_EIGENVAL
1342 if(strcmp(sys_cmd,"rowcolswap")==0)
1343 {
1345 }
1346 else
1347 #endif
1348
1349 #ifdef HAVE_GMS
1350 if(strcmp(sys_cmd,"gmsnf")==0)
1351 {
1353 }
1354 else
1355 #endif
1356
1357 if(strcmp(sys_cmd,"contributors") == 0)
1358 {
1361 "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");
1363 }
1364 else
1365
1366 #ifdef HAVE_SPECTRUM
1367 if(strcmp(sys_cmd,"spectrum") == 0)
1368 {
1370 {
1373 }
1377 {
1380 }
1381 if(((
long)
h->next->Data())==1L)
1384 }
1385 else
1386
1387 if(strcmp(sys_cmd,"semic") == 0)
1388 {
1392 {
1393 if (
h->next->next==
NULL)
1395 else if (
h->next->next->Typ()==
INT_CMD)
1397 }
1399 }
1400 else
1401
1402 if(strcmp(sys_cmd,"spadd") == 0)
1403 {
1406 {
1408 }
1410 }
1411 else
1412
1413 if(strcmp(sys_cmd,"spmul") == 0)
1414 {
1417 {
1419 }
1421 }
1422 else
1423 #endif
1424
1425 #define HAVE_SHEAFCOH_TRICKS 1
1426
1427 #ifdef HAVE_SHEAFCOH_TRICKS
1428 if(strcmp(sys_cmd,"tensorModuleMult")==0)
1429 {
1431
1433 {
1434 int m = (int)( (
long)
h->Data() );
1435 ideal
M = (ideal)
h->next->Data();
1439 }
1441 }
1442 else
1443 #endif
1444
1445 #ifdef HAVE_PLURAL
1446 if (strcmp(sys_cmd, "twostd") == 0)
1447 {
1448 ideal I;
1450 {
1451 I=(ideal)
h->CopyD();
1457 }
1460 }
1461 else
1462 #endif
1463
1464 #ifdef HAVE_PLURAL
1465 if (strcmp(sys_cmd, "bracket") == 0)
1466 {
1469 {
1470 poly
p=(poly)
h->CopyD();
1472 poly q=(poly)
h->Data();
1476 }
1478 }
1479 else
1480 #endif
1481
1482 #ifdef HAVE_PLURAL
1483 if (strcmp(sys_cmd, "env")==0)
1484 {
1486 {
1487 ring r = (ring)
h->Data();
1491 }
1492 else
1493 {
1494 WerrorS(
"`system(\"env\",<ring>)` expected");
1496 }
1497 }
1498 else
1499 #endif
1500
1501 #ifdef HAVE_PLURAL
1502 if (strcmp(sys_cmd, "opp")==0)
1503 {
1505 {
1506 ring r=(ring)
h->Data();
1510 }
1511 else
1512 {
1513 WerrorS(
"`system(\"opp\",<ring>)` expected");
1515 }
1516 }
1517 else
1518 #endif
1519
1520 #ifdef HAVE_PLURAL
1521 if (strcmp(sys_cmd, "oppose")==0)
1522 {
1524 && (
h->next!=
NULL))
1525 {
1526 ring Rop = (ring)
h->Data();
1530 {
1535 }
1536 }
1537 else
1538 {
1539 WerrorS(
"`system(\"oppose\",<ring>,<poly>)` expected");
1541 }
1542 }
1543 else
1544 #endif
1545
1546
1547 #ifdef HAVE_WALK
1548 #ifdef OWNW
1549 if (strcmp(sys_cmd, "walkNextWeight") == 0)
1550 {
1555 {
1556 Werror(
"system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1559 }
1560 res->data = (
void*) walkNextWeight(((
intvec*)
h->Data()),
1562 (ideal)
h->next->next->Data());
1563 if (
res->data ==
NULL ||
res->data == (
void*) 1L)
1564 {
1566 }
1567 else
1568 {
1570 }
1572 }
1573 else
1574 #endif
1575 #endif
1576
1577 #ifdef HAVE_WALK
1578 #ifdef OWNW
1579 if (strcmp(sys_cmd, "walkInitials") == 0)
1580 {
1582 {
1583 WerrorS(
"system(\"walkInitials\", ideal) expected");
1585 }
1586 res->data = (
void*) walkInitials((ideal)
h->Data());
1589 }
1590 else
1591 #endif
1592 #endif
1593
1594 #ifdef HAVE_WALK
1595 #ifdef WAIV
1596 if (strcmp(sys_cmd, "walkAddIntVec") == 0)
1597 {
1602 res->data = (
intvec*) walkAddIntVec(arg1, arg2);
1605 }
1606 else
1607 #endif
1608 #endif
1609
1610 #ifdef HAVE_WALK
1611 #ifdef MwaklNextWeight
1612 if (strcmp(sys_cmd, "MwalkNextWeight") == 0)
1613 {
1618 {
1619 Werror(
"system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1622 }
1625 ideal arg3 = (ideal)
h->next->next->Data();
1630 }
1631 else
1632 #endif
1633 #endif
1634
1635 #ifdef HAVE_WALK
1636 if(strcmp(sys_cmd, "Mivdp") == 0)
1637 {
1639 {
1640 WerrorS(
"system(\"Mivdp\", int) expected");
1642 }
1643 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1644 {
1645 Werror(
"system(\"Mivdp\" ...) intvecs not of length %d\n",
1648 }
1649 int arg1 = (int) ((
long)(
h->Data()));
1654 }
1655 else
1656 #endif
1657
1658 #ifdef HAVE_WALK
1659 if(strcmp(sys_cmd, "Mivlp") == 0)
1660 {
1662 {
1663 WerrorS(
"system(\"Mivlp\", int) expected");
1665 }
1666 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1667 {
1668 Werror(
"system(\"Mivlp\" ...) intvecs not of length %d\n",
1671 }
1672 int arg1 = (int) ((
long)(
h->Data()));
1677 }
1678 else
1679 #endif
1680
1681 #ifdef HAVE_WALK
1682 #ifdef MpDiv
1683 if(strcmp(sys_cmd, "MpDiv") == 0)
1684 {
1687 poly arg1 = (poly)
h->Data();
1688 poly arg2 = (poly)
h->next->Data();
1689 poly
result = MpDiv(arg1, arg2);
1693 }
1694 else
1695 #endif
1696 #endif
1697
1698 #ifdef HAVE_WALK
1699 #ifdef MpMult
1700 if(strcmp(sys_cmd, "MpMult") == 0)
1701 {
1704 poly arg1 = (poly)
h->Data();
1705 poly arg2 = (poly)
h->next->Data();
1706 poly
result = MpMult(arg1, arg2);
1710 }
1711 else
1712 #endif
1713 #endif
1714
1715 #ifdef HAVE_WALK
1716 if (strcmp(sys_cmd, "MivSame") == 0)
1717 {
1720
1721
1722
1723
1724
1725
1726
1727
1728
1731
1732
1733
1734
1735
1737 res->data = (
void*)(
long)
MivSame(arg1, arg2);
1739 }
1740 else
1741 #endif
1742
1743 #ifdef HAVE_WALK
1744 if (strcmp(sys_cmd, "M3ivSame") == 0)
1745 {
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1761
1762
1763
1764
1765
1767 res->data = (
void*)(
long)
M3ivSame(arg1, arg2, arg3);
1769 }
1770 else
1771 #endif
1772
1773 #ifdef HAVE_WALK
1774 if(strcmp(sys_cmd, "MwalkInitialForm") == 0)
1775 {
1779 {
1780 Werror(
"system \"MwalkInitialForm\"...) intvec not of length %d\n",
1783 }
1784 ideal
id = (ideal)
h->Data();
1790 }
1791 else
1792 #endif
1793
1794 #ifdef HAVE_WALK
1795
1796 if(strcmp(sys_cmd, "MivMatrixOrder") == 0)
1797 {
1799 {
1800 WerrorS(
"system(\"MivMatrixOrder\",intvec) expected");
1802 }
1808 }
1809 else
1810 #endif
1811
1812 #ifdef HAVE_WALK
1813 if(strcmp(sys_cmd, "MivMatrixOrderdp") == 0)
1814 {
1816 {
1817 WerrorS(
"system(\"MivMatrixOrderdp\",intvec) expected");
1819 }
1820 int arg1 = (int) ((
long)(
h->Data()));
1825 }
1826 else
1827 #endif
1828
1829 #ifdef HAVE_WALK
1830 if(strcmp(sys_cmd, "MPertVectors") == 0)
1831 {
1834 ideal arg1 = (ideal)
h->Data();
1836 int arg3 = (int) ((
long)(
h->next->next->Data()));
1841 }
1842 else
1843 #endif
1844
1845 #ifdef HAVE_WALK
1846 if(strcmp(sys_cmd, "MPertVectorslp") == 0)
1847 {
1850 ideal arg1 = (ideal)
h->Data();
1852 int arg3 = (int) ((
long)(
h->next->next->Data()));
1857 }
1858 else
1859 #endif
1860
1861 #ifdef HAVE_WALK
1862 if(strcmp(sys_cmd, "Mfpertvector") == 0)
1863 {
1866 ideal arg1 = (ideal)
h->Data();
1872 }
1873 else
1874 #endif
1875
1876 #ifdef HAVE_WALK
1877 if(strcmp(sys_cmd, "MivUnit") == 0)
1878 {
1881 int arg1 = (int) ((
long)(
h->Data()));
1886 }
1887 else
1888 #endif
1889
1890 #ifdef HAVE_WALK
1891 if(strcmp(sys_cmd, "MivWeightOrderlp") == 0)
1892 {
1900 }
1901 else
1902 #endif
1903
1904 #ifdef HAVE_WALK
1905 if(strcmp(sys_cmd, "MivWeightOrderdp") == 0)
1906 {
1908 {
1909 WerrorS(
"system(\"MivWeightOrderdp\",intvec) expected");
1911 }
1913
1918 }
1919 else
1920 #endif
1921
1922 #ifdef HAVE_WALK
1923 if(strcmp(sys_cmd, "MivMatrixOrderlp") == 0)
1924 {
1926 {
1927 WerrorS(
"system(\"MivMatrixOrderlp\",int) expected");
1929 }
1930 int arg1 = (int) ((
long)(
h->Data()));
1935 }
1936 else
1937 #endif
1938
1939 #ifdef HAVE_WALK
1940 if (strcmp(sys_cmd, "MkInterRedNextWeight") == 0)
1941 {
1946 {
1947 Werror(
"system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1950 }
1953 ideal arg3 = (ideal)
h->next->next->Data();
1958 }
1959 else
1960 #endif
1961
1962 #ifdef HAVE_WALK
1963 #ifdef MPertNextWeight
1964 if (strcmp(sys_cmd, "MPertNextWeight") == 0)
1965 {
1969 {
1970 Werror(
"system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1973 }
1975 ideal arg2 = (ideal)
h->next->Data();
1976 int arg3 = (int)
h->next->next->Data();
1981 }
1982 else
1983 #endif
1984 #endif
1985
1986 #ifdef HAVE_WALK
1987 #ifdef Mivperttarget
1988 if (strcmp(sys_cmd, "Mivperttarget") == 0)
1989 {
1992 ideal arg1 = (ideal)
h->Data();
1993 int arg2 = (int)
h->next->Data();
1998 }
1999 else
2000 #endif
2001 #endif
2002
2003 #ifdef HAVE_WALK
2004 if (strcmp(sys_cmd, "Mwalk") == 0)
2005 {
2010 {
2011 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d\n",
2014 }
2015 ideal arg1 = (ideal)
h->CopyD();
2018 ring arg4 = (ring)
h->next->next->next->Data();
2019 int arg5 = (int) (
long)
h->next->next->next->next->Data();
2020 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2021 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2025 }
2026 else
2027 #endif
2028
2029 #ifdef HAVE_WALK
2030 #ifdef MPWALK_ORIG
2031 if (strcmp(sys_cmd, "Mwalk") == 0)
2032 {
2039 {
2040 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2043 }
2044 ideal arg1 = (ideal)
h->Data();
2047 ring arg4 = (ring)
h->next->next->next->Data();
2048 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3,arg4);
2052 }
2053 else
2054 #else
2055 if (strcmp(sys_cmd, "Mpwalk") == 0)
2056 {
2061 {
2062 Werror(
"system(\"Mpwalk\" ...) intvecs not of length %d\n",
currRing->N);
2064 }
2065 ideal arg1 = (ideal)
h->Data();
2066 int arg2 = (int) (
long)
h->next->Data();
2067 int arg3 = (int) (
long)
h->next->next->Data();
2070 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2071 int arg7 = (int) (
long)
h->next->next->next->next->next->next->Data();
2072 int arg8 = (int) (
long)
h->next->next->next->next->next->next->next->Data();
2073 ideal
result = (ideal)
Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2077 }
2078 else
2079 #endif
2080 #endif
2081
2082 #ifdef HAVE_WALK
2083 if (strcmp(sys_cmd, "Mrwalk") == 0)
2084 {
2091 {
2092 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2095 }
2096 ideal arg1 = (ideal)
h->Data();
2099 int arg4 = (int)(
long)
h->next->next->next->Data();
2100 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2101 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2102 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2103 ideal
result = (ideal)
Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2107 }
2108 else
2109 #endif
2110
2111 #ifdef HAVE_WALK
2112 if (strcmp(sys_cmd, "MAltwalk1") == 0)
2113 {
2118 {
2119 Werror(
"system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2122 }
2123 ideal arg1 = (ideal)
h->Data();
2124 int arg2 = (int) ((
long)(
h->next->Data()));
2125 int arg3 = (int) ((
long)(
h->next->next->Data()));
2132 }
2133 else
2134 #endif
2135
2136 #ifdef HAVE_WALK
2137 #ifdef MFWALK_ALT
2138 if (strcmp(sys_cmd, "Mfwalk_alt") == 0)
2139 {
2144 {
2145 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2148 }
2149 ideal arg1 = (ideal)
h->Data();
2152 int arg4 = (int)
h->next->next->next->Data();
2153 ideal
result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2157 }
2158 else
2159 #endif
2160 #endif
2161
2162 #ifdef HAVE_WALK
2163 if (strcmp(sys_cmd, "Mfwalk") == 0)
2164 {
2169 {
2170 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2173 }
2174 ideal arg1 = (ideal)
h->Data();
2177 int arg4 = (int)(
long)
h->next->next->next->Data();
2178 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2179 ideal
result = (ideal)
Mfwalk(arg1, arg2, arg3, arg4, arg5);
2183 }
2184 else
2185 #endif
2186
2187 #ifdef HAVE_WALK
2188 if (strcmp(sys_cmd, "Mfrwalk") == 0)
2189 {
2192
2193
2194
2195
2196
2197
2198
2199
2204 {
2205 Werror(
"system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2208 }
2209
2210 ideal arg1 = (ideal)
h->Data();
2213 int arg4 = (int)(
long)
h->next->next->next->Data();
2214 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2215 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2216 ideal
result = (ideal)
Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2220 }
2221 else
2222
2223 if (strcmp(sys_cmd, "Mprwalk") == 0)
2224 {
2231 {
2232 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2235 }
2236 ideal arg1 = (ideal)
h->Data();
2239 int arg4 = (int)(
long)
h->next->next->next->Data();
2240 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2241 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2242 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2243 int arg8 = (int)(
long)
h->next->next->next->next->next->next->next->Data();
2244 int arg9 = (int)(
long)
h->next->next->next->next->next->next->next->next->Data();
2245 ideal
result = (ideal)
Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2249 }
2250 else
2251 #endif
2252
2253 #ifdef HAVE_WALK
2254 #ifdef TRAN_Orig
2255 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2256 {
2261 {
2262 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2265 }
2266 ideal arg1 = (ideal)
h->Data();
2273 }
2274 else
2275 #endif
2276 #endif
2277
2278 #ifdef HAVE_WALK
2279 if (strcmp(sys_cmd, "MAltwalk2") == 0)
2280 {
2285 {
2286 Werror(
"system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2289 }
2290 ideal arg1 = (ideal)
h->Data();
2297 }
2298 else
2299 #endif
2300
2301 #ifdef HAVE_WALK
2302 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2303 {
2308 {
2309 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2312 }
2313 ideal arg1 = (ideal)
h->Data();
2316 int arg4 = (int) ((
long)(
h->next->next->next->Data()));
2321 }
2322 else
2323 #endif
2324
2325 #if 0
2326 #ifdef HAVE_WALK
2327 if (strcmp(sys_cmd, "TranMrImprovwalk") == 0)
2328 {
2332 h->next->next->next ==
NULL ||
h->next->next->next->Typ() !=
INT_CMD ||
2333 h->next->next->next ==
NULL ||
h->next->next->next->next->Typ() !=
INT_CMD ||
2334 h->next->next->next ==
NULL ||
h->next->next->next->next->next->Typ() !=
INT_CMD)
2335 {
2336 WerrorS(
"system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2338 }
2341 {
2342 Werror(
"system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n",
currRing->N);
2344 }
2345 ideal arg1 = (ideal)
h->Data();
2348 int arg4 = (int)(
long)
h->next->next->next->Data();
2349 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2350 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2351 ideal
result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2355 }
2356 else
2357 #endif
2358 #endif
2359
2360 {
2361 #ifndef MAKE_DISTRIBUTION
2363 #else
2365 #endif
2366 }
2367 }
2369}
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)