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 }
443 {
444 Werror(
"expected system(\"verifyGB\",<ideal/module>), found <%s>",
Tok2Cmdname(
h->Typ()));
446 }
447 ideal F=(ideal)
h->Data();
448 #ifdef HAVE_VSPACE
450 if (cpus>1)
452 else
453 #endif
457 }
458 else
459
460 if(strcmp(sys_cmd,"rcolon") == 0)
461 {
464 {
465 ideal
i = (ideal)
h->Data();
467 poly
w=(poly)
h->Data();
469 int lV = (int)(
long)
h->Data();
473 }
474 else
476 }
477 else
478
479
480 if(strcmp(sys_cmd,"sh")==0)
481 {
483 {
484 WerrorS(
"shell execution is disallowed in restricted mode");
486 }
488 if (
h==
NULL)
res->data = (
void *)(
long) system(
"sh");
490 res->data = (
void*)(
long) system((
char*)(
h->Data()));
491 else
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 }
753 {
754 WerrorS(
"Need string or int argument to set option value");
756 }
757 const char* errormsg;
759 {
761 {
762 Werror(
"Need string argument to set value of option %s", sys_cmd);
764 }
766 if (errormsg !=
NULL)
767 Werror(
"Option '--%s=%d' %s", sys_cmd, (
int) ((
long)
h->Data()), errormsg);
768 }
769 else
770 {
772 if (errormsg !=
NULL)
773 Werror(
"Option '--%s=%s' %s", sys_cmd, (
char*)
h->Data(), errormsg);
774 }
777 }
778 else
779
780 if (strcmp(sys_cmd,"HC")==0)
781 {
785 }
786 else
787
788 if(strcmp(sys_cmd,"random")==0)
789 {
792 {
794 {
799 }
800 else
801 {
803 }
804 }
808 }
809 else
810
811 if (strcmp(sys_cmd,"denom_list")==0)
812 {
817 }
818 else
819
820 if(strcmp(sys_cmd,"complexNearZero")==0)
821 {
824 {
826 {
827 WerrorS(
"unsupported ground field!");
829 }
830 else
831 {
834 (int)((
long)(
h->next->Data())));
836 }
837 }
838 else
839 {
841 }
842 }
843 else
844
845 if(strcmp(sys_cmd,"getPrecDigits")==0)
846 {
849 {
850 WerrorS(
"unsupported ground field!");
852 }
855
856
858 }
859 else
860
861 if(strcmp(sys_cmd, "lduDecomp")==0)
862 {
865 {
868 poly
l; poly u; poly prodLU;
869 lduDecomp(aMat, pMat, lMat, dMat, uMat,
l, u, prodLU);
880 res->data = (
char *)L;
882 }
883 else
884 {
886 }
887 }
888 else
889
890 if(strcmp(sys_cmd, "lduSolve")==0)
891 {
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
912 {
914 }
916 {
919 }
924 poly
l = (poly)
h->next->next->next->next->Data();
925 poly u = (poly)
h->next->next->next->next->next->Data();
926 poly lTimesU = (poly)
h->next->next->next->next->next->next->Data();
927 matrix bVec = (
matrix)
h->next->next->next->next->next->next->next->Data();
930 {
931 Werror(
"first matrix (%d x %d) is not quadratic",
934 }
936 {
937 Werror(
"second matrix (%d x %d) is not quadratic",
940 }
942 {
943 Werror(
"third matrix (%d x %d) is not quadratic",
946 }
948 {
949 Werror(
"third matrix (%d x %d) and fourth matrix (%d x %d) %s",
951 "do not t");
953 }
955 {
956 Werror(
"fourth matrix (%d x %d) and vector (%d x 1) do not fit",
959 }
961 bVec, xVec, homogSolSpace);
962
963
964
966 if (solvable)
967 {
972 }
973 else
974 {
977 }
981 }
982 else
983
984 if (strcmp(sys_cmd, "shared") == 0)
985 {
986 #ifndef SI_COUNTEDREF_AUTOLOAD
989 #endif
992 }
993 else if (strcmp(sys_cmd, "reference") == 0)
994 {
995 #ifndef SI_COUNTEDREF_AUTOLOAD
998 #endif
1001 }
1002 else
1003
1004#ifdef HAVE_SIMPLEIPC
1005 if (strcmp(sys_cmd,"semaphore")==0)
1006 {
1008 {
1010 if ((
h->next->next!=
NULL)&& (
h->next->next->Typ()==
INT_CMD))
1011 v=(int)(
long)
h->next->next->Data();
1015 }
1016 else
1017 {
1018 WerrorS(
"Usage: system(\"semaphore\",<cmd>,int)");
1020 }
1021 }
1022 else
1023#endif
1024
1025 if (strcmp(sys_cmd,"reserve")==0)
1026 {
1029 {
1032 res->data=(
void*)(
long)
p;
1034 }
1036 }
1037 else
1038
1039 if (strcmp(sys_cmd,"reservedLink")==0)
1040 {
1045 }
1046 else
1047
1048 if (strcmp(sys_cmd,"install")==0)
1049 {
1052 {
1054 (
int)(
long)
h->next->next->next->Data(),
1056 }
1058 }
1059 else
1060
1061 if (strcmp(sys_cmd,"newstruct")==0)
1062 {
1065 {
1066 int id=0;
1067 char *n=(
char*)
h->Data();
1069 if (id>0)
1070 {
1073 {
1074 newstruct_desc desc=(newstruct_desc)bb->data;
1077 }
1078 else Werror(
"'%s' is not a newstruct",n);
1079 }
1080 else Werror(
"'%s' is not a blackbox object",n);
1081 }
1083 }
1084 else
1085
1086 if (strcmp(sys_cmd,"blackbox")==0)
1087 {
1090 }
1091 else
1092
1093 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1094 if (strcmp(sys_cmd, "absFact") == 0)
1095 {
1100 {
1104 int n= 0;
1111 l->m[0].data=(
void *)
f;
1113 l->m[1].data=(
void *)
v;
1115 l->m[2].data=(
void*) mipos;
1117 l->m[3].data=(
void*) (
long) n;
1118 res->data=(
void *)
l;
1120 }
1122 }
1123 else
1124 #endif
1125
1126 #ifdef HAVE_NTL
1127 if (strcmp(sys_cmd, "LLL") == 0)
1128 {
1130 {
1133 {
1136 }
1138 {
1141 }
1143 }
1145 }
1146 else
1147 #endif
1148
1149 #ifdef HAVE_FLINT
1150 #if __FLINT_RELEASE >= 20500
1151 if (strcmp(sys_cmd, "LLL_Flint") == 0)
1152 {
1154 {
1156 {
1159 {
1162 }
1164 {
1167 }
1169 }
1171 {
1172 WerrorS(
"matrix,int or bigint,int expected");
1174 }
1176 {
1177 if(((
int)((
long)(
h->next->Data())) != 0) && (
int)((
long)(
h->next->Data()) != 1))
1178 {
1179 WerrorS(
"int is different from 0, 1");
1181 }
1183 if((
long)(
h->next->Data()) == 0)
1184 {
1186 {
1189 }
1191 {
1194 }
1196 }
1197
1198 if((
long)(
h->next->Data()) == 1)
1199 {
1201 {
1204 for(
int i = 1;
i<=
m->rows();
i++)
1205 {
1208 }
1217 }
1219 {
1222 for(
int i = 1;
i<=
m->rows();
i++)
1232 }
1234 }
1235 }
1236
1237 }
1239 }
1240 else
1241 #endif
1242 #endif
1243
1244 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1245 if(strcmp(sys_cmd,"rref")==0)
1246 {
1250 {
1252 #if defined(HAVE_FLINT)
1254 #elif defined(HAVE_NTL)
1256 #endif
1259 }
1261 {
1262 ideal
M=(ideal)
h->Data();
1263 #if defined(HAVE_FLINT)
1265 #elif defined(HAVE_NTL)
1267 #endif
1270 }
1271 else
1272 {
1273 WerrorS(
"expected system(\"rref\",<matrix>/<smatrix>)");
1275 }
1276 }
1277 else
1278 #endif
1279
1280 #ifdef HAVE_PCV
1281 if(strcmp(sys_cmd,"pcvLAddL")==0)
1282 {
1284 }
1285 else
1286 if(strcmp(sys_cmd,"pcvPMulL")==0)
1287 {
1289 }
1290 else
1291 if(strcmp(sys_cmd,"pcvMinDeg")==0)
1292 {
1294 }
1295 else
1296 if(strcmp(sys_cmd,"pcvP2CV")==0)
1297 {
1299 }
1300 else
1301 if(strcmp(sys_cmd,"pcvCV2P")==0)
1302 {
1304 }
1305 else
1306 if(strcmp(sys_cmd,"pcvDim")==0)
1307 {
1309 }
1310 else
1311 if(strcmp(sys_cmd,"pcvBasis")==0)
1312 {
1314 }
1315 else
1316 #endif
1317
1318 #ifdef HAVE_EIGENVAL
1319 if(strcmp(sys_cmd,"hessenberg")==0)
1320 {
1322 }
1323 else
1324 #endif
1325
1326 #ifdef HAVE_EIGENVAL
1327 if(strcmp(sys_cmd,"eigenvals")==0)
1328 {
1330 }
1331 else
1332 #endif
1333
1334 #ifdef HAVE_EIGENVAL
1335 if(strcmp(sys_cmd,"rowelim")==0)
1336 {
1338 }
1339 else
1340 #endif
1341
1342 #ifdef HAVE_EIGENVAL
1343 if(strcmp(sys_cmd,"rowcolswap")==0)
1344 {
1346 }
1347 else
1348 #endif
1349
1350 #ifdef HAVE_GMS
1351 if(strcmp(sys_cmd,"gmsnf")==0)
1352 {
1354 }
1355 else
1356 #endif
1357
1358 if(strcmp(sys_cmd,"contributors") == 0)
1359 {
1362 "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");
1364 }
1365 else
1366
1367 #ifdef HAVE_SPECTRUM
1368 if(strcmp(sys_cmd,"spectrum") == 0)
1369 {
1371 {
1374 }
1378 {
1381 }
1382 if(((
long)
h->next->Data())==1L)
1385 }
1386 else
1387
1388 if(strcmp(sys_cmd,"semic") == 0)
1389 {
1393 {
1394 if (
h->next->next==
NULL)
1396 else if (
h->next->next->Typ()==
INT_CMD)
1398 }
1400 }
1401 else
1402
1403 if(strcmp(sys_cmd,"spadd") == 0)
1404 {
1407 {
1409 }
1411 }
1412 else
1413
1414 if(strcmp(sys_cmd,"spmul") == 0)
1415 {
1418 {
1420 }
1422 }
1423 else
1424 #endif
1425
1426 #define HAVE_SHEAFCOH_TRICKS 1
1427
1428 #ifdef HAVE_SHEAFCOH_TRICKS
1429 if(strcmp(sys_cmd,"tensorModuleMult")==0)
1430 {
1432
1434 {
1435 int m = (int)( (
long)
h->Data() );
1436 ideal
M = (ideal)
h->next->Data();
1440 }
1442 }
1443 else
1444 #endif
1445
1446 #ifdef HAVE_PLURAL
1447 if (strcmp(sys_cmd, "twostd") == 0)
1448 {
1449 ideal I;
1451 {
1452 I=(ideal)
h->CopyD();
1458 }
1461 }
1462 else
1463 #endif
1464
1465 #ifdef HAVE_PLURAL
1466 if (strcmp(sys_cmd, "bracket") == 0)
1467 {
1470 {
1471 poly
p=(poly)
h->CopyD();
1473 poly q=(poly)
h->Data();
1477 }
1479 }
1480 else
1481 #endif
1482
1483 #ifdef HAVE_PLURAL
1484 if (strcmp(sys_cmd, "env")==0)
1485 {
1487 {
1488 ring r = (ring)
h->Data();
1492 }
1493 else
1494 {
1495 WerrorS(
"`system(\"env\",<ring>)` expected");
1497 }
1498 }
1499 else
1500 #endif
1501
1502 #ifdef HAVE_PLURAL
1503 if (strcmp(sys_cmd, "opp")==0)
1504 {
1506 {
1507 ring r=(ring)
h->Data();
1511 }
1512 else
1513 {
1514 WerrorS(
"`system(\"opp\",<ring>)` expected");
1516 }
1517 }
1518 else
1519 #endif
1520
1521 #ifdef HAVE_PLURAL
1522 if (strcmp(sys_cmd, "oppose")==0)
1523 {
1525 && (
h->next!=
NULL))
1526 {
1527 ring Rop = (ring)
h->Data();
1531 {
1536 }
1537 }
1538 else
1539 {
1540 WerrorS(
"`system(\"oppose\",<ring>,<poly>)` expected");
1542 }
1543 }
1544 else
1545 #endif
1546
1547 if(strcmp(sys_cmd,"sat")==0)
1548 {
1549 ideal I= (ideal)
h->Data();
1550 ideal J=(ideal)
h->next->Data();
1557 }
1558 else
1559
1560
1561 #ifdef HAVE_WALK
1562 #ifdef OWNW
1563 if (strcmp(sys_cmd, "walkNextWeight") == 0)
1564 {
1569 {
1570 Werror(
"system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1573 }
1574 res->data = (
void*) walkNextWeight(((
intvec*)
h->Data()),
1576 (ideal)
h->next->next->Data());
1577 if (
res->data ==
NULL ||
res->data == (
void*) 1L)
1578 {
1580 }
1581 else
1582 {
1584 }
1586 }
1587 else
1588 #endif
1589 #endif
1590
1591 #ifdef HAVE_WALK
1592 #ifdef OWNW
1593 if (strcmp(sys_cmd, "walkInitials") == 0)
1594 {
1596 {
1597 WerrorS(
"system(\"walkInitials\", ideal) expected");
1599 }
1600 res->data = (
void*) walkInitials((ideal)
h->Data());
1603 }
1604 else
1605 #endif
1606 #endif
1607
1608 #ifdef HAVE_WALK
1609 #ifdef WAIV
1610 if (strcmp(sys_cmd, "walkAddIntVec") == 0)
1611 {
1616 res->data = (
intvec*) walkAddIntVec(arg1, arg2);
1619 }
1620 else
1621 #endif
1622 #endif
1623
1624 #ifdef HAVE_WALK
1625 #ifdef MwaklNextWeight
1626 if (strcmp(sys_cmd, "MwalkNextWeight") == 0)
1627 {
1632 {
1633 Werror(
"system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1636 }
1639 ideal arg3 = (ideal)
h->next->next->Data();
1644 }
1645 else
1646 #endif
1647 #endif
1648
1649 #ifdef HAVE_WALK
1650 if(strcmp(sys_cmd, "Mivdp") == 0)
1651 {
1653 {
1654 WerrorS(
"system(\"Mivdp\", int) expected");
1656 }
1657 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1658 {
1659 Werror(
"system(\"Mivdp\" ...) intvecs not of length %d\n",
1662 }
1663 int arg1 = (int) ((
long)(
h->Data()));
1668 }
1669 else
1670 #endif
1671
1672 #ifdef HAVE_WALK
1673 if(strcmp(sys_cmd, "Mivlp") == 0)
1674 {
1676 {
1677 WerrorS(
"system(\"Mivlp\", int) expected");
1679 }
1680 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1681 {
1682 Werror(
"system(\"Mivlp\" ...) intvecs not of length %d\n",
1685 }
1686 int arg1 = (int) ((
long)(
h->Data()));
1691 }
1692 else
1693 #endif
1694
1695 #ifdef HAVE_WALK
1696 #ifdef MpDiv
1697 if(strcmp(sys_cmd, "MpDiv") == 0)
1698 {
1701 poly arg1 = (poly)
h->Data();
1702 poly arg2 = (poly)
h->next->Data();
1703 poly
result = MpDiv(arg1, arg2);
1707 }
1708 else
1709 #endif
1710 #endif
1711
1712 #ifdef HAVE_WALK
1713 #ifdef MpMult
1714 if(strcmp(sys_cmd, "MpMult") == 0)
1715 {
1718 poly arg1 = (poly)
h->Data();
1719 poly arg2 = (poly)
h->next->Data();
1720 poly
result = MpMult(arg1, arg2);
1724 }
1725 else
1726 #endif
1727 #endif
1728
1729 #ifdef HAVE_WALK
1730 if (strcmp(sys_cmd, "MivSame") == 0)
1731 {
1734
1735
1736
1737
1738
1739
1740
1741
1742
1745
1746
1747
1748
1749
1751 res->data = (
void*)(
long)
MivSame(arg1, arg2);
1753 }
1754 else
1755 #endif
1756
1757 #ifdef HAVE_WALK
1758 if (strcmp(sys_cmd, "M3ivSame") == 0)
1759 {
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1775
1776
1777
1778
1779
1781 res->data = (
void*)(
long)
M3ivSame(arg1, arg2, arg3);
1783 }
1784 else
1785 #endif
1786
1787 #ifdef HAVE_WALK
1788 if(strcmp(sys_cmd, "MwalkInitialForm") == 0)
1789 {
1793 {
1794 Werror(
"system \"MwalkInitialForm\"...) intvec not of length %d\n",
1797 }
1798 ideal
id = (ideal)
h->Data();
1804 }
1805 else
1806 #endif
1807
1808 #ifdef HAVE_WALK
1809
1810 if(strcmp(sys_cmd, "MivMatrixOrder") == 0)
1811 {
1813 {
1814 WerrorS(
"system(\"MivMatrixOrder\",intvec) expected");
1816 }
1822 }
1823 else
1824 #endif
1825
1826 #ifdef HAVE_WALK
1827 if(strcmp(sys_cmd, "MivMatrixOrderdp") == 0)
1828 {
1830 {
1831 WerrorS(
"system(\"MivMatrixOrderdp\",intvec) expected");
1833 }
1834 int arg1 = (int) ((
long)(
h->Data()));
1839 }
1840 else
1841 #endif
1842
1843 #ifdef HAVE_WALK
1844 if(strcmp(sys_cmd, "MPertVectors") == 0)
1845 {
1848 ideal arg1 = (ideal)
h->Data();
1850 int arg3 = (int) ((
long)(
h->next->next->Data()));
1855 }
1856 else
1857 #endif
1858
1859 #ifdef HAVE_WALK
1860 if(strcmp(sys_cmd, "MPertVectorslp") == 0)
1861 {
1864 ideal arg1 = (ideal)
h->Data();
1866 int arg3 = (int) ((
long)(
h->next->next->Data()));
1871 }
1872 else
1873 #endif
1874
1875 #ifdef HAVE_WALK
1876 if(strcmp(sys_cmd, "Mfpertvector") == 0)
1877 {
1880 ideal arg1 = (ideal)
h->Data();
1886 }
1887 else
1888 #endif
1889
1890 #ifdef HAVE_WALK
1891 if(strcmp(sys_cmd, "MivUnit") == 0)
1892 {
1895 int arg1 = (int) ((
long)(
h->Data()));
1900 }
1901 else
1902 #endif
1903
1904 #ifdef HAVE_WALK
1905 if(strcmp(sys_cmd, "MivWeightOrderlp") == 0)
1906 {
1914 }
1915 else
1916 #endif
1917
1918 #ifdef HAVE_WALK
1919 if(strcmp(sys_cmd, "MivWeightOrderdp") == 0)
1920 {
1922 {
1923 WerrorS(
"system(\"MivWeightOrderdp\",intvec) expected");
1925 }
1927
1932 }
1933 else
1934 #endif
1935
1936 #ifdef HAVE_WALK
1937 if(strcmp(sys_cmd, "MivMatrixOrderlp") == 0)
1938 {
1940 {
1941 WerrorS(
"system(\"MivMatrixOrderlp\",int) expected");
1943 }
1944 int arg1 = (int) ((
long)(
h->Data()));
1949 }
1950 else
1951 #endif
1952
1953 #ifdef HAVE_WALK
1954 if (strcmp(sys_cmd, "MkInterRedNextWeight") == 0)
1955 {
1960 {
1961 Werror(
"system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1964 }
1967 ideal arg3 = (ideal)
h->next->next->Data();
1972 }
1973 else
1974 #endif
1975
1976 #ifdef HAVE_WALK
1977 #ifdef MPertNextWeight
1978 if (strcmp(sys_cmd, "MPertNextWeight") == 0)
1979 {
1983 {
1984 Werror(
"system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1987 }
1989 ideal arg2 = (ideal)
h->next->Data();
1990 int arg3 = (int)
h->next->next->Data();
1995 }
1996 else
1997 #endif
1998 #endif
1999
2000 #ifdef HAVE_WALK
2001 #ifdef Mivperttarget
2002 if (strcmp(sys_cmd, "Mivperttarget") == 0)
2003 {
2006 ideal arg1 = (ideal)
h->Data();
2007 int arg2 = (int)
h->next->Data();
2012 }
2013 else
2014 #endif
2015 #endif
2016
2017 #ifdef HAVE_WALK
2018 if (strcmp(sys_cmd, "Mwalk") == 0)
2019 {
2024 {
2025 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d\n",
2028 }
2029 ideal arg1 = (ideal)
h->CopyD();
2032 ring arg4 = (ring)
h->next->next->next->Data();
2033 int arg5 = (int) (
long)
h->next->next->next->next->Data();
2034 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2035 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2039 }
2040 else
2041 #endif
2042
2043 #ifdef HAVE_WALK
2044 #ifdef MPWALK_ORIG
2045 if (strcmp(sys_cmd, "Mwalk") == 0)
2046 {
2053 {
2054 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2057 }
2058 ideal arg1 = (ideal)
h->Data();
2061 ring arg4 = (ring)
h->next->next->next->Data();
2062 ideal
result = (ideal)
Mwalk(arg1, arg2, arg3,arg4);
2066 }
2067 else
2068 #else
2069 if (strcmp(sys_cmd, "Mpwalk") == 0)
2070 {
2075 {
2076 Werror(
"system(\"Mpwalk\" ...) intvecs not of length %d\n",
currRing->N);
2078 }
2079 ideal arg1 = (ideal)
h->Data();
2080 int arg2 = (int) (
long)
h->next->Data();
2081 int arg3 = (int) (
long)
h->next->next->Data();
2084 int arg6 = (int) (
long)
h->next->next->next->next->next->Data();
2085 int arg7 = (int) (
long)
h->next->next->next->next->next->next->Data();
2086 int arg8 = (int) (
long)
h->next->next->next->next->next->next->next->Data();
2087 ideal
result = (ideal)
Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2091 }
2092 else
2093 #endif
2094 #endif
2095
2096 #ifdef HAVE_WALK
2097 if (strcmp(sys_cmd, "Mrwalk") == 0)
2098 {
2105 {
2106 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2109 }
2110 ideal arg1 = (ideal)
h->Data();
2113 int arg4 = (int)(
long)
h->next->next->next->Data();
2114 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2115 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2116 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2117 ideal
result = (ideal)
Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2121 }
2122 else
2123 #endif
2124
2125 #ifdef HAVE_WALK
2126 if (strcmp(sys_cmd, "MAltwalk1") == 0)
2127 {
2132 {
2133 Werror(
"system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2136 }
2137 ideal arg1 = (ideal)
h->Data();
2138 int arg2 = (int) ((
long)(
h->next->Data()));
2139 int arg3 = (int) ((
long)(
h->next->next->Data()));
2146 }
2147 else
2148 #endif
2149
2150 #ifdef HAVE_WALK
2151 #ifdef MFWALK_ALT
2152 if (strcmp(sys_cmd, "Mfwalk_alt") == 0)
2153 {
2158 {
2159 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2162 }
2163 ideal arg1 = (ideal)
h->Data();
2166 int arg4 = (int)
h->next->next->next->Data();
2167 ideal
result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2171 }
2172 else
2173 #endif
2174 #endif
2175
2176 #ifdef HAVE_WALK
2177 if (strcmp(sys_cmd, "Mfwalk") == 0)
2178 {
2183 {
2184 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2187 }
2188 ideal arg1 = (ideal)
h->Data();
2191 int arg4 = (int)(
long)
h->next->next->next->Data();
2192 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2193 ideal
result = (ideal)
Mfwalk(arg1, arg2, arg3, arg4, arg5);
2197 }
2198 else
2199 #endif
2200
2201 #ifdef HAVE_WALK
2202 if (strcmp(sys_cmd, "Mfrwalk") == 0)
2203 {
2206
2207
2208
2209
2210
2211
2212
2213
2218 {
2219 Werror(
"system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2222 }
2223
2224 ideal arg1 = (ideal)
h->Data();
2227 int arg4 = (int)(
long)
h->next->next->next->Data();
2228 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2229 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2230 ideal
result = (ideal)
Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2234 }
2235 else
2236
2237 if (strcmp(sys_cmd, "Mprwalk") == 0)
2238 {
2245 {
2246 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2249 }
2250 ideal arg1 = (ideal)
h->Data();
2253 int arg4 = (int)(
long)
h->next->next->next->Data();
2254 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2255 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2256 int arg7 = (int)(
long)
h->next->next->next->next->next->next->Data();
2257 int arg8 = (int)(
long)
h->next->next->next->next->next->next->next->Data();
2258 int arg9 = (int)(
long)
h->next->next->next->next->next->next->next->next->Data();
2259 ideal
result = (ideal)
Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2263 }
2264 else
2265 #endif
2266
2267 #ifdef HAVE_WALK
2268 #ifdef TRAN_Orig
2269 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2270 {
2275 {
2276 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2279 }
2280 ideal arg1 = (ideal)
h->Data();
2287 }
2288 else
2289 #endif
2290 #endif
2291
2292 #ifdef HAVE_WALK
2293 if (strcmp(sys_cmd, "MAltwalk2") == 0)
2294 {
2299 {
2300 Werror(
"system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2303 }
2304 ideal arg1 = (ideal)
h->Data();
2311 }
2312 else
2313 #endif
2314
2315 #ifdef HAVE_WALK
2316 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2317 {
2322 {
2323 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2326 }
2327 ideal arg1 = (ideal)
h->Data();
2330 int arg4 = (int) ((
long)(
h->next->next->next->Data()));
2335 }
2336 else
2337 #endif
2338
2339 #if 0
2340 #ifdef HAVE_WALK
2341 if (strcmp(sys_cmd, "TranMrImprovwalk") == 0)
2342 {
2346 h->next->next->next ==
NULL ||
h->next->next->next->Typ() !=
INT_CMD ||
2347 h->next->next->next ==
NULL ||
h->next->next->next->next->Typ() !=
INT_CMD ||
2348 h->next->next->next ==
NULL ||
h->next->next->next->next->next->Typ() !=
INT_CMD)
2349 {
2350 WerrorS(
"system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2352 }
2355 {
2356 Werror(
"system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n",
currRing->N);
2358 }
2359 ideal arg1 = (ideal)
h->Data();
2362 int arg4 = (int)(
long)
h->next->next->next->Data();
2363 int arg5 = (int)(
long)
h->next->next->next->next->Data();
2364 int arg6 = (int)(
long)
h->next->next->next->next->next->Data();
2365 ideal
result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2369 }
2370 else
2371 #endif
2372 #endif
2373
2374 {
2375 #ifndef MAKE_DISTRIBUTION
2377 #else
2379 #endif
2380 }
2381 }
2383}
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)