232{
234 {
235 const char *sys_cmd=(
char *)(args->
Data());
237
238
239
240 if (strcmp(sys_cmd, "nblocks") == 0)
241 {
242 ring r;
244 {
246 {
248 }
249 else
250 {
253 }
254 }
255 else
256 {
258 {
261 }
262 r = (ring)
h->Data();
263 }
267 }
268
269 if(strcmp(sys_cmd,"version")==0)
270 {
274 }
275 else
276
277 if(strcmp(sys_cmd,"alarm")==0)
278 {
280 {
281
282
283
284 struct itimerval t,o;
285 memset(&t,0,sizeof(t));
286 t.it_value.tv_sec =(unsigned)((
unsigned long)
h->Data());
287 setitimer(ITIMER_VIRTUAL,&t,&o);
289 }
290 else
292 }
293 else
294
295 if(strcmp(sys_cmd,"content")==0)
296 {
298 {
300 poly
p=(poly)
h->CopyD();
302 {
305 }
309 }
311 }
312 else
313
314 if(strcmp(sys_cmd,"cpu")==0)
315 {
316 #if 0
317 long cpu=1;
318 #ifdef _SC_NPROCESSORS_ONLN
319 cpu=sysconf(_SC_NPROCESSORS_ONLN);
320 #elif defined(_SC_NPROCESSORS_CONF)
321 cpu=sysconf(_SC_NPROCESSORS_CONF);
322 #endif
323 res->data=(
void *)cpu;
324 #else
326 #endif
329 }
330 else
331
332 if(strcmp(sys_cmd,"executable")==0)
333 {
335 {
342 }
344 }
345 else
346
347 if(strcmp(sys_cmd,"flatten")==0)
348 {
350 {
354 }
355 else
357 }
358 else
359
360 if(strcmp(sys_cmd,"unflatten")==0)
361 {
364 {
368 }
370 }
371 else
372
373 if(strcmp(sys_cmd,"neworder")==0)
374 {
376 {
380 }
381 else
383 }
384 else
385
386
387 if(strcmp(sys_cmd,"nc_hilb") == 0)
388 {
393 int trunDegHs=0;
395 i = (ideal)
h->Data();
396 else
397 {
398 WerrorS(
"nc_Hilb:ideal expected");
400 }
403 lV = (int)(
long)
h->Data();
404 else
405 {
406 WerrorS(
"nc_Hilb:int expected");
408 }
411 {
412 if((
int)(
long)
h->Data() == 1)
414 else if((
int)(
long)
h->Data() == 2)
419 trunDegHs = (int)(
long)
h->Data();
421 }
423 {
424 WerrorS(
"nc_Hilb:int 1,2, total degree for the truncation, and a string for printing the details are expected");
426 }
427
430 }
431 else
432
433 if(strcmp(sys_cmd,"verifyGB")==0)
434 {
436 {
437 WerrorS(
"system(\"verifyGB\",<ideal>,..) expects a commutative ring");
439 }
442 {
443 Werror(
"expected system(\"verifyGB\",<ideal/module>), found <%s>",
Tok2Cmdname(
h->Typ()));
445 }
446 ideal F=(ideal)
h->Data();
447 #ifdef HAVE_VSPACE
449 if (cpus>1)
451 else
452 #endif
456 }
457 else
458
459 if(strcmp(sys_cmd,"rcolon") == 0)
460 {
463 {
464 ideal
i = (ideal)
h->Data();
466 poly
w=(poly)
h->Data();
468 int lV = (int)(
long)
h->Data();
472 }
473 else
475 }
476 else
477
478
479 if(strcmp(sys_cmd,"sh")==0)
480 {
482 {
483 WerrorS(
"shell execution is disallowed in restricted mode");
485 }
487 if (
h==
NULL)
res->data = (
void *)(
long) system(
"sh");
489 res->data = (
void*)(
long) system((
char*)(
h->Data()));
490 else
492 if (errno==ECHILD)
res->data=
NULL;
494 }
495 else
496
497 if(strcmp(sys_cmd,"reduce_bound")==0)
498 {
506 {
507 p = (poly)
h->CopyD();
508 }
510 {
511 pid = (ideal)
h->CopyD();
512 }
514
516 ideal q = (ideal)
h->next->CopyD();
517 int bound = (int)(
long)
h->next->next->Data();
520 else
523 }
524 else
525
526 if(strcmp(sys_cmd,"uname")==0)
527 {
531 }
532 else
533
534 if(strcmp(sys_cmd,"with")==0)
535 {
537 {
541 }
543 {
544 #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
545 char *
s=(
char *)
h->Data();
547 #ifdef HAVE_DBM
549 #endif
550 #ifdef HAVE_DLD
552 #endif
553
554
555 #ifdef HAVE_READLINE
557 #endif
558 #ifdef TEST_MAC_ORDER
560 #endif
561
563 #ifdef HAVE_DYNAMIC_LOADING
565 #endif
566 #ifdef HAVE_EIGENVAL
568 #endif
569 #ifdef HAVE_GMS
571 #endif
572 #ifdef OM_NDEBUG
574 #endif
575 #ifdef SING_NDEBUG
577 #endif
578 {};
580 #undef TEST_FOR
581 }
583 }
584 else
585
586 if (strcmp(sys_cmd,"browsers")==0)
587 {
593 }
594 else
595
596 if (strcmp(sys_cmd,"pid")==0)
597 {
599 res->data=(
void *)(
long) getpid();
601 }
602 else
603
604 if (strcmp(sys_cmd,"getenv")==0)
605 {
607 {
609 const char *r=
getenv((
char *)
h->Data());
613 }
614 else
615 {
618 }
619 }
620 else
621
622 if (strcmp(sys_cmd,"setenv")==0)
623 {
624 #ifdef HAVE_SETENV
627 {
629 setenv((
char *)
h->Data(), (
char *)
h->next->Data(), 1);
633 }
634 else
635 {
637 }
638 #else
639 WerrorS(
"setenv not supported on this platform");
641 #endif
642 }
643 else
644
645 if (strcmp(sys_cmd, "Singular") == 0)
646 {
652 }
653 else
654 if (strcmp(sys_cmd, "SingularLib") == 0)
655 {
661 }
662 else
663 if (strcmp(sys_cmd, "SingularBin") == 0)
664 {
667 if (r ==
NULL) r=
"/usr/local";
669
670 #define SINGULAR_PROCS_DIR "/libexec/singular/MOD"
673 if ((strstr(r,
".libs/..")==
NULL)
674 &&(strstr(r,
"Singular/..")==
NULL))
675 {
678 if (access(
s,X_OK)==0)
679 {
681 }
682 else
683 {
684
685 strcpy(
s,LIBEXEC_DIR);
686 if (access(
s,X_OK)==0)
687 {
689 }
690 else
691 {
693 }
694 }
695 }
696 else
697 {
700 {
702 }
703 else
704 {
707 }
708 }
709 res->data = (
void*)
s;
711 }
712 else
713
714 if (strstr(sys_cmd, "--") == sys_cmd)
715 {
716 if (strcmp(sys_cmd, "--") == 0)
717 {
720 }
723 {
724 Werror(
"Unknown option %s", sys_cmd);
725 WerrorS(
"Use 'system(\"--\");' for listing of available options");
727 }
728
729
731 {
734 }
736 {
738 {
740 const char *r=(
const char*)
feOptSpec[opt].value;
743 }
744 else
745 {
748 }
750 }
751 const char* errormsg=
NULL;
753 {
755 {
756 Werror(
"Need string argument to set value of option %s", sys_cmd);
758 }
760 if (errormsg !=
NULL)
761 Werror(
"Option '--%s=%d' %s", sys_cmd, (
int) ((
long)
h->Data()), errormsg);
762 }
764 {
766 if (errormsg !=
NULL)
767 Werror(
"Option '--%s=%s' %s", sys_cmd, (
char*)
h->Data(), errormsg);
768 }
769 else
770 {
771 WerrorS(
"Need string or int argument to set option value");
773 }
776 }
777 else
778
779 if (strcmp(sys_cmd,"HC")==0)
780 {
784 }
785 else
786
787 if(strcmp(sys_cmd,"random")==0)
788 {
791 {
793 {
798 }
799 else
800 {
802 }
803 }
807 }
808 else
809
810 if (strcmp(sys_cmd,"denom_list")==0)
811 {
816 }
817 else
818
819 if(strcmp(sys_cmd,"complexNearZero")==0)
820 {
823 {
825 {
826 WerrorS(
"unsupported ground field!");
828 }
829 else
830 {
833 (
int)((
long)(
h->next->Data())));
835 }
836 }
837 else
838 {
840 }
841 }
842 else
843
844 if(strcmp(sys_cmd,"getPrecDigits")==0)
845 {
848 {
849 WerrorS(
"unsupported ground field!");
851 }
854
855
857 }
858 else
859
860 if(strcmp(sys_cmd, "lduDecomp")==0)
861 {
864 {
867 poly
l; poly u; poly prodLU;
868 lduDecomp(aMat, pMat, lMat, dMat, uMat,
l, u, prodLU);
879 res->data = (
char *)L;
881 }
882 else
883 {
885 }
886 }
887 else
888
889 if(strcmp(sys_cmd, "lduSolve")==0)
890 {
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
911 {
913 }
915 {
918 }
923 poly
l = (poly)
h->next->next->next->next->Data();
924 poly u = (poly)
h->next->next->next->next->next->Data();
925 poly lTimesU = (poly)
h->next->next->next->next->next->next->Data();
926 matrix bVec = (
matrix)
h->next->next->next->next->next->next->next->Data();
929 {
930 Werror(
"first matrix (%d x %d) is not quadratic",
933 }
935 {
936 Werror(
"second matrix (%d x %d) is not quadratic",
939 }
941 {
942 Werror(
"third matrix (%d x %d) is not quadratic",
945 }
947 {
948 Werror(
"third matrix (%d x %d) and fourth matrix (%d x %d) %s",
950 "do not t");
952 }
954 {
955 Werror(
"fourth matrix (%d x %d) and vector (%d x 1) do not fit",
958 }
960 bVec, xVec, homogSolSpace);
961
962
963
965 if (solvable)
966 {
971 }
972 else
973 {
976 }
980 }
981 else
982
983 if (strcmp(sys_cmd, "shared") == 0)
984 {
985 #ifndef SI_COUNTEDREF_AUTOLOAD
988 #endif
991 }
992 else if (strcmp(sys_cmd, "reference") == 0)
993 {
994 #ifndef SI_COUNTEDREF_AUTOLOAD
997 #endif
1000 }
1001 else
1002
1003#ifdef HAVE_SIMPLEIPC
1004 if (strcmp(sys_cmd,"semaphore")==0)
1005 {
1007 {
1009 if ((
h->next->next!=
NULL)&& (
h->next->next->Typ()==
INT_CMD))
1010 v=(int)(
long)
h->next->next->Data();
1014 }
1015 else
1016 {
1017 WerrorS(
"Usage: system(\"semaphore\",<cmd>,int)");
1019 }
1020 }
1021 else
1022#endif
1023
1024 if (strcmp(sys_cmd,"reserve")==0)
1025 {
1028 {
1031 res->data=(
void*)(
long)
p;
1033 }
1035 }
1036 else
1037
1038 if (strcmp(sys_cmd,"reservedLink")==0)
1039 {
1044 }
1045 else
1046
1047 if (strcmp(sys_cmd,"install")==0)
1048 {
1051 {
1053 (
int)(
long)
h->next->next->next->Data(),
1055 }
1057 }
1058 else
1059
1060 if (strcmp(sys_cmd,"newstruct")==0)
1061 {
1064 {
1065 int id=0;
1066 char *n=(
char*)
h->Data();
1068 if (id>0)
1069 {
1072 {
1073 newstruct_desc desc=(newstruct_desc)bb->data;
1076 }
1077 else Werror(
"'%s' is not a newstruct",n);
1078 }
1079 else Werror(
"'%s' is not a blackbox object",n);
1080 }
1082 }
1083 else
1084
1085 if (strcmp(sys_cmd,"blackbox")==0)
1086 {
1089 }
1090 else
1091
1092 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1093 if (strcmp(sys_cmd, "absFact") == 0)
1094 {
1099 {
1103 int n= 0;
1110 l->m[0].data=(
void *)
f;
1112 l->m[1].data=(
void *)
v;
1114 l->m[2].data=(
void*) mipos;
1116 l->m[3].data=(
void*) (
long) n;
1117 res->data=(
void *)
l;
1119 }
1121 }
1122 else
1123 #endif
1124
1125 #ifdef HAVE_NTL
1126 if (strcmp(sys_cmd, "LLL") == 0)
1127 {
1129 {
1132 {
1135 }
1137 {
1140 }
1142 }
1144 }
1145 else
1146 #endif
1147
1148 #ifdef HAVE_FLINT
1149 #if __FLINT_RELEASE >= 20500
1150 if (strcmp(sys_cmd, "LLL_Flint") == 0)
1151 {
1153 {
1155 {
1158 {
1161 }
1163 {
1166 }
1168 }
1170 {
1171 WerrorS(
"matrix,int or bigint,int expected");
1173 }
1175 {
1176 if(((
int)((
long)(
h->next->Data())) != 0) && (
int)((
long)(
h->next->Data()) != 1))
1177 {
1178 WerrorS(
"int is different from 0, 1");
1180 }
1182 if((
long)(
h->next->Data()) == 0)
1183 {
1185 {
1188 }
1190 {
1193 }
1195 }
1196
1197 if((
long)(
h->next->Data()) == 1)
1198 {
1200 {
1203 for(
int i = 1;
i<=
m->rows();
i++)
1204 {
1207 }
1216 }
1218 {
1221 for(
int i = 1;
i<=
m->rows();
i++)
1231 }
1233 }
1234 }
1235
1236 }
1238 }
1239 else
1240 #endif
1241 #endif
1242
1243 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1244 if(strcmp(sys_cmd,"rref")==0)
1245 {
1249 {
1251 #if defined(HAVE_FLINT)
1253 #elif defined(HAVE_NTL)
1255 #endif
1258 }
1260 {
1261 ideal
M=(ideal)
h->Data();
1262 #if defined(HAVE_FLINT)
1264 #elif defined(HAVE_NTL)
1266 #endif
1269 }
1270 else
1271 {
1272 WerrorS(
"expected system(\"rref\",<matrix>/<smatrix>)");
1274 }
1275 }
1276 else
1277 #endif
1278
1279 #ifdef HAVE_PCV
1280 if(strcmp(sys_cmd,"pcvLAddL")==0)
1281 {
1283 }
1284 else
1285 if(strcmp(sys_cmd,"pcvPMulL")==0)
1286 {
1288 }
1289 else
1290 if(strcmp(sys_cmd,"pcvMinDeg")==0)
1291 {
1293 }
1294 else
1295 if(strcmp(sys_cmd,"pcvP2CV")==0)
1296 {
1298 }
1299 else
1300 if(strcmp(sys_cmd,"pcvCV2P")==0)
1301 {
1303 }
1304 else
1305 if(strcmp(sys_cmd,"pcvDim")==0)
1306 {
1308 }
1309 else
1310 if(strcmp(sys_cmd,"pcvBasis")==0)
1311 {
1313 }
1314 else
1315 #endif
1316
1317 #ifdef HAVE_EIGENVAL
1318 if(strcmp(sys_cmd,"hessenberg")==0)
1319 {
1321 }
1322 else
1323 #endif
1324
1325 #ifdef HAVE_EIGENVAL
1326 if(strcmp(sys_cmd,"eigenvals")==0)
1327 {
1329 }
1330 else
1331 #endif
1332
1333 #ifdef HAVE_EIGENVAL
1334 if(strcmp(sys_cmd,"rowelim")==0)
1335 {
1337 }
1338 else
1339 #endif
1340
1341 #ifdef HAVE_EIGENVAL
1342 if(strcmp(sys_cmd,"rowcolswap")==0)
1343 {
1345 }
1346 else
1347 #endif
1348
1349 #ifdef HAVE_GMS
1350 if(strcmp(sys_cmd,"gmsnf")==0)
1351 {
1353 }
1354 else
1355 #endif
1356
1357 if(strcmp(sys_cmd,"contributors") == 0)
1358 {
1361 "Olaf Bachmann, Michael Brickenstein, Hubert Grassmann, Kai Krueger, Victor Levandovskyy, Wolfgang Neumann, Thomas Nuessler, Wilfred Pohl, Jens Schmidt, Mathias Schulze, Thomas Siebert, Ruediger Stobbe, Moritz Wenk, Tim Wichmann");
1363 }
1364 else
1365
1366 #ifdef HAVE_SPECTRUM
1367 if(strcmp(sys_cmd,"spectrum") == 0)
1368 {
1370 {
1373 }
1377 {
1380 }
1381 if(((
long)
h->next->Data())==1L)
1384 }
1385 else
1386
1387 if(strcmp(sys_cmd,"semic") == 0)
1388 {
1392 {
1393 if (
h->next->next==
NULL)
1395 else if (
h->next->next->Typ()==
INT_CMD)
1397 }
1399 }
1400 else
1401
1402 if(strcmp(sys_cmd,"spadd") == 0)
1403 {
1406 {
1408 }
1410 }
1411 else
1412
1413 if(strcmp(sys_cmd,"spmul") == 0)
1414 {
1417 {
1419 }
1421 }
1422 else
1423 #endif
1424
1425 #define HAVE_SHEAFCOH_TRICKS 1
1426
1427 #ifdef HAVE_SHEAFCOH_TRICKS
1428 if(strcmp(sys_cmd,"tensorModuleMult")==0)
1429 {
1431
1433 {
1434 int m = (int)( (
long)
h->Data() );
1435 ideal
M = (ideal)
h->next->Data();
1439 }
1441 }
1442 else
1443 #endif
1444
1445 #ifdef HAVE_PLURAL
1446 if (strcmp(sys_cmd, "twostd") == 0)
1447 {
1448 ideal I;
1450 {
1451 I=(ideal)
h->CopyD();
1457 }
1460 }
1461 else
1462 #endif
1463
1464 #ifdef HAVE_PLURAL
1465 if (strcmp(sys_cmd, "bracket") == 0)
1466 {
1469 {
1470 poly
p=(poly)
h->CopyD();
1472 poly q=(poly)
h->Data();
1476 }
1478 }
1479 else
1480 #endif
1481
1482 #ifdef HAVE_PLURAL
1483 if (strcmp(sys_cmd, "env")==0)
1484 {
1486 {
1487 ring r = (ring)
h->Data();
1491 }
1492 else
1493 {
1494 WerrorS(
"`system(\"env\",<ring>)` expected");
1496 }
1497 }
1498 else
1499 #endif
1500
1501 #ifdef HAVE_PLURAL
1502 if (strcmp(sys_cmd, "opp")==0)
1503 {
1505 {
1506 ring r=(ring)
h->Data();
1510 }
1511 else
1512 {
1513 WerrorS(
"`system(\"opp\",<ring>)` expected");
1515 }
1516 }
1517 else
1518 #endif
1519
1520 #ifdef HAVE_PLURAL
1521 if (strcmp(sys_cmd, "oppose")==0)
1522 {
1524 && (
h->next!=
NULL))
1525 {
1526 ring Rop = (ring)
h->Data();
1530 {
1535 }
1536 }
1537 else
1538 {
1539 WerrorS(
"`system(\"oppose\",<ring>,<poly>)` expected");
1541 }
1542 }
1543 else
1544 #endif
1545
1546 if(strcmp(sys_cmd,"sat")==0)
1547 {
1548 ideal I= (ideal)
h->Data();
1549 ideal J=(ideal)
h->next->Data();
1556 }
1557 else
1558
1559
1560 #ifdef HAVE_WALK
1561 #ifdef OWNW
1562 if (strcmp(sys_cmd, "walkNextWeight") == 0)
1563 {
1568 {
1569 Werror(
"system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1572 }
1573 res->data = (
void*) walkNextWeight(((
intvec*)
h->Data()),
1575 (ideal)
h->next->next->Data());
1576 if (
res->data ==
NULL ||
res->data == (
void*) 1L)
1577 {
1579 }
1580 else
1581 {
1583 }
1585 }
1586 else
1587 #endif
1588 #endif
1589
1590 #ifdef HAVE_WALK
1591 #ifdef OWNW
1592 if (strcmp(sys_cmd, "walkInitials") == 0)
1593 {
1595 {
1596 WerrorS(
"system(\"walkInitials\", ideal) expected");
1598 }
1599 res->data = (
void*) walkInitials((ideal)
h->Data());
1602 }
1603 else
1604 #endif
1605 #endif
1606
1607 #ifdef HAVE_WALK
1608 #ifdef WAIV
1609 if (strcmp(sys_cmd, "walkAddIntVec") == 0)
1610 {
1615 res->data = (
intvec*) walkAddIntVec(arg1, arg2);
1618 }
1619 else
1620 #endif
1621 #endif
1622
1623 #ifdef HAVE_WALK
1624 #ifdef MwaklNextWeight
1625 if (strcmp(sys_cmd, "MwalkNextWeight") == 0)
1626 {
1631 {
1632 Werror(
"system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1635 }
1638 ideal arg3 = (ideal)
h->next->next->Data();
1643 }
1644 else
1645 #endif
1646 #endif
1647
1648 #ifdef HAVE_WALK
1649 if(strcmp(sys_cmd, "Mivdp") == 0)
1650 {
1652 {
1653 WerrorS(
"system(\"Mivdp\", int) expected");
1655 }
1656 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1657 {
1658 Werror(
"system(\"Mivdp\" ...) intvecs not of length %d\n",
1661 }
1662 int arg1 = (int) ((
long)(
h->Data()));
1667 }
1668 else
1669 #endif
1670
1671 #ifdef HAVE_WALK
1672 if(strcmp(sys_cmd, "Mivlp") == 0)
1673 {
1675 {
1676 WerrorS(
"system(\"Mivlp\", int) expected");
1678 }
1679 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1680 {
1681 Werror(
"system(\"Mivlp\" ...) intvecs not of length %d\n",
1684 }
1685 int arg1 = (int) ((
long)(
h->Data()));
1690 }
1691 else
1692 #endif
1693
1694 #ifdef HAVE_WALK
1695 #ifdef MpDiv
1696 if(strcmp(sys_cmd, "MpDiv") == 0)
1697 {
1700 poly arg1 = (poly)
h->Data();
1701 poly arg2 = (poly)
h->next->Data();
1702 poly
result = MpDiv(arg1, arg2);
1706 }
1707 else
1708 #endif
1709 #endif
1710
1711 #ifdef HAVE_WALK
1712 #ifdef MpMult
1713 if(strcmp(sys_cmd, "MpMult") == 0)
1714 {
1717 poly arg1 = (poly)
h->Data();
1718 poly arg2 = (poly)
h->next->Data();
1719 poly
result = MpMult(arg1, arg2);
1723 }
1724 else
1725 #endif
1726 #endif
1727
1728 #ifdef HAVE_WALK
1729 if (strcmp(sys_cmd, "MivSame") == 0)
1730 {
1733
1734
1735
1736
1737
1738
1739
1740
1741
1744
1745
1746
1747
1748
1750 res->data = (
void*)(
long)
MivSame(arg1, arg2);
1752 }
1753 else
1754 #endif
1755
1756 #ifdef HAVE_WALK
1757 if (strcmp(sys_cmd, "M3ivSame") == 0)
1758 {
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1774
1775
1776
1777
1778
1780 res->data = (
void*)(
long)
M3ivSame(arg1, arg2, arg3);
1782 }
1783 else
1784 #endif
1785
1786 #ifdef HAVE_WALK
1787 if(strcmp(sys_cmd, "MwalkInitialForm") == 0)
1788 {
1792 {
1793 Werror(
"system \"MwalkInitialForm\"...) intvec not of length %d\n",
1796 }
1797 ideal
id = (ideal)
h->Data();
1803 }
1804 else
1805 #endif
1806
1807 #ifdef HAVE_WALK
1808
1809 if(strcmp(sys_cmd, "MivMatrixOrder") == 0)
1810 {
1812 {
1813 WerrorS(
"system(\"MivMatrixOrder\",intvec) expected");
1815 }
1821 }
1822 else
1823 #endif
1824
1825 #ifdef HAVE_WALK
1826 if(strcmp(sys_cmd, "MivMatrixOrderdp") == 0)
1827 {
1829 {
1830 WerrorS(
"system(\"MivMatrixOrderdp\",intvec) expected");
1832 }
1833 int arg1 = (int) ((
long)(
h->Data()));
1838 }
1839 else
1840 #endif
1841
1842 #ifdef HAVE_WALK
1843 if(strcmp(sys_cmd, "MPertVectors") == 0)
1844 {
1847 ideal arg1 = (ideal)
h->Data();
1849 int arg3 = (int) ((
long)(
h->next->next->Data()));
1854 }
1855 else
1856 #endif
1857
1858 #ifdef HAVE_WALK
1859 if(strcmp(sys_cmd, "MPertVectorslp") == 0)
1860 {
1863 ideal arg1 = (ideal)
h->Data();
1865 int arg3 = (int) ((
long)(
h->next->next->Data()));
1870 }
1871 else
1872 #endif
1873
1874 #ifdef HAVE_WALK
1875 if(strcmp(sys_cmd, "Mfpertvector") == 0)
1876 {
1879 ideal arg1 = (ideal)
h->Data();
1885 }
1886 else
1887 #endif
1888
1889 #ifdef HAVE_WALK
1890 if(strcmp(sys_cmd, "MivUnit") == 0)
1891 {
1894 int arg1 = (int) ((
long)(
h->Data()));
1899 }
1900 else
1901 #endif
1902
1903 #ifdef HAVE_WALK
1904 if(strcmp(sys_cmd, "MivWeightOrderlp") == 0)
1905 {
1913 }
1914 else
1915 #endif
1916
1917 #ifdef HAVE_WALK
1918 if(strcmp(sys_cmd, "MivWeightOrderdp") == 0)
1919 {
1921 {
1922 WerrorS(
"system(\"MivWeightOrderdp\",intvec) expected");
1924 }
1926
1931 }
1932 else
1933 #endif
1934
1935 #ifdef HAVE_WALK
1936 if(strcmp(sys_cmd, "MivMatrixOrderlp") == 0)
1937 {
1939 {
1940 WerrorS(
"system(\"MivMatrixOrderlp\",int) expected");
1942 }
1943 int arg1 = (int) ((
long)(
h->Data()));
1948 }
1949 else
1950 #endif
1951
1952 #ifdef HAVE_WALK
1953 if (strcmp(sys_cmd, "MkInterRedNextWeight") == 0)
1954 {
1959 {
1960 Werror(
"system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1963 }
1966 ideal arg3 = (ideal)
h->next->next->Data();
1971 }
1972 else
1973 #endif
1974
1975 #ifdef HAVE_WALK
1976 #ifdef MPertNextWeight
1977 if (strcmp(sys_cmd, "MPertNextWeight") == 0)
1978 {
1982 {
1983 Werror(
"system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1986 }
1988 ideal arg2 = (ideal)
h->next->Data();
1989 int arg3 = (int)
h->next->next->Data();
1994 }
1995 else
1996 #endif
1997 #endif
1998
1999 #ifdef HAVE_WALK
2000 #ifdef Mivperttarget
2001 if (strcmp(sys_cmd, "Mivperttarget") == 0)
2002 {
2005 ideal arg1 = (ideal)
h->Data();
2006 int arg2 = (int)
h->next->Data();
2011 }
2012 else
2013 #endif
2014 #endif
2015
2016 #ifdef HAVE_WALK
2017 if (strcmp(sys_cmd, "Mwalk") == 0)
2018 {
2023 {
2024 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d\n",
2027 }
2028 ideal arg1 = (ideal)
h->CopyD();
2031 ring arg4 = (ring)
h->next->next->next->Data();
2032 int arg5 = (int) (
long)
h->next->next->next->next->Data();
2033 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2034 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2038 }
2039 else
2040 #endif
2041
2042 #ifdef HAVE_WALK
2043 #ifdef MPWALK_ORIG
2044 if (strcmp(sys_cmd, "Mwalk") == 0)
2045 {
2052 {
2053 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2056 }
2057 ideal arg1 = (ideal)
h->Data();
2060 ring arg4 = (ring)
h->next->next->next->Data();
2061 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3,arg4);
2065 }
2066 else
2067 #else
2068 if (strcmp(sys_cmd, "Mpwalk") == 0)
2069 {
2072 if(((
intvec*)
h->next->next->next->Data())->length() !=
currRing->N &&
2074 {
2075 Werror(
"system(\"Mpwalk\" ...) intvecs not of length %d\n",
currRing->N);
2077 }
2078 ideal arg1 = (ideal)
h->Data();
2079 int arg2 = (int) (
long)
h->next->Data();
2080 int arg3 = (int) (
long)
h->next->next->Data();
2083 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2084 int arg7 = (int) (
long)
h->next->next->next->next->next->next->Data();
2085 int arg8 = (int) (
long)
h->next->next->next->next->next->next->next->Data();
2086 ideal
result = (ideal)
Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2090 }
2091 else
2092 #endif
2093 #endif
2094
2095 #ifdef HAVE_WALK
2096 if (strcmp(sys_cmd, "Mrwalk") == 0)
2097 {
2104 {
2105 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2108 }
2109 ideal arg1 = (ideal)
h->Data();
2112 int arg4 = (int)(
long)
h->next->next->next->Data();
2113 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2114 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2115 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2116 ideal
result = (ideal)
Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2120 }
2121 else
2122 #endif
2123
2124 #ifdef HAVE_WALK
2125 if (strcmp(sys_cmd, "MAltwalk1") == 0)
2126 {
2129 if (((
intvec*)
h->next->next->next->Data())->length() !=
currRing->N &&
2131 {
2132 Werror(
"system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2135 }
2136 ideal arg1 = (ideal)
h->Data();
2137 int arg2 = (int) ((
long)(
h->next->Data()));
2138 int arg3 = (int) ((
long)(
h->next->next->Data()));
2145 }
2146 else
2147 #endif
2148
2149 #ifdef HAVE_WALK
2150 #ifdef MFWALK_ALT
2151 if (strcmp(sys_cmd, "Mfwalk_alt") == 0)
2152 {
2157 {
2158 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2161 }
2162 ideal arg1 = (ideal)
h->Data();
2165 int arg4 = (int)
h->next->next->next->Data();
2166 ideal
result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2170 }
2171 else
2172 #endif
2173 #endif
2174
2175 #ifdef HAVE_WALK
2176 if (strcmp(sys_cmd, "Mfwalk") == 0)
2177 {
2182 {
2183 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2186 }
2187 ideal arg1 = (ideal)
h->Data();
2190 int arg4 = (int)(
long)
h->next->next->next->Data();
2191 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2192 ideal
result = (ideal)
Mfwalk(arg1, arg2, arg3, arg4, arg5);
2196 }
2197 else
2198 #endif
2199
2200 #ifdef HAVE_WALK
2201 if (strcmp(sys_cmd, "Mfrwalk") == 0)
2202 {
2205
2206
2207
2208
2209
2210
2211
2212
2217 {
2218 Werror(
"system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2221 }
2222
2223 ideal arg1 = (ideal)
h->Data();
2226 int arg4 = (int)(
long)
h->next->next->next->Data();
2227 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2228 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2229 ideal
result = (ideal)
Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2233 }
2234 else
2235
2236 if (strcmp(sys_cmd, "Mprwalk") == 0)
2237 {
2244 {
2245 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2248 }
2249 ideal arg1 = (ideal)
h->Data();
2252 int arg4 = (int)(
long)
h->next->next->next->Data();
2253 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2254 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2255 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2256 int arg8 = (int)(
long)
h->next->next->next->next->next->next->next->Data();
2257 int arg9 = (int)(
long)
h->next->next->next->next->next->next->next->next->Data();
2258 ideal
result = (ideal)
Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2262 }
2263 else
2264 #endif
2265
2266 #ifdef HAVE_WALK
2267 #ifdef TRAN_Orig
2268 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2269 {
2274 {
2275 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2278 }
2279 ideal arg1 = (ideal)
h->Data();
2286 }
2287 else
2288 #endif
2289 #endif
2290
2291 #ifdef HAVE_WALK
2292 if (strcmp(sys_cmd, "MAltwalk2") == 0)
2293 {
2298 {
2299 Werror(
"system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2302 }
2303 ideal arg1 = (ideal)
h->Data();
2310 }
2311 else
2312 #endif
2313
2314 #ifdef HAVE_WALK
2315 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2316 {
2321 {
2322 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2325 }
2326 ideal arg1 = (ideal)
h->Data();
2329 int arg4 = (int) ((
long)(
h->next->next->next->Data()));
2334 }
2335 else
2336 #endif
2337
2338 #if 0
2339 #ifdef HAVE_WALK
2340 if (strcmp(sys_cmd, "TranMrImprovwalk") == 0)
2341 {
2345 h->next->next->next ==
NULL ||
h->next->next->next->Typ() !=
INT_CMD ||
2346 h->next->next->next ==
NULL ||
h->next->next->next->next->Typ() !=
INT_CMD ||
2347 h->next->next->next ==
NULL ||
h->next->next->next->next->next->Typ() !=
INT_CMD)
2348 {
2349 WerrorS(
"system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2351 }
2354 {
2355 Werror(
"system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n",
currRing->N);
2357 }
2358 ideal arg1 = (ideal)
h->Data();
2361 int arg4 = (int)(
long)
h->next->next->next->Data();
2362 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2363 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2364 ideal
result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2368 }
2369 else
2370 #endif
2371 #endif
2372
2373 {
2374 #ifndef MAKE_DISTRIBUTION
2376 #else
2378 #endif
2379 }
2380 }
2382}
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 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)