20#include "ccluster/ccluster.h"
23#include "factory/factory.h"
25#ifdef TIME_WITH_SYS_TIME
27# ifdef HAVE_SYS_TIME_H
31# ifdef HAVE_SYS_TIME_H
37#ifdef HAVE_SYS_TIMES_H
141#ifndef MAKE_DISTRIBUTION
142#define HAVE_EXTENDED_SYSTEM 1
167#ifndef MAKE_DISTRIBUTION
183 for (
int i = 0 ;
i < n;
i++)
186 for (
int r = 0; r < n; r++)
187 for (
int c = 0; c < n; c++)
262 r = (
ring)
h->Data();
286 t.it_value.tv_sec =(
unsigned)((
unsigned long)
h->Data());
300 poly
p=(poly)
h->CopyD();
318 #ifdef _SC_NPROCESSORS_ONLN
320 #elif defined(_SC_NPROCESSORS_CONF)
398 WerrorS(
"nc_Hilb:ideal expected");
403 lV = (
int)(
long)
h->Data();
406 WerrorS(
"nc_Hilb:int expected");
412 if((
int)(
long)
h->Data() == 1)
414 else if((
int)(
long)
h->Data() == 2)
424 WerrorS(
"nc_Hilb:int 1,2, total degree for the truncation, and a string for printing the details are expected");
437 WerrorS(
"system(\"verifyGB\",<ideal>,..) expects a commutative ring");
443 Werror(
"expected system(\"verifyGB\",<ideal/module>), found <%s>",
Tok2Cmdname(
h->Typ()));
466 poly
w=(poly)
h->Data();
468 int lV = (
int)(
long)
h->Data();
483 WerrorS(
"shell execution is disallowed in restricted mode");
489 res->data = (
void*)(
long)
system((
char*)(
h->Data()));
507 p = (poly)
h->CopyD();
517 int bound = (
int)(
long)
h->next->next->Data();
544 #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
545 char *
s=(
char *)
h->Data();
558 #ifdef TEST_MAC_ORDER
563 #ifdef HAVE_DYNAMIC_LOADING
609 const char *r=
getenv((
char *)
h->Data());
629 setenv((
char *)
h->Data(), (
char *)
h->next->Data(), 1);
639 WerrorS(
"setenv not supported on this platform");
667 if (r ==
NULL) r=
"/usr/local";
670 #define SINGULAR_PROCS_DIR "/libexec/singular/MOD"
709 res->data = (
void*)
s;
725 WerrorS(
"Use 'system(\"--\");' for listing of available options");
756 Werror(
"Need string argument to set value of option %s",
sys_cmd);
771 WerrorS(
"Need string or int argument to set option value");
826 WerrorS(
"unsupported ground field!");
833 (
int)((
long)(
h->next->Data())));
849 WerrorS(
"unsupported ground field!");
879 res->data = (
char *)L;
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();
930 Werror(
"first matrix (%d x %d) is not quadratic",
936 Werror(
"second matrix (%d x %d) is not quadratic",
942 Werror(
"third matrix (%d x %d) is not quadratic",
948 Werror(
"third matrix (%d x %d) and fourth matrix (%d x %d) %s",
955 Werror(
"fourth matrix (%d x %d) and vector (%d x 1) do not fit",
985 #ifndef SI_COUNTEDREF_AUTOLOAD
994 #ifndef SI_COUNTEDREF_AUTOLOAD
1003#ifdef HAVE_SIMPLEIPC
1009 if ((
h->next->next!=
NULL)&& (
h->next->next->Typ()==
INT_CMD))
1010 v=(
int)(
long)
h->next->next->Data();
1017 WerrorS(
"Usage: system(\"semaphore\",<cmd>,int)");
1031 res->data=(
void*)(
long)
p;
1053 (
int)(
long)
h->next->next->next->Data(),
1066 char *n=(
char*)
h->Data();
1077 else Werror(
"'%s' is not a newstruct",n);
1079 else Werror(
"'%s' is not a blackbox object",n);
1092 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
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;
1149 #if __FLINT_RELEASE >= 20500
1171 WerrorS(
"matrix,int or bigint,int expected");
1176 if(((
int)((
long)(
h->next->Data())) != 0) && (
int)((
long)(
h->next->Data()) != 1))
1178 WerrorS(
"int is different from 0, 1");
1182 if((
long)(
h->next->Data()) == 0)
1197 if((
long)(
h->next->Data()) == 1)
1203 for(
int i = 1;
i<=
m->rows();
i++)
1221 for(
int i = 1;
i<=
m->rows();
i++)
1243 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1251 #if defined(HAVE_FLINT)
1253 #elif defined(HAVE_NTL)
1262 #if defined(HAVE_FLINT)
1264 #elif defined(HAVE_NTL)
1272 WerrorS(
"expected system(\"rref\",<matrix>/<smatrix>)");
1317 #ifdef HAVE_EIGENVAL
1325 #ifdef HAVE_EIGENVAL
1333 #ifdef HAVE_EIGENVAL
1341 #ifdef HAVE_EIGENVAL
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");
1366 #ifdef HAVE_SPECTRUM
1381 if(((
long)
h->next->Data())==1L)
1393 if (
h->next->next==
NULL)
1395 else if (
h->next->next->Typ()==
INT_CMD)
1425 #define HAVE_SHEAFCOH_TRICKS 1
1427 #ifdef HAVE_SHEAFCOH_TRICKS
1434 int m = (
int)( (
long)
h->Data() );
1470 poly
p=(poly)
h->CopyD();
1472 poly q=(poly)
h->Data();
1494 WerrorS(
"`system(\"env\",<ring>)` expected");
1513 WerrorS(
"`system(\"opp\",<ring>)` expected");
1524 && (
h->next!=
NULL))
1539 WerrorS(
"`system(\"oppose\",<ring>,<poly>)` expected");
1569 Werror(
"system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1575 (
ideal)
h->next->next->Data());
1576 if (
res->data ==
NULL ||
res->data == (
void*) 1L)
1596 WerrorS(
"system(\"walkInitials\", ideal) expected");
1624 #ifdef MwaklNextWeight
1632 Werror(
"system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1653 WerrorS(
"system(\"Mivdp\", int) expected");
1656 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1658 Werror(
"system(\"Mivdp\" ...) intvecs not of length %d\n",
1662 int arg1 = (
int) ((
long)(
h->Data()));
1676 WerrorS(
"system(\"Mivlp\", int) expected");
1679 if ((
int) ((
long)(
h->Data())) !=
currRing->N)
1681 Werror(
"system(\"Mivlp\" ...) intvecs not of length %d\n",
1685 int arg1 = (
int) ((
long)(
h->Data()));
1700 poly arg1 = (poly)
h->Data();
1701 poly arg2 = (poly)
h->next->Data();
1717 poly arg1 = (poly)
h->Data();
1718 poly arg2 = (poly)
h->next->Data();
1750 res->data = (
void*)(
long)
MivSame(arg1, arg2);
1780 res->data = (
void*)(
long)
M3ivSame(arg1, arg2, arg3);
1793 Werror(
"system \"MwalkInitialForm\"...) intvec not of length %d\n",
1813 WerrorS(
"system(\"MivMatrixOrder\",intvec) expected");
1830 WerrorS(
"system(\"MivMatrixOrderdp\",intvec) expected");
1833 int arg1 = (
int) ((
long)(
h->Data()));
1849 int arg3 = (
int) ((
long)(
h->next->next->Data()));
1865 int arg3 = (
int) ((
long)(
h->next->next->Data()));
1894 int arg1 = (
int) ((
long)(
h->Data()));
1922 WerrorS(
"system(\"MivWeightOrderdp\",intvec) expected");
1940 WerrorS(
"system(\"MivMatrixOrderlp\",int) expected");
1943 int arg1 = (
int) ((
long)(
h->Data()));
1960 Werror(
"system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1976 #ifdef MPertNextWeight
1983 Werror(
"system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1989 int arg3 = (
int)
h->next->next->Data();
2000 #ifdef Mivperttarget
2006 int arg2 = (
int)
h->next->Data();
2024 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d\n",
2032 int arg5 = (
int) (
long)
h->next->next->next->next->Data();
2033 int arg6 = (
int) (
long)
h->next->next->next->next->next->Data();
2053 Werror(
"system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2075 Werror(
"system(\"Mpwalk\" ...) intvecs not of length %d\n",
currRing->N);
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();
2105 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
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();
2132 Werror(
"system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2137 int arg2 = (
int) ((
long)(
h->next->Data()));
2138 int arg3 = (
int) ((
long)(
h->next->next->Data()));
2158 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2165 int arg4 = (
int)
h->next->next->next->Data();
2183 Werror(
"system(\"Mfwalk\" ...) intvecs not of length %d\n",
2190 int arg4 = (
int)(
long)
h->next->next->next->Data();
2191 int arg5 = (
int)(
long)
h->next->next->next->next->Data();
2218 Werror(
"system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
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();
2245 Werror(
"system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
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();
2275 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2299 Werror(
"system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2322 Werror(
"system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2329 int arg4 = (
int) ((
long)(
h->next->next->next->Data()));
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)
2349 WerrorS(
"system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2355 Werror(
"system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n",
currRing->N);
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();
2374 #ifndef MAKE_DISTRIBUTION
2385#ifdef HAVE_EXTENDED_SYSTEM
2389# include "hc_newton.h"
2403 const char *
s=(
const char *)
h->Data();
2404 if (
strcmp(
s,
"posInT_EcartFDegpLength")==0)
2406 else if (
strcmp(
s,
"posInT_FDegpLength")==0)
2408 else if (
strcmp(
s,
"posInT_pLength")==0)
2410 else if (
strcmp(
s,
"posInT0")==0)
2412 else if (
strcmp(
s,
"posInT1")==0)
2414 else if (
strcmp(
s,
"posInT2")==0)
2416 else if (
strcmp(
s,
"posInT11")==0)
2418 else if (
strcmp(
s,
"posInT110")==0)
2420 else if (
strcmp(
s,
"posInT13")==0)
2422 else if (
strcmp(
s,
"posInT15")==0)
2424 else if (
strcmp(
s,
"posInT17")==0)
2426 else if (
strcmp(
s,
"posInT17_c")==0)
2428 else if (
strcmp(
s,
"posInT19")==0)
2430 else PrintS(
"valid posInT:0,1,2,11,110,13,15,17,17_c,19,_EcartFDegpLength,_FDegpLength,_pLength,_EcartpLength\n");
2447 poly
f=(poly)
h->Data();
2452 int n=(
int)((
long)
h->Data());
2522 WarnS(
"Sorry: not available for release build!");
2532 int k = (
int)(
long)
h->Data();
2545 WarnS(
"Sorry: not available for release build!");
2561 for (
int i = 1;
i <=
varN;
i++)
2569 res->data = (
void*)0L;
2585 char *
fn=(
char*)
h->Data();
2588 Warn(
"Can not open %s for writing og mtrack. Using stdout",
fn);
2601 WerrorS(
"system(\"mtrack\",..) is not implemented in this version");
2616#if !defined(OM_NDEBUG)
2622 PrintS(
"\n[om_Info]: \n");
2624#define OM_PRINT(name) Print(" %-22s : %10ld \n", #name, om_Info . name)
2650 PrintS(
"\n[om_Opts]: \n");
2651#define OM_PRINT(format, name) Print(" %-22s : %10" format"\n", #name, om_Opts . name)
2667 Print(
"\n\n[om_ErrorStatus] : '%s' (%s)\n",
2670 Print(
"[om_InternalErrorStatus]: '%s' (%s)\n",
2707 WarnS(
"Wrong types for poly= comb(ideal,poly)");
2712 (
ideal)
h->Data(),(poly)
h->next->Data());
2728 WarnS(
"Wrong types for poly= comb(ideal,poly)");
2733 (
ideal)
h->Data(),(poly)
h->next->Data());
2768 || (
h->next->next->Typ()!=
INT_CMD))
2770 WerrorS(
"system(\"newton\",<poly>,<int>,<int>) expected");
2773 poly
p=(poly)(
h->Data());
2792 (
int) (
h->next->Data()),
2793 (
int) (
h->next->next->Data())
2806 L->
m[1].
data=(
void *)(
long)r.achse;
2808 L->
m[2].
data=(
void *)(
long)r.deg;
2812 L->
m[3].
data=(
void *)(
long)r.anz_punkte;
2814 int anz = r.anz_punkte;
2817 for (
i=0;
i<anz*
dim;
i++)
2827 (*w)[
i] = r.deg_tab[
i];
2830 while (r.deg_tab[
i-1] != -2);
2841 res->data=(
void *)L;
2868 Werror(
"expected exactly one argument: %s",
2869 "a square matrix with number entries");
2879 WerrorS(
"expected exactly one argument: "
2880 "a square matrix with number entries");
2888 for (
int i = 0;
i < n;
i++)
delete[]
ml[
i];
2905 WerrorS(
"system(\"sdb_flags\",`int`) expected");
2918 WerrorS(
"shell execution is disallowed in restricted mode");
2928 WerrorS(
"system(\"sdb_edit\",`proc`) expected");
2967 poly
f = (poly)
h->Data();
3032 poly
f = (poly)
h->Data();
3042 poly
f =
pCopy((poly)
h->Data());
3044 poly
g =
pCopy((poly)
h->Data());
3069 WerrorS(
"`system(\"AltVarStart/End\"[,<ring>])` expected");
3084 WerrorS(
"`system(\"AltVarStart/End\",<ring>) requires a SCA ring");
3090 #ifdef HAVE_RATGRING
3114 is=(
int)((
long)(
h->Data()));
3122 for(
k=0;
k < id;
k++)
3126 PrintS(
"starting redRat\n");
3163 is=(
int)((
long)(
h->Data()));
3196 is=(
int)((
long)(
h->Data()));
3229 return (start==0)||(end==0)||(start>end);
3235 poly
f = (poly)
h->Data();
3237 poly
g=(poly)
h->Data();
3245 poly
f = (poly)
h->Data();
3247 poly
g=(poly)
h->Data();
3263 poly
f = (poly)
h->Data();
3265 int n=(
int)((
long)
h->Data());
3273 poly
f = (poly)
h->Data();
3275 int n=(
int)((
long)
h->Data());
3284 poly
f = (poly)
h->Data();
3286 int n=(
int)((
long)
h->Data());
3295 poly
outer = (poly)
h->Data();
3297 poly
inner=(poly)
h->Data();
3324 int d=(
int)(
long)
h->next->Data();
3325 char *
s=(
char *)
h->Data();
3379 WerrorS(
"expected `system(\"HNF\",<matrix|intmat|bigintmat>)`");
3392 char *
s=(
char *)
h->next->Data();
3408 char* filename = (
char*)
h->Data();
3412 WerrorS(
"invalid file name (in paths use '/')");
3420 res->data = (
void*)n;
3425 WerrorS(
"expected valid file name as a string");
3441 (
h->next->next ==
NULL))
3447 for (
int k = 0;
k <=
ivec->rows() -
jvec->rows();
k++)
3450 sizeof(
int) *
jvec->rows()) == 0)
3463 res->data = (
void*)r;
3468 WerrorS(
"expected two non-empty intvecs as arguments");
3483 (
h->next->next ==
NULL))
3487 int ir =
ivec->rows();
int jr =
jvec->rows();
3488 int r =
jr;
if (ir <
jr) r = ir;
3490 sizeof(
int) * r) != 0))
3493 res->data = (
void*)(
long)r;
3498 WerrorS(
"expected two non-empty intvecs as arguments");
3509 (
h->next->next->next !=
NULL) &&
3510 (
h->next->next->next->Typ() ==
POLY_CMD) &&
3511 (
h->next->next->next->next !=
NULL) &&
3512 (
h->next->next->next->next->Typ() ==
POLY_CMD) &&
3513 (
h->next->next->next->next->next !=
NULL) &&
3514 (
h->next->next->next->next->next->Typ() ==
INT_CMD) &&
3515 (
h->next->next->next->next->next->next ==
NULL))
3519 poly
hh = (poly)
h->next->next->Data();
3520 poly
f0 = (poly)
h->next->next->next->Data();
3521 poly
g0 = (poly)
h->next->next->next->next->Data();
3522 int d = (
int)(
long)
h->next->next->next->next->next->Data();
3530 res->data = (
char *)L;
3535 WerrorS(
"expected argument list (int, int, poly, poly, poly, int)");
3570 a=(
int)((
long)(
h->Data()));
3575 b=(
int)((
long)(
h->Data()));
3620 res->data=(
void *)(-1L);
3634 b = (
int)((
long)(
h->Data()));
3640 e = (
int)((
long)(
h->Data()));
3718 res->data=(
char*)
bb;
3723 WerrorS(
"system(\"LU\",<cmatrix>) expected");
3755 int p=(
int)(
long)
h->Data();
3756 int n=(
int)(
long)
h->next->Data();
3757 char *
v=(
char*)
h->next->next->CopyD();
3776 poly
f=(poly)
h->CopyD();
3778 res->data=(
void *)
g;
3785 poly
f=(poly)
h->Data();
3787 for(
int i=0;
i<2000;
i++)
3789 res->data=(
void *)
g;
3795 poly
f=(poly)
h->Data();
3831#if defined(HAVE_CCLUSTER) && defined(HAVE_FLINT)
3867 for(
int i=0;
i<n;
i++)
3880 nn=
ccluster_interface_poly_real_imag(
re_part,
im_part,
mult,
fre,
fim,
center_re,
center_im,
boxsize,
eps,
strategy,
verbosity);
3884 for(
int i=0;
i<
nn;
i++)
3895 ll->m[2].data=(
void *)(
long)
mult[
i];
3921 WerrorS(
"expected system(\"evaluate\",<poly>,..)");
3924 poly
p=(poly)
h->Data();
3931 WerrorS(
"system(\"evaluate\",<poly>,<number>..) - expect number");
3947 poly
p=(poly)
h->CopyD();
3948 poly q=(poly)
h->next->CopyD();
3957 WerrorS(
"expected system(\"DivRem\",<poly>,<poly>)");
3989 WerrorS(
"expected system(\"DivRemId\",<ideal>,<ideal>)");
4016 WerrorS(
"expected system(\"DivRemId\",<ideal>,<ideal>)");
4035 poly
p=(poly)
h->Data();
4036 poly q=(poly)
h->next->Data();
4045 poly q=(poly)
h->next->Data();
4052 poly
p=(poly)
h->Data();
4053 poly q=(poly)
h->next->Data();
4061 poly q=(poly)
h->next->Data();
4068 poly
p=(poly)
h->Data();
4076 poly
p=(poly)
h->Data();
4084 WerrorS(
"expected system(\"CoeffTerm\",<poly>/<vector>,<poly>/<vector>)" "\n or <ideal>/<module>,<poly>/<vector>");
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)
EXTERN_VAR int singular_homog_flag
static const int SW_USE_CHINREM_GCD
set to 1 to use modular gcd over Z
static const int SW_USE_FL_GCD_P
set to 1 to use Flints gcd over F_p
static const int SW_USE_EZGCD_P
set to 1 to use EZGCD over F_q
static const int SW_USE_EZGCD
set to 1 to use EZGCD over Z
static const int SW_USE_FL_GCD_0
set to 1 to use Flints gcd over Q/Z
static CanonicalForm bound(const CFMatrix &M)
void factoryseed(int s)
random seed initializer
CanonicalForm convSingPFactoryP(poly p, const ring r)
matrix singntl_HNF(matrix m, const ring s)
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
void resize(int new_length)
Class used for (list of) interpreter objects.
INLINE_THIS void Init(int l=0)
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
static FORCE_INLINE number n_convFactoryNSingN(const CanonicalForm n, const coeffs r)
void n_Print(number &a, const coeffs r)
print a number (BEWARE of string buffers!) mostly for debugging
static FORCE_INLINE CanonicalForm n_convSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
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.
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE number n_InitMPZ(mpz_t n, const coeffs r)
conversion of a GMP integer to number
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Creation data needed for finite fields.
void countedref_reference_load()
Initialize blackbox types 'reference' and 'shared', or both.
void countedref_shared_load()
poly uni_subst_bits(poly outer_uni, poly inner_multi, ring r)
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)
ideal F5main(ideal id, ring r, int opt, int plus, int termination)
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
CFList int bool & irred
[in,out] Is A irreducible?
int probIrredTest(const CanonicalForm &F, double error)
given some error probIrredTest detects irreducibility or reducibility of F with confidence level 1-er...
poly unifastmult(poly f, poly g, ring r)
poly pFastPowerMC(poly f, int n, ring r)
static int max(int a, int b)
poly pFastPower(poly f, int n, ring r)
poly multifastmult(poly f, poly g, ring r)
void WerrorS(const char *s)
feOptIndex feGetOptIndex(const char *name)
const char * feSetOptValue(feOptIndex opt, char *optarg)
static void * feOptValue(feOptIndex opt)
EXTERN_VAR struct fe_option feOptSpec[]
static char * feResource(feResourceConfig config, int warn)
void feStringAppendBrowsers(int warn)
STATIC_VAR int nfMinPoly[16]
This file is work in progress and currently not part of the official Singular.
void convSingPFlintP(fmpq_poly_t res, poly p, const ring r)
void convSingNFlintN(fmpz_t f, mpz_t z)
void convFlintNSingN(mpz_t z, fmpz_t f)
matrix singflint_rref(matrix m, const ring R)
bigintmat * singflint_LLL(bigintmat *A, bigintmat *T)
number maEvalAt(const poly p, const number *pt, const ring r)
evaluate the polynomial p at the pt given by the array pt
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_Sat_principal(ideal I, ideal J, const ring origR)
ideal idSaturate_intern(ideal I, ideal J, int &k, BOOLEAN isIdeal, BOOLEAN isSB)
ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing)
STATIC_VAR coordinates * points
static BOOLEAN length(leftv result, leftv arg)
#define IMATELEM(M, I, J)
BOOLEAN jjSORTLIST(leftv, leftv arg)
BOOLEAN jjUNIQLIST(leftv, leftv arg)
EXTERN_VAR omBin sleftv_bin
BOOLEAN spaddProc(leftv result, leftv first, leftv second)
BOOLEAN iiCheckTypes(leftv args, const short *type_list, int report)
check a list of arguemys against a given field of types return TRUE if the types match return FALSE (...
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)
ring rSubring(ring org_ring, sleftv *rv)
BOOLEAN semicProc(leftv res, leftv u, leftv v)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
ideal idDivRem(ideal A, const ideal quot, ideal &factor, ideal *unit, int lazyReduce)
poly fglmLinearCombination(ideal source, poly monset)
poly fglmNewLinearCombination(ideal source, poly monset)
poly kNFBound(ideal F, ideal Q, poly p, int bound, int syzComp, int lazyReduce)
VAR int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
VAR int(* test_PosInT)(const TSet T, const int tl, LObject &h)
int posInT17(const TSet set, const int length, LObject &p)
int posInT11(const TSet set, const int length, LObject &p)
int posInT1(const TSet set, const int length, LObject &p)
int posInT0(const TSet, const int length, LObject &)
int posInT2(const TSet set, const int length, LObject &p)
int posInT_pLength(const TSet set, const int length, LObject &p)
int posInT13(const TSet set, const int length, LObject &p)
int posInT17_c(const TSet set, const int length, LObject &p)
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
int posInT15(const TSet set, const int length, LObject &p)
int posInT110(const TSet set, const int length, LObject &p)
int posInT19(const TSet set, const int length, LObject &p)
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
BOOLEAN kVerify2(ideal F, ideal Q)
BOOLEAN kVerify1(ideal F, ideal Q)
static bool rIsSCA(const ring r)
poly pOppose(ring Rop_src, poly p, const ring Rop_dst)
opposes a vector p from Rop to currRing (dst!)
static nc_type & ncRingType(nc_struct *p)
int setNCExtensions(int iMask)
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
matrix nc_PrintMat(int a, int b, ring r, int metric)
returns matrix with the info on noncomm multiplication
bool sca_Force(ring rGR, int b, int e)
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 henselFactors(const int xIndex, const int yIndex, const poly h, const poly f0, const poly g0, const int d, poly &f, poly &g)
Computes a factorization of a polynomial h(x, y) in K[[x]][y] up to a certain degree in x,...
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...
matrix mp_Transp(matrix a, const ring R)
ideal sm_UnFlatten(ideal a, int col, const ring R)
matrix mp_InitI(int r, int c, int v, const ring R)
make it a v * unit matrix
matrix mpNew(int r, int c)
create a r x c zero-matrix
ideal sm_Flatten(ideal a, const ring R)
#define MATELEM(mat, i, j)
1-based access to matrix
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
unsigned long * computeMinimalPolynomial(unsigned long **matrix, unsigned n, unsigned long p)
This file provides miscellaneous functionality.
EXTERN_VAR size_t gmp_output_digits
bool complexNearZero(gmp_complex *c, int digits)
The main handler for Singular numbers which are suitable for Singular polynomials.
BOOLEAN ncInitSpecialPairMultiplication(ring r)
ideal Approx_Step(ideal L)
Ann: ???
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)
#define omFreeSize(addr, size)
const char * omError2String(omError_t error)
const char * omError2Serror(omError_t error)
omError_t om_InternalErrorStatus
char * omFindExec(const char *name, char *exec)
#define omPrintCurrentBackTrace(fd)
poly p_CoeffTermId(poly v, ideal m, int n, const ring r)
find coeffs of a vector of a list of given monomials, n>=max_comp(v)
number p_CoeffTerm(poly p, poly m, const ring r)
find coeff of (polynomial) m in polynomial p find coeff of (vector) m in vector p
ideal id_CoeffTermV(ideal M, poly m, const ring r)
find coeffs of (polynomial) m in all vectors from I
ideal id_CoeffTerm(ideal I, poly m, const ring r)
find coeffs of (polynomial) m in all polynomials from I find coeffs of (vector) m in all vectors from...
poly p_CoeffTermV(poly v, poly m, const ring r)
find vector of coeffs of (polynomial) m in vector v
poly p_CoeffTermMo(poly v, ideal m, const ring r)
find coeffs of a vector of a matrix(module) of given monomials
void p_Content(poly ph, const ring r)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
poly p_Cleardenom(poly p, const ring r)
static int pLength(poly a)
static poly p_Add_q(poly p, poly q, const ring r)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
static void p_Setm(poly p, const ring r)
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
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)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
poly p_DivRem(poly p, poly q, poly &rest, const ring r)
Compatibility layer for legacy polynomial operations (over currRing)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
#define pLmDeleteAndNext(p)
like pLmDelete, returns pNext(p)
#define pGetExp(p, i)
Exponent.
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
#define pCopy(p)
return a copy of the poly
poly nc_rat_CreateSpoly(poly pp1, poly pp2, int ishift, const ring r)
int redRat(poly *h, poly *reducer, int *red_length, int rl, int ishift, ring r)
poly nc_rat_ReduceSpolyNew(const poly p1, poly p2, int ishift, const ring r)
void StringSetS(const char *st)
const char feNotImplemented[]
void PrintS(const char *s)
void Werror(const char *fmt,...)
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
void p_DebugPrint(poly p, const ring r)
void rDebugPrint(const ring r)
void rSetSyzComp(int k, const ring r)
static BOOLEAN rField_is_R(const ring r)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
static BOOLEAN rField_is_long_C(const ring r)
static int rBlocks(const ring r)
static BOOLEAN rField_is_Q(const ring r)
static BOOLEAN rIsNCRing(const ring r)
static BOOLEAN rField_is_long_R(const ring r)
#define rField_is_Ring(R)
poly ringNF(poly f, ideal G, ring r)
poly plain_spoly(poly f, poly g)
poly ringRedNF(poly f, ideal G, ring r)
int testGB(ideal I, ideal GI)
static short scaLastAltVar(ring r)
static short scaFirstAltVar(ring r)
void sdb_edit(procinfo *pi)
int simpleipc_cmd(char *cmd, int id, int v)
ideal id_Vec2Ideal(poly vec, const ring R)
matrix id_Module2Matrix(ideal mod, const ring R)
int ssiReservePort(int clients)
BOOLEAN assumeStdFlag(leftv h)
void syMinimize_with_map(syStrategy res, ideal &trans)
syStrategy syCopy(syStrategy syzstr)
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)
int * iv2array(intvec *iv, const ring R)
#define omMarkAsStaticAddr(A)
#define omPrintUsedTrackAddrs(F, max)