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 {
1032 {
1035 res->data=(
void*)(
long)
p;
1037 }
1039 }
1040 else
1041
1042 if (strcmp(sys_cmd,"reservedLink")==0)
1043 {
1048 }
1049 else
1050
1051 if (strcmp(sys_cmd,"install")==0)
1052 {
1055 {
1057 (
int)(
long)
h->next->next->next->Data(),
1059 }
1061 }
1062 else
1063
1064 if (strcmp(sys_cmd,"newstruct")==0)
1065 {
1068 {
1069 int id=0;
1070 char *n=(
char*)
h->Data();
1072 if (id>0)
1073 {
1076 {
1077 newstruct_desc desc=(newstruct_desc)bb->data;
1080 }
1081 else Werror(
"'%s' is not a newstruct",n);
1082 }
1083 else Werror(
"'%s' is not a blackbox object",n);
1084 }
1086 }
1087 else
1088
1089 if (strcmp(sys_cmd,"blackbox")==0)
1090 {
1093 }
1094 else
1095
1096 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1097 if (strcmp(sys_cmd, "absFact") == 0)
1098 {
1103 {
1107 int n= 0;
1114 l->m[0].data=(
void *)
f;
1116 l->m[1].data=(
void *)
v;
1118 l->m[2].data=(
void*) mipos;
1120 l->m[3].data=(
void*) (
long) n;
1121 res->data=(
void *)
l;
1123 }
1125 }
1126 else
1127 #endif
1128
1129 #ifdef HAVE_NTL
1130 if (strcmp(sys_cmd, "LLL") == 0)
1131 {
1133 {
1136 {
1139 }
1141 {
1144 }
1146 }
1148 }
1149 else
1150 #endif
1151
1152 #ifdef HAVE_FLINT
1153 #if __FLINT_RELEASE >= 20500
1154 if (strcmp(sys_cmd, "LLL_Flint") == 0)
1155 {
1157 {
1159 {
1162 {
1165 }
1167 {
1170 }
1172 }
1174 {
1175 WerrorS(
"matrix,int or bigint,int expected");
1177 }
1179 {
1180 if(((
int)((
long)(
h->next->Data())) != 0) && (
int)((
long)(
h->next->Data()) != 1))
1181 {
1182 WerrorS(
"int is different from 0, 1");
1184 }
1186 if((
long)(
h->next->Data()) == 0)
1187 {
1189 {
1192 }
1194 {
1197 }
1199 }
1200
1201 if((
long)(
h->next->Data()) == 1)
1202 {
1204 {
1207 for(
int i = 1;
i<=
m->rows();
i++)
1208 {
1211 }
1220 }
1222 {
1225 for(
int i = 1;
i<=
m->rows();
i++)
1235 }
1237 }
1238 }
1239
1240 }
1242 }
1243 else
1244 #endif
1245 #endif
1246
1247 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1248 if(strcmp(sys_cmd,"rref")==0)
1249 {
1253 {
1255 #if defined(HAVE_FLINT)
1257 #elif defined(HAVE_NTL)
1259 #endif
1262 }
1264 {
1265 ideal
M=(ideal)
h->Data();
1266 #if defined(HAVE_FLINT)
1268 #elif defined(HAVE_NTL)
1270 #endif
1273 }
1274 else
1275 {
1276 WerrorS(
"expected system(\"rref\",<matrix>/<smatrix>)");
1278 }
1279 }
1280 else
1281 #endif
1282
1283 #ifdef HAVE_PCV
1284 if(strcmp(sys_cmd,"pcvLAddL")==0)
1285 {
1287 }
1288 else
1289 if(strcmp(sys_cmd,"pcvPMulL")==0)
1290 {
1292 }
1293 else
1294 if(strcmp(sys_cmd,"pcvMinDeg")==0)
1295 {
1297 }
1298 else
1299 if(strcmp(sys_cmd,"pcvP2CV")==0)
1300 {
1302 }
1303 else
1304 if(strcmp(sys_cmd,"pcvCV2P")==0)
1305 {
1307 }
1308 else
1309 if(strcmp(sys_cmd,"pcvDim")==0)
1310 {
1312 }
1313 else
1314 if(strcmp(sys_cmd,"pcvBasis")==0)
1315 {
1317 }
1318 else
1319 #endif
1320
1321 #ifdef HAVE_EIGENVAL
1322 if(strcmp(sys_cmd,"hessenberg")==0)
1323 {
1325 }
1326 else
1327 #endif
1328
1329 #ifdef HAVE_EIGENVAL
1330 if(strcmp(sys_cmd,"eigenvals")==0)
1331 {
1333 }
1334 else
1335 #endif
1336
1337 #ifdef HAVE_EIGENVAL
1338 if(strcmp(sys_cmd,"rowelim")==0)
1339 {
1341 }
1342 else
1343 #endif
1344
1345 #ifdef HAVE_EIGENVAL
1346 if(strcmp(sys_cmd,"rowcolswap")==0)
1347 {
1349 }
1350 else
1351 #endif
1352
1353 #ifdef HAVE_GMS
1354 if(strcmp(sys_cmd,"gmsnf")==0)
1355 {
1357 }
1358 else
1359 #endif
1360
1361 if(strcmp(sys_cmd,"contributors") == 0)
1362 {
1365 "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");
1367 }
1368 else
1369
1370 #ifdef HAVE_SPECTRUM
1371 if(strcmp(sys_cmd,"spectrum") == 0)
1372 {
1374 {
1377 }
1381 {
1384 }
1385 if(((
long)
h->next->Data())==1L)
1388 }
1389 else
1390
1391 if(strcmp(sys_cmd,"semic") == 0)
1392 {
1396 {
1397 if (
h->next->next==
NULL)
1399 else if (
h->next->next->Typ()==
INT_CMD)
1401 }
1403 }
1404 else
1405
1406 if(strcmp(sys_cmd,"spadd") == 0)
1407 {
1410 {
1412 }
1414 }
1415 else
1416
1417 if(strcmp(sys_cmd,"spmul") == 0)
1418 {
1421 {
1423 }
1425 }
1426 else
1427 #endif
1428
1429 #define HAVE_SHEAFCOH_TRICKS 1
1430
1431 #ifdef HAVE_SHEAFCOH_TRICKS
1432 if(strcmp(sys_cmd,"tensorModuleMult")==0)
1433 {
1435
1437 {
1438 int m = (int)( (
long)
h->Data() );
1439 ideal
M = (ideal)
h->next->Data();
1443 }
1445 }
1446 else
1447 #endif
1448
1449 #ifdef HAVE_PLURAL
1450 if (strcmp(sys_cmd, "twostd") == 0)
1451 {
1452 ideal I;
1454 {
1455 I=(ideal)
h->CopyD();
1461 }
1464 }
1465 else
1466 #endif
1467
1468 #ifdef HAVE_PLURAL
1469 if (strcmp(sys_cmd, "bracket") == 0)
1470 {
1473 {
1474 poly
p=(poly)
h->CopyD();
1476 poly q=(poly)
h->Data();
1480 }
1482 }
1483 else
1484 #endif
1485
1486 #ifdef HAVE_PLURAL
1487 if (strcmp(sys_cmd, "env")==0)
1488 {
1490 {
1491 ring r = (ring)
h->Data();
1495 }
1496 else
1497 {
1498 WerrorS(
"`system(\"env\",<ring>)` expected");
1500 }
1501 }
1502 else
1503 #endif
1504
1505 #ifdef HAVE_PLURAL
1506 if (strcmp(sys_cmd, "opp")==0)
1507 {
1509 {
1510 ring r=(ring)
h->Data();
1514 }
1515 else
1516 {
1517 WerrorS(
"`system(\"opp\",<ring>)` expected");
1519 }
1520 }
1521 else
1522 #endif
1523
1524 #ifdef HAVE_PLURAL
1525 if (strcmp(sys_cmd, "oppose")==0)
1526 {
1528 && (
h->next!=
NULL))
1529 {
1530 ring Rop = (ring)
h->Data();
1534 {
1539 }
1540 }
1541 else
1542 {
1543 WerrorS(
"`system(\"oppose\",<ring>,<poly>)` expected");
1545 }
1546 }
1547 else
1548 #endif
1549
1550
1551 #ifdef HAVE_WALK
1552 #ifdef OWNW
1553 if (strcmp(sys_cmd, "walkNextWeight") == 0)
1554 {
1559 {
1560 Werror(
"system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1563 }
1564 res->data = (
void*) walkNextWeight(((
intvec*)
h->Data()),
1566 (ideal)
h->next->next->Data());
1567 if (
res->data ==
NULL ||
res->data == (
void*) 1L)
1568 {
1570 }
1571 else
1572 {
1574 }
1576 }
1577 else
1578 #endif
1579 #endif
1580
1581 #ifdef HAVE_WALK
1582 #ifdef OWNW
1583 if (strcmp(sys_cmd, "walkInitials") == 0)
1584 {
1586 {
1587 WerrorS(
"system(\"walkInitials\", ideal) expected");
1589 }
1590 res->data = (
void*) walkInitials((ideal)
h->Data());
1593 }
1594 else
1595 #endif
1596 #endif
1597
1598 #ifdef HAVE_WALK
1599 #ifdef WAIV
1600 if (strcmp(sys_cmd, "walkAddIntVec") == 0)
1601 {
1606 res->data = (
intvec*) walkAddIntVec(arg1, arg2);
1609 }
1610 else
1611 #endif
1612 #endif
1613
1614 #ifdef HAVE_WALK
1615 #ifdef MwaklNextWeight
1616 if (strcmp(sys_cmd, "MwalkNextWeight") == 0)
1617 {
1622 {
1623 Werror(
"system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1626 }
1629 ideal arg3 = (ideal)
h->next->next->Data();
1634 }
1635 else
1636 #endif
1637 #endif
1638
1639 #ifdef HAVE_WALK
1640 if(strcmp(sys_cmd, "Mivdp") == 0)
1641 {
1643 {
1644 WerrorS(
"system(\"Mivdp\", int) expected");
1646 }
1647 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1648 {
1649 Werror(
"system(\"Mivdp\" ...) intvecs not of length %d\n",
1652 }
1653 int arg1 = (int) ((
long)(
h->Data()));
1658 }
1659 else
1660 #endif
1661
1662 #ifdef HAVE_WALK
1663 if(strcmp(sys_cmd, "Mivlp") == 0)
1664 {
1666 {
1667 WerrorS(
"system(\"Mivlp\", int) expected");
1669 }
1670 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1671 {
1672 Werror(
"system(\"Mivlp\" ...) intvecs not of length %d\n",
1675 }
1676 int arg1 = (int) ((
long)(
h->Data()));
1681 }
1682 else
1683 #endif
1684
1685 #ifdef HAVE_WALK
1686 #ifdef MpDiv
1687 if(strcmp(sys_cmd, "MpDiv") == 0)
1688 {
1691 poly arg1 = (poly)
h->Data();
1692 poly arg2 = (poly)
h->next->Data();
1693 poly
result = MpDiv(arg1, arg2);
1697 }
1698 else
1699 #endif
1700 #endif
1701
1702 #ifdef HAVE_WALK
1703 #ifdef MpMult
1704 if(strcmp(sys_cmd, "MpMult") == 0)
1705 {
1708 poly arg1 = (poly)
h->Data();
1709 poly arg2 = (poly)
h->next->Data();
1710 poly
result = MpMult(arg1, arg2);
1714 }
1715 else
1716 #endif
1717 #endif
1718
1719 #ifdef HAVE_WALK
1720 if (strcmp(sys_cmd, "MivSame") == 0)
1721 {
1724
1725
1726
1727
1728
1729
1730
1731
1732
1735
1736
1737
1738
1739
1741 res->data = (
void*)(
long)
MivSame(arg1, arg2);
1743 }
1744 else
1745 #endif
1746
1747 #ifdef HAVE_WALK
1748 if (strcmp(sys_cmd, "M3ivSame") == 0)
1749 {
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1765
1766
1767
1768
1769
1771 res->data = (
void*)(
long)
M3ivSame(arg1, arg2, arg3);
1773 }
1774 else
1775 #endif
1776
1777 #ifdef HAVE_WALK
1778 if(strcmp(sys_cmd, "MwalkInitialForm") == 0)
1779 {
1783 {
1784 Werror(
"system \"MwalkInitialForm\"...) intvec not of length %d\n",
1787 }
1788 ideal
id = (ideal)
h->Data();
1794 }
1795 else
1796 #endif
1797
1798 #ifdef HAVE_WALK
1799
1800 if(strcmp(sys_cmd, "MivMatrixOrder") == 0)
1801 {
1803 {
1804 WerrorS(
"system(\"MivMatrixOrder\",intvec) expected");
1806 }
1812 }
1813 else
1814 #endif
1815
1816 #ifdef HAVE_WALK
1817 if(strcmp(sys_cmd, "MivMatrixOrderdp") == 0)
1818 {
1820 {
1821 WerrorS(
"system(\"MivMatrixOrderdp\",intvec) expected");
1823 }
1824 int arg1 = (int) ((
long)(
h->Data()));
1829 }
1830 else
1831 #endif
1832
1833 #ifdef HAVE_WALK
1834 if(strcmp(sys_cmd, "MPertVectors") == 0)
1835 {
1838 ideal arg1 = (ideal)
h->Data();
1840 int arg3 = (int) ((
long)(
h->next->next->Data()));
1845 }
1846 else
1847 #endif
1848
1849 #ifdef HAVE_WALK
1850 if(strcmp(sys_cmd, "MPertVectorslp") == 0)
1851 {
1854 ideal arg1 = (ideal)
h->Data();
1856 int arg3 = (int) ((
long)(
h->next->next->Data()));
1861 }
1862 else
1863 #endif
1864
1865 #ifdef HAVE_WALK
1866 if(strcmp(sys_cmd, "Mfpertvector") == 0)
1867 {
1870 ideal arg1 = (ideal)
h->Data();
1876 }
1877 else
1878 #endif
1879
1880 #ifdef HAVE_WALK
1881 if(strcmp(sys_cmd, "MivUnit") == 0)
1882 {
1885 int arg1 = (int) ((
long)(
h->Data()));
1890 }
1891 else
1892 #endif
1893
1894 #ifdef HAVE_WALK
1895 if(strcmp(sys_cmd, "MivWeightOrderlp") == 0)
1896 {
1904 }
1905 else
1906 #endif
1907
1908 #ifdef HAVE_WALK
1909 if(strcmp(sys_cmd, "MivWeightOrderdp") == 0)
1910 {
1912 {
1913 WerrorS(
"system(\"MivWeightOrderdp\",intvec) expected");
1915 }
1917
1922 }
1923 else
1924 #endif
1925
1926 #ifdef HAVE_WALK
1927 if(strcmp(sys_cmd, "MivMatrixOrderlp") == 0)
1928 {
1930 {
1931 WerrorS(
"system(\"MivMatrixOrderlp\",int) expected");
1933 }
1934 int arg1 = (int) ((
long)(
h->Data()));
1939 }
1940 else
1941 #endif
1942
1943 #ifdef HAVE_WALK
1944 if (strcmp(sys_cmd, "MkInterRedNextWeight") == 0)
1945 {
1950 {
1951 Werror(
"system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1954 }
1957 ideal arg3 = (ideal)
h->next->next->Data();
1962 }
1963 else
1964 #endif
1965
1966 #ifdef HAVE_WALK
1967 #ifdef MPertNextWeight
1968 if (strcmp(sys_cmd, "MPertNextWeight") == 0)
1969 {
1973 {
1974 Werror(
"system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1977 }
1979 ideal arg2 = (ideal)
h->next->Data();
1980 int arg3 = (int)
h->next->next->Data();
1985 }
1986 else
1987 #endif
1988 #endif
1989
1990 #ifdef HAVE_WALK
1991 #ifdef Mivperttarget
1992 if (strcmp(sys_cmd, "Mivperttarget") == 0)
1993 {
1996 ideal arg1 = (ideal)
h->Data();
1997 int arg2 = (int)
h->next->Data();
2002 }
2003 else
2004 #endif
2005 #endif
2006
2007 #ifdef HAVE_WALK
2008 if (strcmp(sys_cmd, "Mwalk") == 0)
2009 {
2014 {
2015 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d\n",
2018 }
2019 ideal arg1 = (ideal)
h->CopyD();
2022 ring arg4 = (ring)
h->next->next->next->Data();
2023 int arg5 = (int) (
long)
h->next->next->next->next->Data();
2024 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2025 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2029 }
2030 else
2031 #endif
2032
2033 #ifdef HAVE_WALK
2034 #ifdef MPWALK_ORIG
2035 if (strcmp(sys_cmd, "Mwalk") == 0)
2036 {
2043 {
2044 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2047 }
2048 ideal arg1 = (ideal)
h->Data();
2051 ring arg4 = (ring)
h->next->next->next->Data();
2052 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3,arg4);
2056 }
2057 else
2058 #else
2059 if (strcmp(sys_cmd, "Mpwalk") == 0)
2060 {
2065 {
2066 Werror(
"system(\"Mpwalk\" ...) intvecs not of length %d\n",
currRing->N);
2068 }
2069 ideal arg1 = (ideal)
h->Data();
2070 int arg2 = (int) (
long)
h->next->Data();
2071 int arg3 = (int) (
long)
h->next->next->Data();
2074 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2075 int arg7 = (int) (
long)
h->next->next->next->next->next->next->Data();
2076 int arg8 = (int) (
long)
h->next->next->next->next->next->next->next->Data();
2077 ideal
result = (ideal)
Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2081 }
2082 else
2083 #endif
2084 #endif
2085
2086 #ifdef HAVE_WALK
2087 if (strcmp(sys_cmd, "Mrwalk") == 0)
2088 {
2095 {
2096 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2099 }
2100 ideal arg1 = (ideal)
h->Data();
2103 int arg4 = (int)(
long)
h->next->next->next->Data();
2104 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2105 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2106 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2107 ideal
result = (ideal)
Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2111 }
2112 else
2113 #endif
2114
2115 #ifdef HAVE_WALK
2116 if (strcmp(sys_cmd, "MAltwalk1") == 0)
2117 {
2122 {
2123 Werror(
"system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2126 }
2127 ideal arg1 = (ideal)
h->Data();
2128 int arg2 = (int) ((
long)(
h->next->Data()));
2129 int arg3 = (int) ((
long)(
h->next->next->Data()));
2136 }
2137 else
2138 #endif
2139
2140 #ifdef HAVE_WALK
2141 #ifdef MFWALK_ALT
2142 if (strcmp(sys_cmd, "Mfwalk_alt") == 0)
2143 {
2148 {
2149 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2152 }
2153 ideal arg1 = (ideal)
h->Data();
2156 int arg4 = (int)
h->next->next->next->Data();
2157 ideal
result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2161 }
2162 else
2163 #endif
2164 #endif
2165
2166 #ifdef HAVE_WALK
2167 if (strcmp(sys_cmd, "Mfwalk") == 0)
2168 {
2173 {
2174 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2177 }
2178 ideal arg1 = (ideal)
h->Data();
2181 int arg4 = (int)(
long)
h->next->next->next->Data();
2182 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2183 ideal
result = (ideal)
Mfwalk(arg1, arg2, arg3, arg4, arg5);
2187 }
2188 else
2189 #endif
2190
2191 #ifdef HAVE_WALK
2192 if (strcmp(sys_cmd, "Mfrwalk") == 0)
2193 {
2196
2197
2198
2199
2200
2201
2202
2203
2208 {
2209 Werror(
"system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2212 }
2213
2214 ideal arg1 = (ideal)
h->Data();
2217 int arg4 = (int)(
long)
h->next->next->next->Data();
2218 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2219 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2220 ideal
result = (ideal)
Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2224 }
2225 else
2226
2227 if (strcmp(sys_cmd, "Mprwalk") == 0)
2228 {
2235 {
2236 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2239 }
2240 ideal arg1 = (ideal)
h->Data();
2243 int arg4 = (int)(
long)
h->next->next->next->Data();
2244 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2245 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2246 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2247 int arg8 = (int)(
long)
h->next->next->next->next->next->next->next->Data();
2248 int arg9 = (int)(
long)
h->next->next->next->next->next->next->next->next->Data();
2249 ideal
result = (ideal)
Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2253 }
2254 else
2255 #endif
2256
2257 #ifdef HAVE_WALK
2258 #ifdef TRAN_Orig
2259 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2260 {
2265 {
2266 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2269 }
2270 ideal arg1 = (ideal)
h->Data();
2277 }
2278 else
2279 #endif
2280 #endif
2281
2282 #ifdef HAVE_WALK
2283 if (strcmp(sys_cmd, "MAltwalk2") == 0)
2284 {
2289 {
2290 Werror(
"system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2293 }
2294 ideal arg1 = (ideal)
h->Data();
2301 }
2302 else
2303 #endif
2304
2305 #ifdef HAVE_WALK
2306 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2307 {
2312 {
2313 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2316 }
2317 ideal arg1 = (ideal)
h->Data();
2320 int arg4 = (int) ((
long)(
h->next->next->next->Data()));
2325 }
2326 else
2327 #endif
2328
2329 #if 0
2330 #ifdef HAVE_WALK
2331 if (strcmp(sys_cmd, "TranMrImprovwalk") == 0)
2332 {
2336 h->next->next->next ==
NULL ||
h->next->next->next->Typ() !=
INT_CMD ||
2337 h->next->next->next ==
NULL ||
h->next->next->next->next->Typ() !=
INT_CMD ||
2338 h->next->next->next ==
NULL ||
h->next->next->next->next->next->Typ() !=
INT_CMD)
2339 {
2340 WerrorS(
"system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2342 }
2345 {
2346 Werror(
"system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n",
currRing->N);
2348 }
2349 ideal arg1 = (ideal)
h->Data();
2352 int arg4 = (int)(
long)
h->next->next->next->Data();
2353 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2354 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2355 ideal
result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2359 }
2360 else
2361 #endif
2362 #endif
2363
2364 {
2365 #ifndef MAKE_DISTRIBUTION
2367 #else
2369 #endif
2370 }
2371 }
2373}
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)