228{
230 {
231 const char *sys_cmd=(
char *)(args->
Data());
233
234
235
236 if (strcmp(sys_cmd, "nblocks") == 0)
237 {
238 ring r;
240 {
242 {
244 }
245 else
246 {
249 }
250 }
251 else
252 {
254 {
257 }
258 r = (ring)
h->Data();
259 }
263 }
264
265 if(strcmp(sys_cmd,"version")==0)
266 {
270 }
271 else
272
273 if(strcmp(sys_cmd,"alarm")==0)
274 {
276 {
277
278
279
280 struct itimerval t,o;
281 memset(&t,0,sizeof(t));
282 t.it_value.tv_sec =(unsigned)((
unsigned long)
h->Data());
283 setitimer(ITIMER_VIRTUAL,&t,&o);
285 }
286 else
288 }
289 else
290
291 if(strcmp(sys_cmd,"content")==0)
292 {
294 {
296 poly
p=(poly)
h->CopyD();
298 {
301 }
305 }
307 }
308 else
309
310 if(strcmp(sys_cmd,"cpu")==0)
311 {
312 #if 0
313 long cpu=1;
314 #ifdef _SC_NPROCESSORS_ONLN
315 cpu=sysconf(_SC_NPROCESSORS_ONLN);
316 #elif defined(_SC_NPROCESSORS_CONF)
317 cpu=sysconf(_SC_NPROCESSORS_CONF);
318 #endif
319 res->data=(
void *)cpu;
320 #else
322 #endif
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 }
438 {
439 Werror(
"expected system(\"verifyGB\",<ideal/module>), found <%s>",
Tok2Cmdname(
h->Typ()));
441 }
442 ideal F=(ideal)
h->Data();
446 }
447 else
448
449 if(strcmp(sys_cmd,"rcolon") == 0)
450 {
453 {
454 ideal
i = (ideal)
h->Data();
456 poly
w=(poly)
h->Data();
458 int lV = (int)(
long)
h->Data();
462 }
463 else
465 }
466 else
467
468
469 if(strcmp(sys_cmd,"sh")==0)
470 {
472 {
473 WerrorS(
"shell execution is disallowed in restricted mode");
475 }
477 if (
h==
NULL)
res->data = (
void *)(
long) system(
"sh");
479 res->data = (
void*)(
long) system((
char*)(
h->Data()));
480 else
482 if (errno==ECHILD)
res->data=
NULL;
484 }
485 else
486
487 if(strcmp(sys_cmd,"reduce_bound")==0)
488 {
496 {
497 p = (poly)
h->CopyD();
498 }
500 {
501 pid = (ideal)
h->CopyD();
502 }
504
506 ideal q = (ideal)
h->next->CopyD();
507 int bound = (int)(
long)
h->next->next->Data();
510 else
513 }
514 else
515
516 if(strcmp(sys_cmd,"uname")==0)
517 {
521 }
522 else
523
524 if(strcmp(sys_cmd,"with")==0)
525 {
527 {
531 }
533 {
534 #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
535 char *
s=(
char *)
h->Data();
537 #ifdef HAVE_DBM
539 #endif
540 #ifdef HAVE_DLD
542 #endif
543
544
545 #ifdef HAVE_READLINE
547 #endif
548 #ifdef TEST_MAC_ORDER
550 #endif
551
553 #ifdef HAVE_DYNAMIC_LOADING
555 #endif
556 #ifdef HAVE_EIGENVAL
558 #endif
559 #ifdef HAVE_GMS
561 #endif
562 #ifdef OM_NDEBUG
564 #endif
565 #ifdef SING_NDEBUG
567 #endif
568 {};
570 #undef TEST_FOR
571 }
573 }
574 else
575
576 if (strcmp(sys_cmd,"browsers")==0)
577 {
583 }
584 else
585
586 if (strcmp(sys_cmd,"pid")==0)
587 {
589 res->data=(
void *)(
long) getpid();
591 }
592 else
593
594 if (strcmp(sys_cmd,"getenv")==0)
595 {
597 {
599 const char *r=
getenv((
char *)
h->Data());
603 }
604 else
605 {
608 }
609 }
610 else
611
612 if (strcmp(sys_cmd,"setenv")==0)
613 {
614 #ifdef HAVE_SETENV
617 {
619 setenv((
char *)
h->Data(), (
char *)
h->next->Data(), 1);
623 }
624 else
625 {
627 }
628 #else
629 WerrorS(
"setenv not supported on this platform");
631 #endif
632 }
633 else
634
635 if (strcmp(sys_cmd, "Singular") == 0)
636 {
642 }
643 else
644 if (strcmp(sys_cmd, "SingularLib") == 0)
645 {
651 }
652 else
653 if (strcmp(sys_cmd, "SingularBin") == 0)
654 {
657 if (r ==
NULL) r=
"/usr/local";
659
660 #define SINGULAR_PROCS_DIR "/libexec/singular/MOD"
663 if ((strstr(r,
".libs/..")==
NULL)
664 &&(strstr(r,
"Singular/..")==
NULL))
665 {
668 if (access(
s,X_OK)==0)
669 {
671 }
672 else
673 {
674
675 strcpy(
s,LIBEXEC_DIR);
676 if (access(
s,X_OK)==0)
677 {
679 }
680 else
681 {
683 }
684 }
685 }
686 else
687 {
690 {
692 }
693 else
694 {
697 }
698 }
699 res->data = (
void*)
s;
701 }
702 else
703
704 if (strstr(sys_cmd, "--") == sys_cmd)
705 {
706 if (strcmp(sys_cmd, "--") == 0)
707 {
710 }
713 {
714 Werror(
"Unknown option %s", sys_cmd);
715 WerrorS(
"Use 'system(\"--\");' for listing of available options");
717 }
718
719
721 {
724 }
726 {
728 {
730 const char *r=(
const char*)
feOptSpec[opt].value;
733 }
734 else
735 {
738 }
740 }
741 const char* errormsg=
NULL;
743 {
745 {
746 Werror(
"Need string argument to set value of option %s", sys_cmd);
748 }
750 if (errormsg !=
NULL)
751 Werror(
"Option '--%s=%d' %s", sys_cmd, (
int) ((
long)
h->Data()), errormsg);
752 }
754 {
756 if (errormsg !=
NULL)
757 Werror(
"Option '--%s=%s' %s", sys_cmd, (
char*)
h->Data(), errormsg);
758 }
759 else
760 {
761 WerrorS(
"Need string or int argument to set option value");
763 }
766 }
767 else
768
769 if (strcmp(sys_cmd,"HC")==0)
770 {
774 }
775 else
776
777 if(strcmp(sys_cmd,"random")==0)
778 {
781 {
783 {
788 }
789 else
790 {
792 }
793 }
797 }
798 else
799
800 if (strcmp(sys_cmd,"denom_list")==0)
801 {
806 }
807 else
808
809 if(strcmp(sys_cmd,"complexNearZero")==0)
810 {
813 {
815 {
816 WerrorS(
"unsupported ground field!");
818 }
819 else
820 {
823 (
int)((
long)(
h->next->Data())));
825 }
826 }
827 else
828 {
830 }
831 }
832 else
833
834 if(strcmp(sys_cmd,"getPrecDigits")==0)
835 {
838 {
839 WerrorS(
"unsupported ground field!");
841 }
844
845
847 }
848 else
849
850 if(strcmp(sys_cmd, "lduDecomp")==0)
851 {
854 {
857 poly
l; poly u; poly prodLU;
858 lduDecomp(aMat, pMat, lMat, dMat, uMat,
l, u, prodLU);
869 res->data = (
char *)L;
871 }
872 else
873 {
875 }
876 }
877 else
878
879 if(strcmp(sys_cmd, "lduSolve")==0)
880 {
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
901 {
903 }
905 {
908 }
913 poly
l = (poly)
h->next->next->next->next->Data();
914 poly u = (poly)
h->next->next->next->next->next->Data();
915 poly lTimesU = (poly)
h->next->next->next->next->next->next->Data();
916 matrix bVec = (
matrix)
h->next->next->next->next->next->next->next->Data();
919 {
920 Werror(
"first matrix (%d x %d) is not quadratic",
923 }
925 {
926 Werror(
"second matrix (%d x %d) is not quadratic",
929 }
931 {
932 Werror(
"third matrix (%d x %d) is not quadratic",
935 }
937 {
938 Werror(
"third matrix (%d x %d) and fourth matrix (%d x %d) %s",
940 "do not t");
942 }
944 {
945 Werror(
"fourth matrix (%d x %d) and vector (%d x 1) do not fit",
948 }
950 bVec, xVec, homogSolSpace);
951
952
953
955 if (solvable)
956 {
961 }
962 else
963 {
966 }
970 }
971 else
972
973 if (strcmp(sys_cmd, "shared") == 0)
974 {
975 #ifndef SI_COUNTEDREF_AUTOLOAD
978 #endif
981 }
982 else if (strcmp(sys_cmd, "reference") == 0)
983 {
984 #ifndef SI_COUNTEDREF_AUTOLOAD
987 #endif
990 }
991 else
992
993#ifdef HAVE_SIMPLEIPC
994 if (strcmp(sys_cmd,"semaphore")==0)
995 {
997 {
1000 v=(int)(
long)
h->next->next->Data();
1004 }
1005 else
1006 {
1007 WerrorS(
"Usage: system(\"semaphore\",<cmd>,int)");
1009 }
1010 }
1011 else
1012#endif
1013
1014 if (strcmp(sys_cmd,"reserve")==0)
1015 {
1018 {
1021 res->data=(
void*)(
long)
p;
1023 }
1025 }
1026 else
1027
1028 if (strcmp(sys_cmd,"reservedLink")==0)
1029 {
1034 }
1035 else
1036
1037 if (strcmp(sys_cmd,"install")==0)
1038 {
1041 {
1043 (
int)(
long)
h->next->next->next->Data(),
1045 }
1047 }
1048 else
1049
1050 if (strcmp(sys_cmd,"newstruct")==0)
1051 {
1054 {
1055 int id=0;
1056 char *n=(
char*)
h->Data();
1058 if (id>0)
1059 {
1062 {
1063 newstruct_desc desc=(newstruct_desc)bb->data;
1066 }
1067 else Werror(
"'%s' is not a newstruct",n);
1068 }
1069 else Werror(
"'%s' is not a blackbox object",n);
1070 }
1072 }
1073 else
1074
1075 if (strcmp(sys_cmd,"blackbox")==0)
1076 {
1079 }
1080 else
1081
1082 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1083 if (strcmp(sys_cmd, "absFact") == 0)
1084 {
1089 {
1093 int n= 0;
1100 l->m[0].data=(
void *)
f;
1102 l->m[1].data=(
void *)
v;
1104 l->m[2].data=(
void*) mipos;
1106 l->m[3].data=(
void*) (
long) n;
1107 res->data=(
void *)
l;
1109 }
1111 }
1112 else
1113 #endif
1114
1115 #ifdef HAVE_NTL
1116 if (strcmp(sys_cmd, "LLL") == 0)
1117 {
1119 {
1122 {
1125 }
1127 {
1130 }
1132 }
1134 }
1135 else
1136 #endif
1137
1138 #ifdef HAVE_FLINT
1139 #if __FLINT_RELEASE >= 20500
1140 if (strcmp(sys_cmd, "LLL_Flint") == 0)
1141 {
1143 {
1145 {
1148 {
1151 }
1153 {
1156 }
1158 }
1160 {
1161 WerrorS(
"matrix,int or bigint,int expected");
1163 }
1165 {
1166 if(((
int)((
long)(
h->next->Data())) != 0) && (
int)((
long)(
h->next->Data()) != 1))
1167 {
1168 WerrorS(
"int is different from 0, 1");
1170 }
1172 if((
long)(
h->next->Data()) == 0)
1173 {
1175 {
1178 }
1180 {
1183 }
1185 }
1186
1187 if((
long)(
h->next->Data()) == 1)
1188 {
1190 {
1193 for(
int i = 1;
i<=
m->rows();
i++)
1194 {
1197 }
1206 }
1208 {
1211 for(
int i = 1;
i<=
m->rows();
i++)
1221 }
1223 }
1224 }
1225
1226 }
1228 }
1229 else
1230 #endif
1231 #endif
1232
1233 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1234 if(strcmp(sys_cmd,"rref")==0)
1235 {
1239 {
1241 #if defined(HAVE_FLINT)
1243 #elif defined(HAVE_NTL)
1245 #endif
1248 }
1250 {
1251 ideal
M=(ideal)
h->Data();
1252 #if defined(HAVE_FLINT)
1254 #elif defined(HAVE_NTL)
1256 #endif
1259 }
1260 else
1261 {
1262 WerrorS(
"expected system(\"rref\",<matrix>/<smatrix>)");
1264 }
1265 }
1266 else
1267 #endif
1268
1269 #ifdef HAVE_PCV
1270 if(strcmp(sys_cmd,"pcvLAddL")==0)
1271 {
1273 }
1274 else
1275 if(strcmp(sys_cmd,"pcvPMulL")==0)
1276 {
1278 }
1279 else
1280 if(strcmp(sys_cmd,"pcvMinDeg")==0)
1281 {
1283 }
1284 else
1285 if(strcmp(sys_cmd,"pcvP2CV")==0)
1286 {
1288 }
1289 else
1290 if(strcmp(sys_cmd,"pcvCV2P")==0)
1291 {
1293 }
1294 else
1295 if(strcmp(sys_cmd,"pcvDim")==0)
1296 {
1298 }
1299 else
1300 if(strcmp(sys_cmd,"pcvBasis")==0)
1301 {
1303 }
1304 else
1305 #endif
1306
1307 #ifdef HAVE_EIGENVAL
1308 if(strcmp(sys_cmd,"hessenberg")==0)
1309 {
1311 }
1312 else
1313 #endif
1314
1315 #ifdef HAVE_EIGENVAL
1316 if(strcmp(sys_cmd,"eigenvals")==0)
1317 {
1319 }
1320 else
1321 #endif
1322
1323 #ifdef HAVE_EIGENVAL
1324 if(strcmp(sys_cmd,"rowelim")==0)
1325 {
1327 }
1328 else
1329 #endif
1330
1331 #ifdef HAVE_EIGENVAL
1332 if(strcmp(sys_cmd,"rowcolswap")==0)
1333 {
1335 }
1336 else
1337 #endif
1338
1339 #ifdef HAVE_GMS
1340 if(strcmp(sys_cmd,"gmsnf")==0)
1341 {
1343 }
1344 else
1345 #endif
1346
1347 if(strcmp(sys_cmd,"contributors") == 0)
1348 {
1351 "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");
1353 }
1354 else
1355
1356 #ifdef HAVE_SPECTRUM
1357 if(strcmp(sys_cmd,"spectrum") == 0)
1358 {
1360 {
1363 }
1367 {
1370 }
1371 if(((
long)
h->next->Data())==1L)
1374 }
1375 else
1376
1377 if(strcmp(sys_cmd,"semic") == 0)
1378 {
1382 {
1383 if (
h->next->next==
NULL)
1385 else if (
h->next->next->Typ()==
INT_CMD)
1387 }
1389 }
1390 else
1391
1392 if(strcmp(sys_cmd,"spadd") == 0)
1393 {
1396 {
1398 }
1400 }
1401 else
1402
1403 if(strcmp(sys_cmd,"spmul") == 0)
1404 {
1407 {
1409 }
1411 }
1412 else
1413 #endif
1414
1415 #define HAVE_SHEAFCOH_TRICKS 1
1416
1417 #ifdef HAVE_SHEAFCOH_TRICKS
1418 if(strcmp(sys_cmd,"tensorModuleMult")==0)
1419 {
1421
1423 {
1424 int m = (int)( (
long)
h->Data() );
1425 ideal
M = (ideal)
h->next->Data();
1429 }
1431 }
1432 else
1433 #endif
1434
1435 #ifdef HAVE_PLURAL
1436 if (strcmp(sys_cmd, "twostd") == 0)
1437 {
1438 ideal I;
1440 {
1441 I=(ideal)
h->CopyD();
1447 }
1450 }
1451 else
1452 #endif
1453
1454 #ifdef HAVE_PLURAL
1455 if (strcmp(sys_cmd, "bracket") == 0)
1456 {
1459 {
1460 poly
p=(poly)
h->CopyD();
1462 poly q=(poly)
h->Data();
1466 }
1468 }
1469 else
1470 #endif
1471
1472 #ifdef HAVE_PLURAL
1473 if (strcmp(sys_cmd, "env")==0)
1474 {
1476 {
1477 ring r = (ring)
h->Data();
1481 }
1482 else
1483 {
1484 WerrorS(
"`system(\"env\",<ring>)` expected");
1486 }
1487 }
1488 else
1489 #endif
1490
1491 #ifdef HAVE_PLURAL
1492 if (strcmp(sys_cmd, "opp")==0)
1493 {
1495 {
1496 ring r=(ring)
h->Data();
1500 }
1501 else
1502 {
1503 WerrorS(
"`system(\"opp\",<ring>)` expected");
1505 }
1506 }
1507 else
1508 #endif
1509
1510 #ifdef HAVE_PLURAL
1511 if (strcmp(sys_cmd, "oppose")==0)
1512 {
1514 && (
h->next!=
NULL))
1515 {
1516 ring Rop = (ring)
h->Data();
1520 {
1525 }
1526 }
1527 else
1528 {
1529 WerrorS(
"`system(\"oppose\",<ring>,<poly>)` expected");
1531 }
1532 }
1533 else
1534 #endif
1535
1536 if(strcmp(sys_cmd,"sat")==0)
1537 {
1538 ideal I= (ideal)
h->Data();
1539 ideal J=(ideal)
h->next->Data();
1546 }
1547 else
1548
1549
1550 #ifdef HAVE_WALK
1551 #ifdef OWNW
1552 if (strcmp(sys_cmd, "walkNextWeight") == 0)
1553 {
1558 {
1559 Werror(
"system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1562 }
1563 res->data = (
void*) walkNextWeight(((
intvec*)
h->Data()),
1565 (ideal)
h->next->next->Data());
1566 if (
res->data ==
NULL ||
res->data == (
void*) 1L)
1567 {
1569 }
1570 else
1571 {
1573 }
1575 }
1576 else
1577 #endif
1578 #endif
1579
1580 #ifdef HAVE_WALK
1581 #ifdef OWNW
1582 if (strcmp(sys_cmd, "walkInitials") == 0)
1583 {
1585 {
1586 WerrorS(
"system(\"walkInitials\", ideal) expected");
1588 }
1589 res->data = (
void*) walkInitials((ideal)
h->Data());
1592 }
1593 else
1594 #endif
1595 #endif
1596
1597 #ifdef HAVE_WALK
1598 #ifdef WAIV
1599 if (strcmp(sys_cmd, "walkAddIntVec") == 0)
1600 {
1605 res->data = (
intvec*) walkAddIntVec(arg1, arg2);
1608 }
1609 else
1610 #endif
1611 #endif
1612
1613 #ifdef HAVE_WALK
1614 #ifdef MwaklNextWeight
1615 if (strcmp(sys_cmd, "MwalkNextWeight") == 0)
1616 {
1621 {
1622 Werror(
"system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1625 }
1628 ideal arg3 = (ideal)
h->next->next->Data();
1633 }
1634 else
1635 #endif
1636 #endif
1637
1638 #ifdef HAVE_WALK
1639 if(strcmp(sys_cmd, "Mivdp") == 0)
1640 {
1642 {
1643 WerrorS(
"system(\"Mivdp\", int) expected");
1645 }
1646 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1647 {
1648 Werror(
"system(\"Mivdp\" ...) intvecs not of length %d\n",
1651 }
1652 int arg1 = (int) ((
long)(
h->Data()));
1657 }
1658 else
1659 #endif
1660
1661 #ifdef HAVE_WALK
1662 if(strcmp(sys_cmd, "Mivlp") == 0)
1663 {
1665 {
1666 WerrorS(
"system(\"Mivlp\", int) expected");
1668 }
1669 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1670 {
1671 Werror(
"system(\"Mivlp\" ...) intvecs not of length %d\n",
1674 }
1675 int arg1 = (int) ((
long)(
h->Data()));
1680 }
1681 else
1682 #endif
1683
1684 #ifdef HAVE_WALK
1685 #ifdef MpDiv
1686 if(strcmp(sys_cmd, "MpDiv") == 0)
1687 {
1690 poly arg1 = (poly)
h->Data();
1691 poly arg2 = (poly)
h->next->Data();
1692 poly
result = MpDiv(arg1, arg2);
1696 }
1697 else
1698 #endif
1699 #endif
1700
1701 #ifdef HAVE_WALK
1702 #ifdef MpMult
1703 if(strcmp(sys_cmd, "MpMult") == 0)
1704 {
1707 poly arg1 = (poly)
h->Data();
1708 poly arg2 = (poly)
h->next->Data();
1709 poly
result = MpMult(arg1, arg2);
1713 }
1714 else
1715 #endif
1716 #endif
1717
1718 #ifdef HAVE_WALK
1719 if (strcmp(sys_cmd, "MivSame") == 0)
1720 {
1723
1724
1725
1726
1727
1728
1729
1730
1731
1734
1735
1736
1737
1738
1740 res->data = (
void*)(
long)
MivSame(arg1, arg2);
1742 }
1743 else
1744 #endif
1745
1746 #ifdef HAVE_WALK
1747 if (strcmp(sys_cmd, "M3ivSame") == 0)
1748 {
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1764
1765
1766
1767
1768
1770 res->data = (
void*)(
long)
M3ivSame(arg1, arg2, arg3);
1772 }
1773 else
1774 #endif
1775
1776 #ifdef HAVE_WALK
1777 if(strcmp(sys_cmd, "MwalkInitialForm") == 0)
1778 {
1782 {
1783 Werror(
"system \"MwalkInitialForm\"...) intvec not of length %d\n",
1786 }
1787 ideal
id = (ideal)
h->Data();
1793 }
1794 else
1795 #endif
1796
1797 #ifdef HAVE_WALK
1798
1799 if(strcmp(sys_cmd, "MivMatrixOrder") == 0)
1800 {
1802 {
1803 WerrorS(
"system(\"MivMatrixOrder\",intvec) expected");
1805 }
1811 }
1812 else
1813 #endif
1814
1815 #ifdef HAVE_WALK
1816 if(strcmp(sys_cmd, "MivMatrixOrderdp") == 0)
1817 {
1819 {
1820 WerrorS(
"system(\"MivMatrixOrderdp\",intvec) expected");
1822 }
1823 int arg1 = (int) ((
long)(
h->Data()));
1828 }
1829 else
1830 #endif
1831
1832 #ifdef HAVE_WALK
1833 if(strcmp(sys_cmd, "MPertVectors") == 0)
1834 {
1837 ideal arg1 = (ideal)
h->Data();
1839 int arg3 = (int) ((
long)(
h->next->next->Data()));
1844 }
1845 else
1846 #endif
1847
1848 #ifdef HAVE_WALK
1849 if(strcmp(sys_cmd, "MPertVectorslp") == 0)
1850 {
1853 ideal arg1 = (ideal)
h->Data();
1855 int arg3 = (int) ((
long)(
h->next->next->Data()));
1860 }
1861 else
1862 #endif
1863
1864 #ifdef HAVE_WALK
1865 if(strcmp(sys_cmd, "Mfpertvector") == 0)
1866 {
1869 ideal arg1 = (ideal)
h->Data();
1875 }
1876 else
1877 #endif
1878
1879 #ifdef HAVE_WALK
1880 if(strcmp(sys_cmd, "MivUnit") == 0)
1881 {
1884 int arg1 = (int) ((
long)(
h->Data()));
1889 }
1890 else
1891 #endif
1892
1893 #ifdef HAVE_WALK
1894 if(strcmp(sys_cmd, "MivWeightOrderlp") == 0)
1895 {
1903 }
1904 else
1905 #endif
1906
1907 #ifdef HAVE_WALK
1908 if(strcmp(sys_cmd, "MivWeightOrderdp") == 0)
1909 {
1911 {
1912 WerrorS(
"system(\"MivWeightOrderdp\",intvec) expected");
1914 }
1916
1921 }
1922 else
1923 #endif
1924
1925 #ifdef HAVE_WALK
1926 if(strcmp(sys_cmd, "MivMatrixOrderlp") == 0)
1927 {
1929 {
1930 WerrorS(
"system(\"MivMatrixOrderlp\",int) expected");
1932 }
1933 int arg1 = (int) ((
long)(
h->Data()));
1938 }
1939 else
1940 #endif
1941
1942 #ifdef HAVE_WALK
1943 if (strcmp(sys_cmd, "MkInterRedNextWeight") == 0)
1944 {
1949 {
1950 Werror(
"system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1953 }
1956 ideal arg3 = (ideal)
h->next->next->Data();
1961 }
1962 else
1963 #endif
1964
1965 #ifdef HAVE_WALK
1966 #ifdef MPertNextWeight
1967 if (strcmp(sys_cmd, "MPertNextWeight") == 0)
1968 {
1972 {
1973 Werror(
"system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1976 }
1978 ideal arg2 = (ideal)
h->next->Data();
1979 int arg3 = (int)
h->next->next->Data();
1984 }
1985 else
1986 #endif
1987 #endif
1988
1989 #ifdef HAVE_WALK
1990 #ifdef Mivperttarget
1991 if (strcmp(sys_cmd, "Mivperttarget") == 0)
1992 {
1995 ideal arg1 = (ideal)
h->Data();
1996 int arg2 = (int)
h->next->Data();
2001 }
2002 else
2003 #endif
2004 #endif
2005
2006 #ifdef HAVE_WALK
2007 if (strcmp(sys_cmd, "Mwalk") == 0)
2008 {
2013 {
2014 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d\n",
2017 }
2018 ideal arg1 = (ideal)
h->CopyD();
2021 ring arg4 = (ring)
h->next->next->next->Data();
2022 int arg5 = (int) (
long)
h->next->next->next->next->Data();
2023 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2024 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2028 }
2029 else
2030 #endif
2031
2032 #ifdef HAVE_WALK
2033 #ifdef MPWALK_ORIG
2034 if (strcmp(sys_cmd, "Mwalk") == 0)
2035 {
2042 {
2043 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2046 }
2047 ideal arg1 = (ideal)
h->Data();
2050 ring arg4 = (ring)
h->next->next->next->Data();
2051 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3,arg4);
2055 }
2056 else
2057 #else
2058 if (strcmp(sys_cmd, "Mpwalk") == 0)
2059 {
2062 if(((
intvec*)
h->next->next->next->Data())->length() !=
currRing->N &&
2064 {
2065 Werror(
"system(\"Mpwalk\" ...) intvecs not of length %d\n",
currRing->N);
2067 }
2068 ideal arg1 = (ideal)
h->Data();
2069 int arg2 = (int) (
long)
h->next->Data();
2070 int arg3 = (int) (
long)
h->next->next->Data();
2073 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2074 int arg7 = (int) (
long)
h->next->next->next->next->next->next->Data();
2075 int arg8 = (int) (
long)
h->next->next->next->next->next->next->next->Data();
2076 ideal
result = (ideal)
Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2080 }
2081 else
2082 #endif
2083 #endif
2084
2085 #ifdef HAVE_WALK
2086 if (strcmp(sys_cmd, "Mrwalk") == 0)
2087 {
2094 {
2095 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2098 }
2099 ideal arg1 = (ideal)
h->Data();
2102 int arg4 = (int)(
long)
h->next->next->next->Data();
2103 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2104 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2105 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2106 ideal
result = (ideal)
Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2110 }
2111 else
2112 #endif
2113
2114 #ifdef HAVE_WALK
2115 if (strcmp(sys_cmd, "MAltwalk1") == 0)
2116 {
2119 if (((
intvec*)
h->next->next->next->Data())->length() !=
currRing->N &&
2121 {
2122 Werror(
"system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2125 }
2126 ideal arg1 = (ideal)
h->Data();
2127 int arg2 = (int) ((
long)(
h->next->Data()));
2128 int arg3 = (int) ((
long)(
h->next->next->Data()));
2135 }
2136 else
2137 #endif
2138
2139 #ifdef HAVE_WALK
2140 #ifdef MFWALK_ALT
2141 if (strcmp(sys_cmd, "Mfwalk_alt") == 0)
2142 {
2147 {
2148 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2151 }
2152 ideal arg1 = (ideal)
h->Data();
2155 int arg4 = (int)
h->next->next->next->Data();
2156 ideal
result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2160 }
2161 else
2162 #endif
2163 #endif
2164
2165 #ifdef HAVE_WALK
2166 if (strcmp(sys_cmd, "Mfwalk") == 0)
2167 {
2172 {
2173 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2176 }
2177 ideal arg1 = (ideal)
h->Data();
2180 int arg4 = (int)(
long)
h->next->next->next->Data();
2181 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2182 ideal
result = (ideal)
Mfwalk(arg1, arg2, arg3, arg4, arg5);
2186 }
2187 else
2188 #endif
2189
2190 #ifdef HAVE_WALK
2191 if (strcmp(sys_cmd, "Mfrwalk") == 0)
2192 {
2195
2196
2197
2198
2199
2200
2201
2202
2207 {
2208 Werror(
"system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2211 }
2212
2213 ideal arg1 = (ideal)
h->Data();
2216 int arg4 = (int)(
long)
h->next->next->next->Data();
2217 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2218 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2219 ideal
result = (ideal)
Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2223 }
2224 else
2225
2226 if (strcmp(sys_cmd, "Mprwalk") == 0)
2227 {
2234 {
2235 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2238 }
2239 ideal arg1 = (ideal)
h->Data();
2242 int arg4 = (int)(
long)
h->next->next->next->Data();
2243 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2244 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2245 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2246 int arg8 = (int)(
long)
h->next->next->next->next->next->next->next->Data();
2247 int arg9 = (int)(
long)
h->next->next->next->next->next->next->next->next->Data();
2248 ideal
result = (ideal)
Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2252 }
2253 else
2254 #endif
2255
2256 #ifdef HAVE_WALK
2257 #ifdef TRAN_Orig
2258 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2259 {
2264 {
2265 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2268 }
2269 ideal arg1 = (ideal)
h->Data();
2276 }
2277 else
2278 #endif
2279 #endif
2280
2281 #ifdef HAVE_WALK
2282 if (strcmp(sys_cmd, "MAltwalk2") == 0)
2283 {
2288 {
2289 Werror(
"system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2292 }
2293 ideal arg1 = (ideal)
h->Data();
2300 }
2301 else
2302 #endif
2303
2304 #ifdef HAVE_WALK
2305 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2306 {
2311 {
2312 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2315 }
2316 ideal arg1 = (ideal)
h->Data();
2319 int arg4 = (int) ((
long)(
h->next->next->next->Data()));
2324 }
2325 else
2326 #endif
2327
2328 #if 0
2329 #ifdef HAVE_WALK
2330 if (strcmp(sys_cmd, "TranMrImprovwalk") == 0)
2331 {
2335 h->next->next->next ==
NULL ||
h->next->next->next->Typ() !=
INT_CMD ||
2336 h->next->next->next ==
NULL ||
h->next->next->next->next->Typ() !=
INT_CMD ||
2337 h->next->next->next ==
NULL ||
h->next->next->next->next->next->Typ() !=
INT_CMD)
2338 {
2339 WerrorS(
"system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2341 }
2344 {
2345 Werror(
"system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n",
currRing->N);
2347 }
2348 ideal arg1 = (ideal)
h->Data();
2351 int arg4 = (int)(
long)
h->next->next->next->Data();
2352 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2353 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2354 ideal
result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2358 }
2359 else
2360 #endif
2361 #endif
2362
2363 {
2364 #ifndef MAKE_DISTRIBUTION
2366 #else
2368 #endif
2369 }
2370 }
2372}
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)
const char * Tok2Cmdname(int tok)
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)
#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 kVerify(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)
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)