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 #if 0
318 long cpu=1;
319 #ifdef _SC_NPROCESSORS_ONLN
320 cpu=sysconf(_SC_NPROCESSORS_ONLN);
321 #elif defined(_SC_NPROCESSORS_CONF)
322 cpu=sysconf(_SC_NPROCESSORS_CONF);
323 #endif
324 res->data=(
void *)cpu;
325 #else
327 #endif
330 }
331 else
332
333 if(strcmp(sys_cmd,"executable")==0)
334 {
336 {
343 }
345 }
346 else
347
348 if(strcmp(sys_cmd,"flatten")==0)
349 {
351 {
355 }
356 else
358 }
359 else
360
361 if(strcmp(sys_cmd,"unflatten")==0)
362 {
365 {
369 }
371 }
372 else
373
374 if(strcmp(sys_cmd,"neworder")==0)
375 {
377 {
381 }
382 else
384 }
385 else
386
387
388 if(strcmp(sys_cmd,"nc_hilb") == 0)
389 {
394 int trunDegHs=0;
396 i = (ideal)
h->Data();
397 else
398 {
399 WerrorS(
"nc_Hilb:ideal expected");
401 }
404 lV = (int)(
long)
h->Data();
405 else
406 {
407 WerrorS(
"nc_Hilb:int expected");
409 }
412 {
413 if((
int)(
long)
h->Data() == 1)
415 else if((
int)(
long)
h->Data() == 2)
420 trunDegHs = (int)(
long)
h->Data();
422 }
424 {
425 WerrorS(
"nc_Hilb:int 1,2, total degree for the truncation, and a string for printing the details are expected");
427 }
428
431 }
432 else
433
434 if(strcmp(sys_cmd,"verifyGB")==0)
435 {
437 {
438 WerrorS(
"system(\"verifyGB\",<ideal>,..) expects a commutative ring");
440 }
442 {
443 WerrorS(
"expected system(\"verifyGB\",<ideal>,..)");
445 }
446 ideal F=(ideal)
h->Data();
448 {
449 #ifdef HAVE_VSPACE
451 if (cpus>1)
453 else
454 #endif
456 }
460 }
461 else
462
463 if(strcmp(sys_cmd,"rcolon") == 0)
464 {
467 {
468 ideal
i = (ideal)
h->Data();
470 poly
w=(poly)
h->Data();
472 int lV = (int)(
long)
h->Data();
476 }
477 else
479 }
480 else
481
482
483 if(strcmp(sys_cmd,"sh")==0)
484 {
486 {
487 WerrorS(
"shell execution is disallowed in restricted mode");
489 }
491 if (
h==
NULL)
res->data = (
void *)(
long) system(
"sh");
493 res->data = (
void*)(
long) system((
char*)(
h->Data()));
494 else
497 }
498 else
499
500 if(strcmp(sys_cmd,"reduce_bound")==0)
501 {
509 {
510 p = (poly)
h->CopyD();
511 }
513 {
514 pid = (ideal)
h->CopyD();
515 }
517
519 ideal q = (ideal)
h->next->CopyD();
520 int bound = (int)(
long)
h->next->next->Data();
523 else
526 }
527 else
528
529 if(strcmp(sys_cmd,"uname")==0)
530 {
534 }
535 else
536
537 if(strcmp(sys_cmd,"with")==0)
538 {
540 {
544 }
546 {
547 #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
548 char *
s=(
char *)
h->Data();
550 #ifdef HAVE_DBM
552 #endif
553 #ifdef HAVE_DLD
555 #endif
556
557
558 #ifdef HAVE_READLINE
560 #endif
561 #ifdef TEST_MAC_ORDER
563 #endif
564
566 #ifdef HAVE_DYNAMIC_LOADING
568 #endif
569 #ifdef HAVE_EIGENVAL
571 #endif
572 #ifdef HAVE_GMS
574 #endif
575 #ifdef OM_NDEBUG
577 #endif
578 #ifdef SING_NDEBUG
580 #endif
581 {};
583 #undef TEST_FOR
584 }
586 }
587 else
588
589 if (strcmp(sys_cmd,"browsers")==0)
590 {
596 }
597 else
598
599 if (strcmp(sys_cmd,"pid")==0)
600 {
602 res->data=(
void *)(
long) getpid();
604 }
605 else
606
607 if (strcmp(sys_cmd,"getenv")==0)
608 {
610 {
612 const char *r=
getenv((
char *)
h->Data());
616 }
617 else
618 {
621 }
622 }
623 else
624
625 if (strcmp(sys_cmd,"setenv")==0)
626 {
627 #ifdef HAVE_SETENV
630 {
632 setenv((
char *)
h->Data(), (
char *)
h->next->Data(), 1);
636 }
637 else
638 {
640 }
641 #else
642 WerrorS(
"setenv not supported on this platform");
644 #endif
645 }
646 else
647
648 if (strcmp(sys_cmd, "Singular") == 0)
649 {
655 }
656 else
657 if (strcmp(sys_cmd, "SingularLib") == 0)
658 {
664 }
665 else
666 if (strcmp(sys_cmd, "SingularBin") == 0)
667 {
670 if (r ==
NULL) r=
"/usr/local";
672
673 #define SINGULAR_PROCS_DIR "/libexec/singular/MOD"
676 if ((strstr(r,
".libs/..")==
NULL)
677 &&(strstr(r,
"Singular/..")==
NULL))
678 {
681 if (access(
s,X_OK)==0)
682 {
684 }
685 else
686 {
687
688 strcpy(
s,LIBEXEC_DIR);
689 if (access(
s,X_OK)==0)
690 {
692 }
693 else
694 {
696 }
697 }
698 }
699 else
700 {
703 {
705 }
706 else
707 {
710 }
711 }
712 res->data = (
void*)
s;
714 }
715 else
716
717 if (strstr(sys_cmd, "--") == sys_cmd)
718 {
719 if (strcmp(sys_cmd, "--") == 0)
720 {
723 }
726 {
727 Werror(
"Unknown option %s", sys_cmd);
728 WerrorS(
"Use 'system(\"--\");' for listing of available options");
730 }
731
732
734 {
737 }
739 {
741 {
743 const char *r=(
const char*)
feOptSpec[opt].value;
746 }
747 else
748 {
751 }
753 }
756 {
757 WerrorS(
"Need string or int argument to set option value");
759 }
760 const char* errormsg;
762 {
764 {
765 Werror(
"Need string argument to set value of option %s", sys_cmd);
767 }
769 if (errormsg !=
NULL)
770 Werror(
"Option '--%s=%d' %s", sys_cmd, (
int) ((
long)
h->Data()), errormsg);
771 }
772 else
773 {
775 if (errormsg !=
NULL)
776 Werror(
"Option '--%s=%s' %s", sys_cmd, (
char*)
h->Data(), errormsg);
777 }
780 }
781 else
782
783 if (strcmp(sys_cmd,"HC")==0)
784 {
788 }
789 else
790
791 if(strcmp(sys_cmd,"random")==0)
792 {
795 {
797 {
802 }
803 else
804 {
806 }
807 }
811 }
812 else
813
814 if (strcmp(sys_cmd,"denom_list")==0)
815 {
820 }
821 else
822
823 if(strcmp(sys_cmd,"complexNearZero")==0)
824 {
827 {
829 {
830 WerrorS(
"unsupported ground field!");
832 }
833 else
834 {
837 (int)((
long)(
h->next->Data())));
839 }
840 }
841 else
842 {
844 }
845 }
846 else
847
848 if(strcmp(sys_cmd,"getPrecDigits")==0)
849 {
852 {
853 WerrorS(
"unsupported ground field!");
855 }
858
859
861 }
862 else
863
864 if(strcmp(sys_cmd, "lduDecomp")==0)
865 {
868 {
871 poly
l; poly u; poly prodLU;
872 lduDecomp(aMat, pMat, lMat, dMat, uMat,
l, u, prodLU);
883 res->data = (
char *)L;
885 }
886 else
887 {
889 }
890 }
891 else
892
893 if(strcmp(sys_cmd, "lduSolve")==0)
894 {
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
915 {
917 }
919 {
922 }
927 poly
l = (poly)
h->next->next->next->next->Data();
928 poly u = (poly)
h->next->next->next->next->next->Data();
929 poly lTimesU = (poly)
h->next->next->next->next->next->next->Data();
930 matrix bVec = (
matrix)
h->next->next->next->next->next->next->next->Data();
933 {
934 Werror(
"first matrix (%d x %d) is not quadratic",
937 }
939 {
940 Werror(
"second matrix (%d x %d) is not quadratic",
943 }
945 {
946 Werror(
"third matrix (%d x %d) is not quadratic",
949 }
951 {
952 Werror(
"third matrix (%d x %d) and fourth matrix (%d x %d) %s",
954 "do not t");
956 }
958 {
959 Werror(
"fourth matrix (%d x %d) and vector (%d x 1) do not fit",
962 }
964 bVec, xVec, homogSolSpace);
965
966
967
969 if (solvable)
970 {
975 }
976 else
977 {
980 }
984 }
985 else
986
987 if (strcmp(sys_cmd, "shared") == 0)
988 {
989 #ifndef SI_COUNTEDREF_AUTOLOAD
992 #endif
995 }
996 else if (strcmp(sys_cmd, "reference") == 0)
997 {
998 #ifndef SI_COUNTEDREF_AUTOLOAD
1001 #endif
1004 }
1005 else
1006
1007#ifdef HAVE_SIMPLEIPC
1008 if (strcmp(sys_cmd,"semaphore")==0)
1009 {
1011 {
1013 if ((
h->next->next!=
NULL)&& (
h->next->next->Typ()==
INT_CMD))
1014 v=(int)(
long)
h->next->next->Data();
1018 }
1019 else
1020 {
1021 WerrorS(
"Usage: system(\"semaphore\",<cmd>,int)");
1023 }
1024 }
1025 else
1026#endif
1027
1028 if (strcmp(sys_cmd,"reserve")==0)
1029 {
1033 {
1036 res->data=(
void*)(
long)
p;
1038 }
1040 }
1041 else
1042
1043 if (strcmp(sys_cmd,"reservedLink")==0)
1044 {
1049 }
1050 else
1051
1052 if (strcmp(sys_cmd,"install")==0)
1053 {
1056 {
1058 (
int)(
long)
h->next->next->next->Data(),
1060 }
1062 }
1063 else
1064
1065 if (strcmp(sys_cmd,"newstruct")==0)
1066 {
1069 {
1070 int id=0;
1071 char *n=(
char*)
h->Data();
1073 if (id>0)
1074 {
1077 {
1078 newstruct_desc desc=(newstruct_desc)bb->data;
1081 }
1082 else Werror(
"'%s' is not a newstruct",n);
1083 }
1084 else Werror(
"'%s' is not a blackbox object",n);
1085 }
1087 }
1088 else
1089
1090 if (strcmp(sys_cmd,"blackbox")==0)
1091 {
1094 }
1095 else
1096
1097 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1098 if (strcmp(sys_cmd, "absFact") == 0)
1099 {
1104 {
1108 int n= 0;
1115 l->m[0].data=(
void *)
f;
1117 l->m[1].data=(
void *)
v;
1119 l->m[2].data=(
void*) mipos;
1121 l->m[3].data=(
void*) (
long) n;
1122 res->data=(
void *)
l;
1124 }
1126 }
1127 else
1128 #endif
1129
1130 #ifdef HAVE_NTL
1131 if (strcmp(sys_cmd, "LLL") == 0)
1132 {
1134 {
1137 {
1140 }
1142 {
1145 }
1147 }
1149 }
1150 else
1151 #endif
1152
1153 #ifdef HAVE_FLINT
1154 #if __FLINT_RELEASE >= 20500
1155 if (strcmp(sys_cmd, "LLL_Flint") == 0)
1156 {
1158 {
1160 {
1163 {
1166 }
1168 {
1171 }
1173 }
1175 {
1176 WerrorS(
"matrix,int or bigint,int expected");
1178 }
1180 {
1181 if(((
int)((
long)(
h->next->Data())) != 0) && (
int)((
long)(
h->next->Data()) != 1))
1182 {
1183 WerrorS(
"int is different from 0, 1");
1185 }
1187 if((
long)(
h->next->Data()) == 0)
1188 {
1190 {
1193 }
1195 {
1198 }
1200 }
1201
1202 if((
long)(
h->next->Data()) == 1)
1203 {
1205 {
1208 for(
int i = 1;
i<=
m->rows();
i++)
1209 {
1212 }
1221 }
1223 {
1226 for(
int i = 1;
i<=
m->rows();
i++)
1236 }
1238 }
1239 }
1240
1241 }
1243 }
1244 else
1245 #endif
1246 #endif
1247
1248 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1249 if(strcmp(sys_cmd,"rref")==0)
1250 {
1254 {
1256 #if defined(HAVE_FLINT)
1258 #elif defined(HAVE_NTL)
1260 #endif
1263 }
1265 {
1266 ideal
M=(ideal)
h->Data();
1267 #if defined(HAVE_FLINT)
1269 #elif defined(HAVE_NTL)
1271 #endif
1274 }
1275 else
1276 {
1277 WerrorS(
"expected system(\"rref\",<matrix>/<smatrix>)");
1279 }
1280 }
1281 else
1282 #endif
1283
1284 #ifdef HAVE_PCV
1285 if(strcmp(sys_cmd,"pcvLAddL")==0)
1286 {
1288 }
1289 else
1290 if(strcmp(sys_cmd,"pcvPMulL")==0)
1291 {
1293 }
1294 else
1295 if(strcmp(sys_cmd,"pcvMinDeg")==0)
1296 {
1298 }
1299 else
1300 if(strcmp(sys_cmd,"pcvP2CV")==0)
1301 {
1303 }
1304 else
1305 if(strcmp(sys_cmd,"pcvCV2P")==0)
1306 {
1308 }
1309 else
1310 if(strcmp(sys_cmd,"pcvDim")==0)
1311 {
1313 }
1314 else
1315 if(strcmp(sys_cmd,"pcvBasis")==0)
1316 {
1318 }
1319 else
1320 #endif
1321
1322 #ifdef HAVE_EIGENVAL
1323 if(strcmp(sys_cmd,"hessenberg")==0)
1324 {
1326 }
1327 else
1328 #endif
1329
1330 #ifdef HAVE_EIGENVAL
1331 if(strcmp(sys_cmd,"eigenvals")==0)
1332 {
1334 }
1335 else
1336 #endif
1337
1338 #ifdef HAVE_EIGENVAL
1339 if(strcmp(sys_cmd,"rowelim")==0)
1340 {
1342 }
1343 else
1344 #endif
1345
1346 #ifdef HAVE_EIGENVAL
1347 if(strcmp(sys_cmd,"rowcolswap")==0)
1348 {
1350 }
1351 else
1352 #endif
1353
1354 #ifdef HAVE_GMS
1355 if(strcmp(sys_cmd,"gmsnf")==0)
1356 {
1358 }
1359 else
1360 #endif
1361
1362 if(strcmp(sys_cmd,"contributors") == 0)
1363 {
1366 "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");
1368 }
1369 else
1370
1371 #ifdef HAVE_SPECTRUM
1372 if(strcmp(sys_cmd,"spectrum") == 0)
1373 {
1375 {
1378 }
1382 {
1385 }
1386 if(((
long)
h->next->Data())==1L)
1389 }
1390 else
1391
1392 if(strcmp(sys_cmd,"semic") == 0)
1393 {
1397 {
1398 if (
h->next->next==
NULL)
1400 else if (
h->next->next->Typ()==
INT_CMD)
1402 }
1404 }
1405 else
1406
1407 if(strcmp(sys_cmd,"spadd") == 0)
1408 {
1411 {
1413 }
1415 }
1416 else
1417
1418 if(strcmp(sys_cmd,"spmul") == 0)
1419 {
1422 {
1424 }
1426 }
1427 else
1428 #endif
1429
1430 #define HAVE_SHEAFCOH_TRICKS 1
1431
1432 #ifdef HAVE_SHEAFCOH_TRICKS
1433 if(strcmp(sys_cmd,"tensorModuleMult")==0)
1434 {
1436
1438 {
1439 int m = (int)( (
long)
h->Data() );
1440 ideal
M = (ideal)
h->next->Data();
1444 }
1446 }
1447 else
1448 #endif
1449
1450 #ifdef HAVE_PLURAL
1451 if (strcmp(sys_cmd, "twostd") == 0)
1452 {
1453 ideal I;
1455 {
1456 I=(ideal)
h->CopyD();
1462 }
1465 }
1466 else
1467 #endif
1468
1469 #ifdef HAVE_PLURAL
1470 if (strcmp(sys_cmd, "bracket") == 0)
1471 {
1474 {
1475 poly
p=(poly)
h->CopyD();
1477 poly q=(poly)
h->Data();
1481 }
1483 }
1484 else
1485 #endif
1486
1487 #ifdef HAVE_PLURAL
1488 if (strcmp(sys_cmd, "env")==0)
1489 {
1491 {
1492 ring r = (ring)
h->Data();
1496 }
1497 else
1498 {
1499 WerrorS(
"`system(\"env\",<ring>)` expected");
1501 }
1502 }
1503 else
1504 #endif
1505
1506 #ifdef HAVE_PLURAL
1507 if (strcmp(sys_cmd, "opp")==0)
1508 {
1510 {
1511 ring r=(ring)
h->Data();
1515 }
1516 else
1517 {
1518 WerrorS(
"`system(\"opp\",<ring>)` expected");
1520 }
1521 }
1522 else
1523 #endif
1524
1525 #ifdef HAVE_PLURAL
1526 if (strcmp(sys_cmd, "oppose")==0)
1527 {
1529 && (
h->next!=
NULL))
1530 {
1531 ring Rop = (ring)
h->Data();
1535 {
1540 }
1541 }
1542 else
1543 {
1544 WerrorS(
"`system(\"oppose\",<ring>,<poly>)` expected");
1546 }
1547 }
1548 else
1549 #endif
1550
1551
1552 #ifdef HAVE_WALK
1553 #ifdef OWNW
1554 if (strcmp(sys_cmd, "walkNextWeight") == 0)
1555 {
1560 {
1561 Werror(
"system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1564 }
1565 res->data = (
void*) walkNextWeight(((
intvec*)
h->Data()),
1567 (ideal)
h->next->next->Data());
1568 if (
res->data ==
NULL ||
res->data == (
void*) 1L)
1569 {
1571 }
1572 else
1573 {
1575 }
1577 }
1578 else
1579 #endif
1580 #endif
1581
1582 #ifdef HAVE_WALK
1583 #ifdef OWNW
1584 if (strcmp(sys_cmd, "walkInitials") == 0)
1585 {
1587 {
1588 WerrorS(
"system(\"walkInitials\", ideal) expected");
1590 }
1591 res->data = (
void*) walkInitials((ideal)
h->Data());
1594 }
1595 else
1596 #endif
1597 #endif
1598
1599 #ifdef HAVE_WALK
1600 #ifdef WAIV
1601 if (strcmp(sys_cmd, "walkAddIntVec") == 0)
1602 {
1607 res->data = (
intvec*) walkAddIntVec(arg1, arg2);
1610 }
1611 else
1612 #endif
1613 #endif
1614
1615 #ifdef HAVE_WALK
1616 #ifdef MwaklNextWeight
1617 if (strcmp(sys_cmd, "MwalkNextWeight") == 0)
1618 {
1623 {
1624 Werror(
"system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1627 }
1630 ideal arg3 = (ideal)
h->next->next->Data();
1635 }
1636 else
1637 #endif
1638 #endif
1639
1640 #ifdef HAVE_WALK
1641 if(strcmp(sys_cmd, "Mivdp") == 0)
1642 {
1644 {
1645 WerrorS(
"system(\"Mivdp\", int) expected");
1647 }
1648 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1649 {
1650 Werror(
"system(\"Mivdp\" ...) intvecs not of length %d\n",
1653 }
1654 int arg1 = (int) ((
long)(
h->Data()));
1659 }
1660 else
1661 #endif
1662
1663 #ifdef HAVE_WALK
1664 if(strcmp(sys_cmd, "Mivlp") == 0)
1665 {
1667 {
1668 WerrorS(
"system(\"Mivlp\", int) expected");
1670 }
1671 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1672 {
1673 Werror(
"system(\"Mivlp\" ...) intvecs not of length %d\n",
1676 }
1677 int arg1 = (int) ((
long)(
h->Data()));
1682 }
1683 else
1684 #endif
1685
1686 #ifdef HAVE_WALK
1687 #ifdef MpDiv
1688 if(strcmp(sys_cmd, "MpDiv") == 0)
1689 {
1692 poly arg1 = (poly)
h->Data();
1693 poly arg2 = (poly)
h->next->Data();
1694 poly
result = MpDiv(arg1, arg2);
1698 }
1699 else
1700 #endif
1701 #endif
1702
1703 #ifdef HAVE_WALK
1704 #ifdef MpMult
1705 if(strcmp(sys_cmd, "MpMult") == 0)
1706 {
1709 poly arg1 = (poly)
h->Data();
1710 poly arg2 = (poly)
h->next->Data();
1711 poly
result = MpMult(arg1, arg2);
1715 }
1716 else
1717 #endif
1718 #endif
1719
1720 #ifdef HAVE_WALK
1721 if (strcmp(sys_cmd, "MivSame") == 0)
1722 {
1725
1726
1727
1728
1729
1730
1731
1732
1733
1736
1737
1738
1739
1740
1742 res->data = (
void*)(
long)
MivSame(arg1, arg2);
1744 }
1745 else
1746 #endif
1747
1748 #ifdef HAVE_WALK
1749 if (strcmp(sys_cmd, "M3ivSame") == 0)
1750 {
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1766
1767
1768
1769
1770
1772 res->data = (
void*)(
long)
M3ivSame(arg1, arg2, arg3);
1774 }
1775 else
1776 #endif
1777
1778 #ifdef HAVE_WALK
1779 if(strcmp(sys_cmd, "MwalkInitialForm") == 0)
1780 {
1784 {
1785 Werror(
"system \"MwalkInitialForm\"...) intvec not of length %d\n",
1788 }
1789 ideal
id = (ideal)
h->Data();
1795 }
1796 else
1797 #endif
1798
1799 #ifdef HAVE_WALK
1800
1801 if(strcmp(sys_cmd, "MivMatrixOrder") == 0)
1802 {
1804 {
1805 WerrorS(
"system(\"MivMatrixOrder\",intvec) expected");
1807 }
1813 }
1814 else
1815 #endif
1816
1817 #ifdef HAVE_WALK
1818 if(strcmp(sys_cmd, "MivMatrixOrderdp") == 0)
1819 {
1821 {
1822 WerrorS(
"system(\"MivMatrixOrderdp\",intvec) expected");
1824 }
1825 int arg1 = (int) ((
long)(
h->Data()));
1830 }
1831 else
1832 #endif
1833
1834 #ifdef HAVE_WALK
1835 if(strcmp(sys_cmd, "MPertVectors") == 0)
1836 {
1839 ideal arg1 = (ideal)
h->Data();
1841 int arg3 = (int) ((
long)(
h->next->next->Data()));
1846 }
1847 else
1848 #endif
1849
1850 #ifdef HAVE_WALK
1851 if(strcmp(sys_cmd, "MPertVectorslp") == 0)
1852 {
1855 ideal arg1 = (ideal)
h->Data();
1857 int arg3 = (int) ((
long)(
h->next->next->Data()));
1862 }
1863 else
1864 #endif
1865
1866 #ifdef HAVE_WALK
1867 if(strcmp(sys_cmd, "Mfpertvector") == 0)
1868 {
1871 ideal arg1 = (ideal)
h->Data();
1877 }
1878 else
1879 #endif
1880
1881 #ifdef HAVE_WALK
1882 if(strcmp(sys_cmd, "MivUnit") == 0)
1883 {
1886 int arg1 = (int) ((
long)(
h->Data()));
1891 }
1892 else
1893 #endif
1894
1895 #ifdef HAVE_WALK
1896 if(strcmp(sys_cmd, "MivWeightOrderlp") == 0)
1897 {
1905 }
1906 else
1907 #endif
1908
1909 #ifdef HAVE_WALK
1910 if(strcmp(sys_cmd, "MivWeightOrderdp") == 0)
1911 {
1913 {
1914 WerrorS(
"system(\"MivWeightOrderdp\",intvec) expected");
1916 }
1918
1923 }
1924 else
1925 #endif
1926
1927 #ifdef HAVE_WALK
1928 if(strcmp(sys_cmd, "MivMatrixOrderlp") == 0)
1929 {
1931 {
1932 WerrorS(
"system(\"MivMatrixOrderlp\",int) expected");
1934 }
1935 int arg1 = (int) ((
long)(
h->Data()));
1940 }
1941 else
1942 #endif
1943
1944 #ifdef HAVE_WALK
1945 if (strcmp(sys_cmd, "MkInterRedNextWeight") == 0)
1946 {
1951 {
1952 Werror(
"system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1955 }
1958 ideal arg3 = (ideal)
h->next->next->Data();
1963 }
1964 else
1965 #endif
1966
1967 #ifdef HAVE_WALK
1968 #ifdef MPertNextWeight
1969 if (strcmp(sys_cmd, "MPertNextWeight") == 0)
1970 {
1974 {
1975 Werror(
"system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1978 }
1980 ideal arg2 = (ideal)
h->next->Data();
1981 int arg3 = (int)
h->next->next->Data();
1986 }
1987 else
1988 #endif
1989 #endif
1990
1991 #ifdef HAVE_WALK
1992 #ifdef Mivperttarget
1993 if (strcmp(sys_cmd, "Mivperttarget") == 0)
1994 {
1997 ideal arg1 = (ideal)
h->Data();
1998 int arg2 = (int)
h->next->Data();
2003 }
2004 else
2005 #endif
2006 #endif
2007
2008 #ifdef HAVE_WALK
2009 if (strcmp(sys_cmd, "Mwalk") == 0)
2010 {
2015 {
2016 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d\n",
2019 }
2020 ideal arg1 = (ideal)
h->CopyD();
2023 ring arg4 = (ring)
h->next->next->next->Data();
2024 int arg5 = (int) (
long)
h->next->next->next->next->Data();
2025 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2026 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2030 }
2031 else
2032 #endif
2033
2034 #ifdef HAVE_WALK
2035 #ifdef MPWALK_ORIG
2036 if (strcmp(sys_cmd, "Mwalk") == 0)
2037 {
2044 {
2045 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2048 }
2049 ideal arg1 = (ideal)
h->Data();
2052 ring arg4 = (ring)
h->next->next->next->Data();
2053 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3,arg4);
2057 }
2058 else
2059 #else
2060 if (strcmp(sys_cmd, "Mpwalk") == 0)
2061 {
2066 {
2067 Werror(
"system(\"Mpwalk\" ...) intvecs not of length %d\n",
currRing->N);
2069 }
2070 ideal arg1 = (ideal)
h->Data();
2071 int arg2 = (int) (
long)
h->next->Data();
2072 int arg3 = (int) (
long)
h->next->next->Data();
2075 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2076 int arg7 = (int) (
long)
h->next->next->next->next->next->next->Data();
2077 int arg8 = (int) (
long)
h->next->next->next->next->next->next->next->Data();
2078 ideal
result = (ideal)
Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2082 }
2083 else
2084 #endif
2085 #endif
2086
2087 #ifdef HAVE_WALK
2088 if (strcmp(sys_cmd, "Mrwalk") == 0)
2089 {
2096 {
2097 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2100 }
2101 ideal arg1 = (ideal)
h->Data();
2104 int arg4 = (int)(
long)
h->next->next->next->Data();
2105 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2106 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2107 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2108 ideal
result = (ideal)
Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2112 }
2113 else
2114 #endif
2115
2116 #ifdef HAVE_WALK
2117 if (strcmp(sys_cmd, "MAltwalk1") == 0)
2118 {
2123 {
2124 Werror(
"system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2127 }
2128 ideal arg1 = (ideal)
h->Data();
2129 int arg2 = (int) ((
long)(
h->next->Data()));
2130 int arg3 = (int) ((
long)(
h->next->next->Data()));
2137 }
2138 else
2139 #endif
2140
2141 #ifdef HAVE_WALK
2142 #ifdef MFWALK_ALT
2143 if (strcmp(sys_cmd, "Mfwalk_alt") == 0)
2144 {
2149 {
2150 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2153 }
2154 ideal arg1 = (ideal)
h->Data();
2157 int arg4 = (int)
h->next->next->next->Data();
2158 ideal
result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2162 }
2163 else
2164 #endif
2165 #endif
2166
2167 #ifdef HAVE_WALK
2168 if (strcmp(sys_cmd, "Mfwalk") == 0)
2169 {
2174 {
2175 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2178 }
2179 ideal arg1 = (ideal)
h->Data();
2182 int arg4 = (int)(
long)
h->next->next->next->Data();
2183 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2184 ideal
result = (ideal)
Mfwalk(arg1, arg2, arg3, arg4, arg5);
2188 }
2189 else
2190 #endif
2191
2192 #ifdef HAVE_WALK
2193 if (strcmp(sys_cmd, "Mfrwalk") == 0)
2194 {
2197
2198
2199
2200
2201
2202
2203
2204
2209 {
2210 Werror(
"system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2213 }
2214
2215 ideal arg1 = (ideal)
h->Data();
2218 int arg4 = (int)(
long)
h->next->next->next->Data();
2219 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2220 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2221 ideal
result = (ideal)
Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2225 }
2226 else
2227
2228 if (strcmp(sys_cmd, "Mprwalk") == 0)
2229 {
2236 {
2237 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2240 }
2241 ideal arg1 = (ideal)
h->Data();
2244 int arg4 = (int)(
long)
h->next->next->next->Data();
2245 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2246 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2247 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2248 int arg8 = (int)(
long)
h->next->next->next->next->next->next->next->Data();
2249 int arg9 = (int)(
long)
h->next->next->next->next->next->next->next->next->Data();
2250 ideal
result = (ideal)
Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2254 }
2255 else
2256 #endif
2257
2258 #ifdef HAVE_WALK
2259 #ifdef TRAN_Orig
2260 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2261 {
2266 {
2267 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2270 }
2271 ideal arg1 = (ideal)
h->Data();
2278 }
2279 else
2280 #endif
2281 #endif
2282
2283 #ifdef HAVE_WALK
2284 if (strcmp(sys_cmd, "MAltwalk2") == 0)
2285 {
2290 {
2291 Werror(
"system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2294 }
2295 ideal arg1 = (ideal)
h->Data();
2302 }
2303 else
2304 #endif
2305
2306 #ifdef HAVE_WALK
2307 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2308 {
2313 {
2314 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2317 }
2318 ideal arg1 = (ideal)
h->Data();
2321 int arg4 = (int) ((
long)(
h->next->next->next->Data()));
2326 }
2327 else
2328 #endif
2329
2330 #if 0
2331 #ifdef HAVE_WALK
2332 if (strcmp(sys_cmd, "TranMrImprovwalk") == 0)
2333 {
2337 h->next->next->next ==
NULL ||
h->next->next->next->Typ() !=
INT_CMD ||
2338 h->next->next->next ==
NULL ||
h->next->next->next->next->Typ() !=
INT_CMD ||
2339 h->next->next->next ==
NULL ||
h->next->next->next->next->next->Typ() !=
INT_CMD)
2340 {
2341 WerrorS(
"system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2343 }
2346 {
2347 Werror(
"system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n",
currRing->N);
2349 }
2350 ideal arg1 = (ideal)
h->Data();
2353 int arg4 = (int)(
long)
h->next->next->next->Data();
2354 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2355 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2356 ideal
result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2360 }
2361 else
2362 #endif
2363 #endif
2364
2365 {
2366 #ifndef MAKE_DISTRIBUTION
2368 #else
2370 #endif
2371 }
2372 }
2374}
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)