231{
233 {
234 const char *sys_cmd=(
char *)(args->
Data());
236
237
238
239 if (strcmp(sys_cmd, "nblocks") == 0)
240 {
241 ring r;
243 {
245 {
247 }
248 else
249 {
252 }
253 }
254 else
255 {
257 {
260 }
261 r = (ring)
h->Data();
262 }
266 }
267
268 if(strcmp(sys_cmd,"version")==0)
269 {
273 }
274 else
275
276 if(strcmp(sys_cmd,"alarm")==0)
277 {
279 {
280
281
282
283 struct itimerval t,o;
284 memset(&t,0,sizeof(t));
285 t.it_value.tv_sec =(unsigned)((
unsigned long)
h->Data());
286 setitimer(ITIMER_VIRTUAL,&t,&o);
288 }
289 else
291 }
292 else
293
294 if(strcmp(sys_cmd,"content")==0)
295 {
297 {
299 poly
p=(poly)
h->CopyD();
301 {
304 }
308 }
310 }
311 else
312
313 if(strcmp(sys_cmd,"cpu")==0)
314 {
315 #if 0
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;
323 #else
325 #endif
328 }
329 else
330
331 if(strcmp(sys_cmd,"executable")==0)
332 {
334 {
341 }
343 }
344 else
345
346 if(strcmp(sys_cmd,"flatten")==0)
347 {
349 {
353 }
354 else
356 }
357 else
358
359 if(strcmp(sys_cmd,"unflatten")==0)
360 {
363 {
367 }
369 }
370 else
371
372 if(strcmp(sys_cmd,"neworder")==0)
373 {
375 {
379 }
380 else
382 }
383 else
384
385
386 if(strcmp(sys_cmd,"nc_hilb") == 0)
387 {
392 int trunDegHs=0;
394 i = (ideal)
h->Data();
395 else
396 {
397 WerrorS(
"nc_Hilb:ideal expected");
399 }
402 lV = (int)(
long)
h->Data();
403 else
404 {
405 WerrorS(
"nc_Hilb:int expected");
407 }
410 {
411 if((
int)(
long)
h->Data() == 1)
413 else if((
int)(
long)
h->Data() == 2)
418 trunDegHs = (int)(
long)
h->Data();
420 }
422 {
423 WerrorS(
"nc_Hilb:int 1,2, total degree for the truncation, and a string for printing the details are expected");
425 }
426
429 }
430 else
431
432 if(strcmp(sys_cmd,"verifyGB")==0)
433 {
435 {
436 WerrorS(
"system(\"verifyGB\",<ideal>,..) expects a commutative ring");
438 }
441 {
442 Werror(
"expected system(\"verifyGB\",<ideal/module>), found <%s>",
Tok2Cmdname(
h->Typ()));
444 }
445 ideal F=(ideal)
h->Data();
446 #ifdef HAVE_VSPACE
448 if (cpus>1)
450 else
451 #endif
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 {
1027 {
1030 res->data=(
void*)(
long)
p;
1032 }
1034 }
1035 else
1036
1037 if (strcmp(sys_cmd,"reservedLink")==0)
1038 {
1043 }
1044 else
1045
1046 if (strcmp(sys_cmd,"install")==0)
1047 {
1050 {
1052 (
int)(
long)
h->next->next->next->Data(),
1054 }
1056 }
1057 else
1058
1059 if (strcmp(sys_cmd,"newstruct")==0)
1060 {
1063 {
1064 int id=0;
1065 char *n=(
char*)
h->Data();
1067 if (id>0)
1068 {
1071 {
1072 newstruct_desc desc=(newstruct_desc)bb->data;
1075 }
1076 else Werror(
"'%s' is not a newstruct",n);
1077 }
1078 else Werror(
"'%s' is not a blackbox object",n);
1079 }
1081 }
1082 else
1083
1084 if (strcmp(sys_cmd,"blackbox")==0)
1085 {
1088 }
1089 else
1090
1091 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1092 if (strcmp(sys_cmd, "absFact") == 0)
1093 {
1098 {
1102 int n= 0;
1109 l->m[0].data=(
void *)
f;
1111 l->m[1].data=(
void *)
v;
1113 l->m[2].data=(
void*) mipos;
1115 l->m[3].data=(
void*) (
long) n;
1116 res->data=(
void *)
l;
1118 }
1120 }
1121 else
1122 #endif
1123
1124 #ifdef HAVE_NTL
1125 if (strcmp(sys_cmd, "LLL") == 0)
1126 {
1128 {
1131 {
1134 }
1136 {
1139 }
1141 }
1143 }
1144 else
1145 #endif
1146
1147 #ifdef HAVE_FLINT
1148 #if __FLINT_RELEASE >= 20500
1149 if (strcmp(sys_cmd, "LLL_Flint") == 0)
1150 {
1152 {
1154 {
1157 {
1160 }
1162 {
1165 }
1167 }
1169 {
1170 WerrorS(
"matrix,int or bigint,int expected");
1172 }
1174 {
1175 if(((
int)((
long)(
h->next->Data())) != 0) && (
int)((
long)(
h->next->Data()) != 1))
1176 {
1177 WerrorS(
"int is different from 0, 1");
1179 }
1181 if((
long)(
h->next->Data()) == 0)
1182 {
1184 {
1187 }
1189 {
1192 }
1194 }
1195
1196 if((
long)(
h->next->Data()) == 1)
1197 {
1199 {
1202 for(
int i = 1;
i<=
m->rows();
i++)
1203 {
1206 }
1215 }
1217 {
1220 for(
int i = 1;
i<=
m->rows();
i++)
1230 }
1232 }
1233 }
1234
1235 }
1237 }
1238 else
1239 #endif
1240 #endif
1241
1242 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1243 if(strcmp(sys_cmd,"rref")==0)
1244 {
1248 {
1250 #if defined(HAVE_FLINT)
1252 #elif defined(HAVE_NTL)
1254 #endif
1257 }
1259 {
1260 ideal
M=(ideal)
h->Data();
1261 #if defined(HAVE_FLINT)
1263 #elif defined(HAVE_NTL)
1265 #endif
1268 }
1269 else
1270 {
1271 WerrorS(
"expected system(\"rref\",<matrix>/<smatrix>)");
1273 }
1274 }
1275 else
1276 #endif
1277
1278 #ifdef HAVE_PCV
1279 if(strcmp(sys_cmd,"pcvLAddL")==0)
1280 {
1282 }
1283 else
1284 if(strcmp(sys_cmd,"pcvPMulL")==0)
1285 {
1287 }
1288 else
1289 if(strcmp(sys_cmd,"pcvMinDeg")==0)
1290 {
1292 }
1293 else
1294 if(strcmp(sys_cmd,"pcvP2CV")==0)
1295 {
1297 }
1298 else
1299 if(strcmp(sys_cmd,"pcvCV2P")==0)
1300 {
1302 }
1303 else
1304 if(strcmp(sys_cmd,"pcvDim")==0)
1305 {
1307 }
1308 else
1309 if(strcmp(sys_cmd,"pcvBasis")==0)
1310 {
1312 }
1313 else
1314 #endif
1315
1316 #ifdef HAVE_EIGENVAL
1317 if(strcmp(sys_cmd,"hessenberg")==0)
1318 {
1320 }
1321 else
1322 #endif
1323
1324 #ifdef HAVE_EIGENVAL
1325 if(strcmp(sys_cmd,"eigenvals")==0)
1326 {
1328 }
1329 else
1330 #endif
1331
1332 #ifdef HAVE_EIGENVAL
1333 if(strcmp(sys_cmd,"rowelim")==0)
1334 {
1336 }
1337 else
1338 #endif
1339
1340 #ifdef HAVE_EIGENVAL
1341 if(strcmp(sys_cmd,"rowcolswap")==0)
1342 {
1344 }
1345 else
1346 #endif
1347
1348 #ifdef HAVE_GMS
1349 if(strcmp(sys_cmd,"gmsnf")==0)
1350 {
1352 }
1353 else
1354 #endif
1355
1356 if(strcmp(sys_cmd,"contributors") == 0)
1357 {
1360 "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");
1362 }
1363 else
1364
1365 #ifdef HAVE_SPECTRUM
1366 if(strcmp(sys_cmd,"spectrum") == 0)
1367 {
1369 {
1372 }
1376 {
1379 }
1380 if(((
long)
h->next->Data())==1L)
1383 }
1384 else
1385
1386 if(strcmp(sys_cmd,"semic") == 0)
1387 {
1391 {
1392 if (
h->next->next==
NULL)
1394 else if (
h->next->next->Typ()==
INT_CMD)
1396 }
1398 }
1399 else
1400
1401 if(strcmp(sys_cmd,"spadd") == 0)
1402 {
1405 {
1407 }
1409 }
1410 else
1411
1412 if(strcmp(sys_cmd,"spmul") == 0)
1413 {
1416 {
1418 }
1420 }
1421 else
1422 #endif
1423
1424 #define HAVE_SHEAFCOH_TRICKS 1
1425
1426 #ifdef HAVE_SHEAFCOH_TRICKS
1427 if(strcmp(sys_cmd,"tensorModuleMult")==0)
1428 {
1430
1432 {
1433 int m = (int)( (
long)
h->Data() );
1434 ideal
M = (ideal)
h->next->Data();
1438 }
1440 }
1441 else
1442 #endif
1443
1444 #ifdef HAVE_PLURAL
1445 if (strcmp(sys_cmd, "twostd") == 0)
1446 {
1447 ideal I;
1449 {
1450 I=(ideal)
h->CopyD();
1456 }
1459 }
1460 else
1461 #endif
1462
1463 #ifdef HAVE_PLURAL
1464 if (strcmp(sys_cmd, "bracket") == 0)
1465 {
1468 {
1469 poly
p=(poly)
h->CopyD();
1471 poly q=(poly)
h->Data();
1475 }
1477 }
1478 else
1479 #endif
1480
1481 #ifdef HAVE_PLURAL
1482 if (strcmp(sys_cmd, "env")==0)
1483 {
1485 {
1486 ring r = (ring)
h->Data();
1490 }
1491 else
1492 {
1493 WerrorS(
"`system(\"env\",<ring>)` expected");
1495 }
1496 }
1497 else
1498 #endif
1499
1500 #ifdef HAVE_PLURAL
1501 if (strcmp(sys_cmd, "opp")==0)
1502 {
1504 {
1505 ring r=(ring)
h->Data();
1509 }
1510 else
1511 {
1512 WerrorS(
"`system(\"opp\",<ring>)` expected");
1514 }
1515 }
1516 else
1517 #endif
1518
1519 #ifdef HAVE_PLURAL
1520 if (strcmp(sys_cmd, "oppose")==0)
1521 {
1523 && (
h->next!=
NULL))
1524 {
1525 ring Rop = (ring)
h->Data();
1529 {
1534 }
1535 }
1536 else
1537 {
1538 WerrorS(
"`system(\"oppose\",<ring>,<poly>)` expected");
1540 }
1541 }
1542 else
1543 #endif
1544
1545 if(strcmp(sys_cmd,"sat")==0)
1546 {
1547 ideal I= (ideal)
h->Data();
1548 ideal J=(ideal)
h->next->Data();
1555 }
1556 else
1557
1558
1559 #ifdef HAVE_WALK
1560 #ifdef OWNW
1561 if (strcmp(sys_cmd, "walkNextWeight") == 0)
1562 {
1567 {
1568 Werror(
"system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1571 }
1572 res->data = (
void*) walkNextWeight(((
intvec*)
h->Data()),
1574 (ideal)
h->next->next->Data());
1575 if (
res->data ==
NULL ||
res->data == (
void*) 1L)
1576 {
1578 }
1579 else
1580 {
1582 }
1584 }
1585 else
1586 #endif
1587 #endif
1588
1589 #ifdef HAVE_WALK
1590 #ifdef OWNW
1591 if (strcmp(sys_cmd, "walkInitials") == 0)
1592 {
1594 {
1595 WerrorS(
"system(\"walkInitials\", ideal) expected");
1597 }
1598 res->data = (
void*) walkInitials((ideal)
h->Data());
1601 }
1602 else
1603 #endif
1604 #endif
1605
1606 #ifdef HAVE_WALK
1607 #ifdef WAIV
1608 if (strcmp(sys_cmd, "walkAddIntVec") == 0)
1609 {
1614 res->data = (
intvec*) walkAddIntVec(arg1, arg2);
1617 }
1618 else
1619 #endif
1620 #endif
1621
1622 #ifdef HAVE_WALK
1623 #ifdef MwaklNextWeight
1624 if (strcmp(sys_cmd, "MwalkNextWeight") == 0)
1625 {
1630 {
1631 Werror(
"system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1634 }
1637 ideal arg3 = (ideal)
h->next->next->Data();
1642 }
1643 else
1644 #endif
1645 #endif
1646
1647 #ifdef HAVE_WALK
1648 if(strcmp(sys_cmd, "Mivdp") == 0)
1649 {
1651 {
1652 WerrorS(
"system(\"Mivdp\", int) expected");
1654 }
1655 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1656 {
1657 Werror(
"system(\"Mivdp\" ...) intvecs not of length %d\n",
1660 }
1661 int arg1 = (int) ((
long)(
h->Data()));
1666 }
1667 else
1668 #endif
1669
1670 #ifdef HAVE_WALK
1671 if(strcmp(sys_cmd, "Mivlp") == 0)
1672 {
1674 {
1675 WerrorS(
"system(\"Mivlp\", int) expected");
1677 }
1678 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1679 {
1680 Werror(
"system(\"Mivlp\" ...) intvecs not of length %d\n",
1683 }
1684 int arg1 = (int) ((
long)(
h->Data()));
1689 }
1690 else
1691 #endif
1692
1693 #ifdef HAVE_WALK
1694 #ifdef MpDiv
1695 if(strcmp(sys_cmd, "MpDiv") == 0)
1696 {
1699 poly arg1 = (poly)
h->Data();
1700 poly arg2 = (poly)
h->next->Data();
1701 poly
result = MpDiv(arg1, arg2);
1705 }
1706 else
1707 #endif
1708 #endif
1709
1710 #ifdef HAVE_WALK
1711 #ifdef MpMult
1712 if(strcmp(sys_cmd, "MpMult") == 0)
1713 {
1716 poly arg1 = (poly)
h->Data();
1717 poly arg2 = (poly)
h->next->Data();
1718 poly
result = MpMult(arg1, arg2);
1722 }
1723 else
1724 #endif
1725 #endif
1726
1727 #ifdef HAVE_WALK
1728 if (strcmp(sys_cmd, "MivSame") == 0)
1729 {
1732
1733
1734
1735
1736
1737
1738
1739
1740
1743
1744
1745
1746
1747
1749 res->data = (
void*)(
long)
MivSame(arg1, arg2);
1751 }
1752 else
1753 #endif
1754
1755 #ifdef HAVE_WALK
1756 if (strcmp(sys_cmd, "M3ivSame") == 0)
1757 {
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1773
1774
1775
1776
1777
1779 res->data = (
void*)(
long)
M3ivSame(arg1, arg2, arg3);
1781 }
1782 else
1783 #endif
1784
1785 #ifdef HAVE_WALK
1786 if(strcmp(sys_cmd, "MwalkInitialForm") == 0)
1787 {
1791 {
1792 Werror(
"system \"MwalkInitialForm\"...) intvec not of length %d\n",
1795 }
1796 ideal
id = (ideal)
h->Data();
1802 }
1803 else
1804 #endif
1805
1806 #ifdef HAVE_WALK
1807
1808 if(strcmp(sys_cmd, "MivMatrixOrder") == 0)
1809 {
1811 {
1812 WerrorS(
"system(\"MivMatrixOrder\",intvec) expected");
1814 }
1820 }
1821 else
1822 #endif
1823
1824 #ifdef HAVE_WALK
1825 if(strcmp(sys_cmd, "MivMatrixOrderdp") == 0)
1826 {
1828 {
1829 WerrorS(
"system(\"MivMatrixOrderdp\",intvec) expected");
1831 }
1832 int arg1 = (int) ((
long)(
h->Data()));
1837 }
1838 else
1839 #endif
1840
1841 #ifdef HAVE_WALK
1842 if(strcmp(sys_cmd, "MPertVectors") == 0)
1843 {
1846 ideal arg1 = (ideal)
h->Data();
1848 int arg3 = (int) ((
long)(
h->next->next->Data()));
1853 }
1854 else
1855 #endif
1856
1857 #ifdef HAVE_WALK
1858 if(strcmp(sys_cmd, "MPertVectorslp") == 0)
1859 {
1862 ideal arg1 = (ideal)
h->Data();
1864 int arg3 = (int) ((
long)(
h->next->next->Data()));
1869 }
1870 else
1871 #endif
1872
1873 #ifdef HAVE_WALK
1874 if(strcmp(sys_cmd, "Mfpertvector") == 0)
1875 {
1878 ideal arg1 = (ideal)
h->Data();
1884 }
1885 else
1886 #endif
1887
1888 #ifdef HAVE_WALK
1889 if(strcmp(sys_cmd, "MivUnit") == 0)
1890 {
1893 int arg1 = (int) ((
long)(
h->Data()));
1898 }
1899 else
1900 #endif
1901
1902 #ifdef HAVE_WALK
1903 if(strcmp(sys_cmd, "MivWeightOrderlp") == 0)
1904 {
1912 }
1913 else
1914 #endif
1915
1916 #ifdef HAVE_WALK
1917 if(strcmp(sys_cmd, "MivWeightOrderdp") == 0)
1918 {
1920 {
1921 WerrorS(
"system(\"MivWeightOrderdp\",intvec) expected");
1923 }
1925
1930 }
1931 else
1932 #endif
1933
1934 #ifdef HAVE_WALK
1935 if(strcmp(sys_cmd, "MivMatrixOrderlp") == 0)
1936 {
1938 {
1939 WerrorS(
"system(\"MivMatrixOrderlp\",int) expected");
1941 }
1942 int arg1 = (int) ((
long)(
h->Data()));
1947 }
1948 else
1949 #endif
1950
1951 #ifdef HAVE_WALK
1952 if (strcmp(sys_cmd, "MkInterRedNextWeight") == 0)
1953 {
1958 {
1959 Werror(
"system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1962 }
1965 ideal arg3 = (ideal)
h->next->next->Data();
1970 }
1971 else
1972 #endif
1973
1974 #ifdef HAVE_WALK
1975 #ifdef MPertNextWeight
1976 if (strcmp(sys_cmd, "MPertNextWeight") == 0)
1977 {
1981 {
1982 Werror(
"system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1985 }
1987 ideal arg2 = (ideal)
h->next->Data();
1988 int arg3 = (int)
h->next->next->Data();
1993 }
1994 else
1995 #endif
1996 #endif
1997
1998 #ifdef HAVE_WALK
1999 #ifdef Mivperttarget
2000 if (strcmp(sys_cmd, "Mivperttarget") == 0)
2001 {
2004 ideal arg1 = (ideal)
h->Data();
2005 int arg2 = (int)
h->next->Data();
2010 }
2011 else
2012 #endif
2013 #endif
2014
2015 #ifdef HAVE_WALK
2016 if (strcmp(sys_cmd, "Mwalk") == 0)
2017 {
2022 {
2023 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d\n",
2026 }
2027 ideal arg1 = (ideal)
h->CopyD();
2030 ring arg4 = (ring)
h->next->next->next->Data();
2031 int arg5 = (int) (
long)
h->next->next->next->next->Data();
2032 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2033 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2037 }
2038 else
2039 #endif
2040
2041 #ifdef HAVE_WALK
2042 #ifdef MPWALK_ORIG
2043 if (strcmp(sys_cmd, "Mwalk") == 0)
2044 {
2051 {
2052 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2055 }
2056 ideal arg1 = (ideal)
h->Data();
2059 ring arg4 = (ring)
h->next->next->next->Data();
2060 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3,arg4);
2064 }
2065 else
2066 #else
2067 if (strcmp(sys_cmd, "Mpwalk") == 0)
2068 {
2073 {
2074 Werror(
"system(\"Mpwalk\" ...) intvecs not of length %d\n",
currRing->N);
2076 }
2077 ideal arg1 = (ideal)
h->Data();
2078 int arg2 = (int) (
long)
h->next->Data();
2079 int arg3 = (int) (
long)
h->next->next->Data();
2082 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2083 int arg7 = (int) (
long)
h->next->next->next->next->next->next->Data();
2084 int arg8 = (int) (
long)
h->next->next->next->next->next->next->next->Data();
2085 ideal
result = (ideal)
Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2089 }
2090 else
2091 #endif
2092 #endif
2093
2094 #ifdef HAVE_WALK
2095 if (strcmp(sys_cmd, "Mrwalk") == 0)
2096 {
2103 {
2104 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2107 }
2108 ideal arg1 = (ideal)
h->Data();
2111 int arg4 = (int)(
long)
h->next->next->next->Data();
2112 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2113 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2114 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2115 ideal
result = (ideal)
Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2119 }
2120 else
2121 #endif
2122
2123 #ifdef HAVE_WALK
2124 if (strcmp(sys_cmd, "MAltwalk1") == 0)
2125 {
2130 {
2131 Werror(
"system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2134 }
2135 ideal arg1 = (ideal)
h->Data();
2136 int arg2 = (int) ((
long)(
h->next->Data()));
2137 int arg3 = (int) ((
long)(
h->next->next->Data()));
2144 }
2145 else
2146 #endif
2147
2148 #ifdef HAVE_WALK
2149 #ifdef MFWALK_ALT
2150 if (strcmp(sys_cmd, "Mfwalk_alt") == 0)
2151 {
2156 {
2157 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2160 }
2161 ideal arg1 = (ideal)
h->Data();
2164 int arg4 = (int)
h->next->next->next->Data();
2165 ideal
result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2169 }
2170 else
2171 #endif
2172 #endif
2173
2174 #ifdef HAVE_WALK
2175 if (strcmp(sys_cmd, "Mfwalk") == 0)
2176 {
2181 {
2182 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2185 }
2186 ideal arg1 = (ideal)
h->Data();
2189 int arg4 = (int)(
long)
h->next->next->next->Data();
2190 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2191 ideal
result = (ideal)
Mfwalk(arg1, arg2, arg3, arg4, arg5);
2195 }
2196 else
2197 #endif
2198
2199 #ifdef HAVE_WALK
2200 if (strcmp(sys_cmd, "Mfrwalk") == 0)
2201 {
2204
2205
2206
2207
2208
2209
2210
2211
2216 {
2217 Werror(
"system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2220 }
2221
2222 ideal arg1 = (ideal)
h->Data();
2225 int arg4 = (int)(
long)
h->next->next->next->Data();
2226 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2227 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2228 ideal
result = (ideal)
Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2232 }
2233 else
2234
2235 if (strcmp(sys_cmd, "Mprwalk") == 0)
2236 {
2243 {
2244 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2247 }
2248 ideal arg1 = (ideal)
h->Data();
2251 int arg4 = (int)(
long)
h->next->next->next->Data();
2252 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2253 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2254 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2255 int arg8 = (int)(
long)
h->next->next->next->next->next->next->next->Data();
2256 int arg9 = (int)(
long)
h->next->next->next->next->next->next->next->next->Data();
2257 ideal
result = (ideal)
Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2261 }
2262 else
2263 #endif
2264
2265 #ifdef HAVE_WALK
2266 #ifdef TRAN_Orig
2267 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2268 {
2273 {
2274 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2277 }
2278 ideal arg1 = (ideal)
h->Data();
2285 }
2286 else
2287 #endif
2288 #endif
2289
2290 #ifdef HAVE_WALK
2291 if (strcmp(sys_cmd, "MAltwalk2") == 0)
2292 {
2297 {
2298 Werror(
"system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2301 }
2302 ideal arg1 = (ideal)
h->Data();
2309 }
2310 else
2311 #endif
2312
2313 #ifdef HAVE_WALK
2314 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2315 {
2320 {
2321 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2324 }
2325 ideal arg1 = (ideal)
h->Data();
2328 int arg4 = (int) ((
long)(
h->next->next->next->Data()));
2333 }
2334 else
2335 #endif
2336
2337 #if 0
2338 #ifdef HAVE_WALK
2339 if (strcmp(sys_cmd, "TranMrImprovwalk") == 0)
2340 {
2344 h->next->next->next ==
NULL ||
h->next->next->next->Typ() !=
INT_CMD ||
2345 h->next->next->next ==
NULL ||
h->next->next->next->next->Typ() !=
INT_CMD ||
2346 h->next->next->next ==
NULL ||
h->next->next->next->next->next->Typ() !=
INT_CMD)
2347 {
2348 WerrorS(
"system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2350 }
2353 {
2354 Werror(
"system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n",
currRing->N);
2356 }
2357 ideal arg1 = (ideal)
h->Data();
2360 int arg4 = (int)(
long)
h->next->next->next->Data();
2361 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2362 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2363 ideal
result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2367 }
2368 else
2369 #endif
2370 #endif
2371
2372 {
2373 #ifndef MAKE_DISTRIBUTION
2375 #else
2377 #endif
2378 }
2379 }
2381}
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)
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)