2274 char *sys_cmd=(
char *)(h->
Data());
2277 if (strcmp(sys_cmd,
"syz") == 0)
2281 const char *
s=(
const char *)h->
Data();
2282 if (strcmp(s,
"posInT_EcartFDegpLength")==0)
2284 else if (strcmp(s,
"posInT_FDegpLength")==0)
2286 else if (strcmp(s,
"posInT_pLength")==0)
2288 else if (strcmp(s,
"posInT0")==0)
2290 else if (strcmp(s,
"posInT1")==0)
2292 else if (strcmp(s,
"posInT2")==0)
2294 else if (strcmp(s,
"posInT11")==0)
2296 else if (strcmp(s,
"posInT110")==0)
2298 else if (strcmp(s,
"posInT13")==0)
2300 else if (strcmp(s,
"posInT15")==0)
2302 else if (strcmp(s,
"posInT17")==0)
2304 else if (strcmp(s,
"posInT17_c")==0)
2306 else if (strcmp(s,
"posInT19")==0)
2308 else PrintS(
"valid posInT:0,1,2,11,110,13,15,17,17_c,19,_EcartFDegpLength,_FDegpLength,_pLength,_EcartpLength\n");
2320 if(strcmp(sys_cmd,
"locNF")==0)
2325 poly
f=(poly)h->
Data();
2327 ideal
m=(ideal)h->
Data();
2330 int n=(int)((
long)h->
Data());
2395 if(strcmp(sys_cmd,
"p")==0)
2400 WarnS(
"Sorry: not available for release build!");
2406 if(strcmp(sys_cmd,
"setsyzcomp")==0)
2410 int k = (int)(
long)h->
Data();
2418 if(strcmp(sys_cmd,
"r")==0)
2423 WarnS(
"Sorry: not available for release build!");
2435 if(strcmp(sys_cmd,
"changeRing")==0)
2439 for (
int i = 1;
i <= varN;
i++)
2442 sprintf(h,
"x%d",
i);
2447 res->
data = (
void*)0L;
2452 if(strcmp(sys_cmd,
"mtrack")==0)
2463 char *fn=(
char*) h->Data();
2464 fd = fopen(fn,
"w");
2466 Warn(
"Can not open %s for writing og mtrack. Using stdout",fn);
2470 max = (int)(
long)h->Data();
2475 if (fd !=
NULL) fclose(fd);
2479 WerrorS(
"system(\"mtrack\",..) is not implemented in this version");
2486 if(strcmp(sys_cmd,
"backtrace")==0)
2494 #if !defined(OM_NDEBUG) 2496 if (strcmp(sys_cmd,
"omMemoryTest")==0)
2500 PrintS(
"\n[om_Info]: \n");
2502 #define OM_PRINT(name) Print(" %-22s : %10ld \n", #name, om_Info . name) 2503 OM_PRINT(MaxBytesSystem);
2504 OM_PRINT(CurrentBytesSystem);
2505 OM_PRINT(MaxBytesSbrk);
2506 OM_PRINT(CurrentBytesSbrk);
2507 OM_PRINT(MaxBytesMmap);
2508 OM_PRINT(CurrentBytesMmap);
2509 OM_PRINT(UsedBytes);
2510 OM_PRINT(AvailBytes);
2511 OM_PRINT(UsedBytesMalloc);
2512 OM_PRINT(AvailBytesMalloc);
2513 OM_PRINT(MaxBytesFromMalloc);
2514 OM_PRINT(CurrentBytesFromMalloc);
2515 OM_PRINT(MaxBytesFromValloc);
2516 OM_PRINT(CurrentBytesFromValloc);
2517 OM_PRINT(UsedBytesFromValloc);
2518 OM_PRINT(AvailBytesFromValloc);
2520 OM_PRINT(UsedPages);
2521 OM_PRINT(AvailPages);
2522 OM_PRINT(MaxRegionsAlloc);
2523 OM_PRINT(CurrentRegionsAlloc);
2528 PrintS(
"\n[om_Opts]: \n");
2529 #define OM_PRINT(format, name) Print(" %-22s : %10" format"\n", #name, om_Opts . name) 2530 OM_PRINT(
"d", MinTrack);
2531 OM_PRINT(
"d", MinCheck);
2532 OM_PRINT(
"d", MaxTrack);
2533 OM_PRINT(
"d", MaxCheck);
2534 OM_PRINT(
"d", Keep);
2535 OM_PRINT(
"d", HowToReportErrors);
2536 OM_PRINT(
"d", MarkAsStatic);
2537 OM_PRINT(
"u", PagesPerRegion);
2538 OM_PRINT(
"p", OutOfMemoryFunc);
2539 OM_PRINT(
"p", MemoryLowFunc);
2540 OM_PRINT(
"p", ErrorHook);
2545 Print(
"\n\n[om_ErrorStatus] : '%s' (%s)\n",
2548 Print(
"[om_InternalErrorStatus]: '%s' (%s)\n",
2561 #if defined(PDEBUG) || defined(PDIV_DEBUG) 2562 if(strcmp(sys_cmd,
"pDivStat")==0)
2572 if(strcmp(sys_cmd,
"red")==0)
2587 if(strcmp(sys_cmd,
"fastcomb")==0)
2595 WarnS(
"Wrong types for poly= comb(ideal,poly)");
2600 (ideal)h->Data(),(poly)h->next->Data());
2608 if(strcmp(sys_cmd,
"comb")==0)
2616 WarnS(
"Wrong types for poly= comb(ideal,poly)");
2621 (ideal)h->Data(),(poly)h->next->Data());
2630 if(strcmp(sys_cmd,
"listall")==0)
2632 void listall(
int showproc);
2634 if ((h!=
NULL) && (h->Typ()==
INT_CMD)) showproc=(int)((
long)h->Data());
2642 if(strcmp(sys_cmd,
"proclist")==0)
2644 void piShowProcList();
2652 if(strcmp(sys_cmd,
"newton")==0)
2656 || (h->next->next->Typ()!=
INT_CMD))
2658 WerrorS(
"system(\"newton\",<poly>,<int>,<int>) expected");
2661 poly
p=(poly)(h->Data());
2667 for (i=0;pp!=
NULL;i++)
2680 (
int) (h->next->Data()),
2681 (
int) (h->next->next->Data())
2694 L->
m[1].
data=(
void *)(
long)r.achse;
2696 L->
m[2].
data=(
void *)(
long)r.deg;
2700 L->
m[3].
data=(
void *)(
long)r.anz_punkte;
2702 int anz = r.anz_punkte;
2705 for (i=0; i<anz*
dim; i++)
2708 L->
m[4].
data=(
void *)v;
2715 (*w)[
i] = r.deg_tab[
i];
2718 while (r.deg_tab[i-1] != -2);
2720 L->
m[5].
data=(
void *)w;
2729 res->
data=(
void *)L;
2752 if (strcmp(sys_cmd,
"minpoly") == 0)
2756 Werror(
"expected exactly one argument: %s",
2757 "a square matrix with number entries");
2767 WerrorS(
"expected exactly one argument: " 2768 "a square matrix with number entries");
2775 res->
data = (
void *)theMinPoly;
2776 for (
int i = 0; i < n; i++)
delete[] ml[i];
2778 delete[] polyCoeffs;
2785 if (strcmp(sys_cmd,
"sdb_flags") == 0)
2793 WerrorS(
"system(\"sdb_flags\",`int`) expected");
2802 if (strcmp(sys_cmd,
"sdb_edit") == 0)
2811 WerrorS(
"system(\"sdb_edit\",`proc`) expected");
2819 #if 0 // for testing only 2820 if (strcmp(sys_cmd,
"GF") == 0)
2837 if (strcmp(sys_cmd,
"svd") == 0)
2852 if (strcmp(sys_cmd,
"DLL") == 0)
2854 typedef void (*Void_Func)();
2855 typedef int (*Int_Func)(int);
2863 f=(Int_Func)
dynl_sym(hh,
"PlusDll");
2865 if (f!=
NULL) printf(
"%d\n",
f(i));
2866 else PrintS(
"cannot find PlusDll\n");
2872 f= (Void_Func)
dynl_sym(hh,
"TestDll");
2874 else PrintS(
"cannot find TestDll\n");
2881 #ifdef HAVE_RING2TOM 2883 if (strcmp(sys_cmd,
"findZeroPoly")==0)
2886 poly f = (poly) h->Data();
2893 #ifdef HAVE_VANIDEAL 2894 if (strcmp(sys_cmd,
"createG0")==0)
2919 if (strcmp(sys_cmd,
"redNF_ring")==0)
2922 poly f = (poly) h->Data();
2924 ideal
G = (ideal) h->Data();
2932 if (strcmp(sys_cmd,
"hilbroune") == 0)
2944 if (strcmp(sys_cmd,
"f5")==0)
2953 ideal G = (ideal) h->Data();
2957 opt = (int) (
long) h->Data();
2965 plus = (int) (
long) h->Data();
2973 termination = (int) (
long) h->Data();
2979 res->
data=(ideal)
F5main(G,r,opt,plus,termination);
2986 if (strcmp(sys_cmd,
"NF_ring")==0)
2989 poly f = (poly) h->Data();
2991 ideal G = (ideal) h->Data();
2997 if (strcmp(sys_cmd,
"spoly")==0)
2999 poly f =
pCopy((poly) h->Data());
3001 poly
g =
pCopy((poly) h->Data());
3008 if (strcmp(sys_cmd,
"testGB")==0)
3010 ideal I = (ideal) h->Data();
3012 ideal GI = (ideal) h->Data();
3021 if ( (strcmp(sys_cmd,
"AltVarStart") == 0) || (strcmp(sys_cmd,
"AltVarEnd") == 0) )
3025 if((h!=
NULL) && (h->Typ()==
RING_CMD)) r = (ring)h->Data();
else 3027 WerrorS(
"`system(\"AltVarStart/End\"[,<ring>])` expected");
3035 if(strcmp(sys_cmd,
"AltVarStart") == 0)
3042 WerrorS(
"`system(\"AltVarStart/End\",<ring>) requires a SCA ring");
3048 #ifdef HAVE_RATGRING 3049 if (strcmp(sys_cmd,
"intratNF") == 0)
3064 I=(ideal)h->CopyD();
3072 is=(int)((
long)(h->Data()));
3080 for(k=0; k < id; k++)
3084 PrintS(
"starting redRat\n");
3102 if (strcmp(sys_cmd,
"ratNF") == 0)
3121 is=(int)((
long)(h->Data()));
3136 if (strcmp(sys_cmd,
"ratSpoly") == 0)
3154 is=(int)((
long)(h->Data()));
3168 #endif // HAVE_RATGRING 3170 if (strcmp(sys_cmd,
"ratVar") == 0)
3187 return (start==0)||(end==0)||(start>end);
3191 if (strcmp(sys_cmd,
"unifastmult")==0)
3193 poly f = (poly)h->Data();
3195 poly g=(poly)h->Data();
3201 if (strcmp(sys_cmd,
"multifastmult")==0)
3203 poly f = (poly)h->Data();
3205 poly g=(poly)h->Data();
3211 if (strcmp(sys_cmd,
"mults")==0)
3218 if (strcmp(sys_cmd,
"fastpower")==0)
3221 poly f = (poly)h->Data();
3223 int n=(int)((
long)h->Data());
3229 if (strcmp(sys_cmd,
"normalpower")==0)
3231 poly f = (poly)h->Data();
3233 int n=(int)((
long)h->Data());
3239 if (strcmp(sys_cmd,
"MCpower")==0)
3242 poly f = (poly)h->Data();
3244 int n=(int)((
long)h->Data());
3250 if (strcmp(sys_cmd,
"bit_subst")==0)
3253 poly outer = (poly)h->Data();
3255 poly inner=(poly)h->Data();
3262 if (strcmp(sys_cmd,
"gcd") == 0)
3277 int d=(int)(
long)h->next->Data();
3278 char *s=(
char *)h->Data();
3293 if (strcmp(sys_cmd,
"subring") == 0)
3307 if (strcmp(sys_cmd,
"HNF") == 0)
3329 WerrorS(
"expected `system(\"HNF\",<matrix|intmat|bigintmat>)`");
3337 if (strcmp (sys_cmd,
"probIrredTest") == 0)
3342 char *s=(
char *)h->next->Data();
3343 double error= atof (s);
3354 if(strcmp(sys_cmd,
"GNUmpLoad")==0)
3358 char* filename = (
char*)h->Data();
3359 FILE* f = fopen(filename,
"r");
3362 WerrorS(
"invalid file name (in paths use '/')");
3365 mpz_t
m; mpz_init(m);
3366 mpz_inp_str(m, f, 10);
3370 res->
data = (
void*)n;
3375 WerrorS(
"expected valid file name as a string");
3387 if(strcmp(sys_cmd,
"intvecMatchingSegments")==0)
3391 (h->next->next ==
NULL))
3396 int validEntries = 0;
3397 for (
int k = 0; k <= ivec->
rows() - jvec->
rows(); k++)
3399 if (memcmp(&(*ivec)[k], &(*jvec)[0],
3400 sizeof(
int) * jvec->
rows()) == 0)
3402 if (validEntries == 0)
3406 r->
resize(validEntries + 1);
3407 (*r)[validEntries] = k + 1;
3413 res->
data = (
void*)r;
3418 WerrorS(
"expected two non-empty intvecs as arguments");
3429 if(strcmp(sys_cmd,
"intvecOverlap")==0)
3433 (h->next->next ==
NULL))
3437 int ir = ivec->
rows();
int jr = jvec->
rows();
3438 int r = jr;
if (ir < jr) r = ir;
3439 while ((r >= 1) && (memcmp(&(*ivec)[ir - r], &(*jvec)[0],
3440 sizeof(
int) * r) != 0))
3443 res->
data = (
void*)(
long)r;
3448 WerrorS(
"expected two non-empty intvecs as arguments");
3454 if(strcmp(sys_cmd,
"henselfactors")==0)
3457 (h->next !=
NULL) && (h->next->Typ() ==
INT_CMD) &&
3458 (h->next->next !=
NULL) && (h->next->next->Typ() ==
POLY_CMD) &&
3459 (h->next->next->next !=
NULL) &&
3460 (h->next->next->next->Typ() ==
POLY_CMD) &&
3461 (h->next->next->next->next !=
NULL) &&
3462 (h->next->next->next->next->Typ() ==
POLY_CMD) &&
3463 (h->next->next->next->next->next !=
NULL) &&
3464 (h->next->next->next->next->next->Typ() ==
INT_CMD) &&
3465 (h->next->next->next->next->next->next ==
NULL))
3467 int xIndex = (int)(
long)h->Data();
3468 int yIndex = (int)(
long)h->next->Data();
3469 poly hh = (poly)h->next->next->Data();
3470 poly f0 = (poly)h->next->next->next->Data();
3471 poly g0 = (poly)h->next->next->next->next->Data();
3472 int d = (int)(
long)h->next->next->next->next->next->Data();
3480 res->
data = (
char *)L;
3485 WerrorS(
"expected argument list (int, int, poly, poly, poly, int)");
3492 if (strcmp(sys_cmd,
"astep") == 0)
3497 I=(ideal)h->CopyD();
3510 if (strcmp(sys_cmd,
"PrintMat") == 0)
3520 a=(int)((
long)(h->Data()));
3525 b=(int)((
long)(h->Data()));
3540 metric=(int)((
long)(h->Data()));
3551 if(strcmp(sys_cmd,
"NCUseExtensions")==0)
3564 if(strcmp(sys_cmd,
"NCGetType")==0)
3570 res->
data=(
void *)(-1L);
3577 if(strcmp(sys_cmd,
"ForceSCA")==0)
3584 b = (int)((
long)(h->Data()));
3590 e = (int)((
long)(h->Data()));
3601 if(strcmp(sys_cmd,
"ForceNewNCMultiplication")==0)
3613 if(strcmp(sys_cmd,
"ForceNewOldNCMultiplication")==0)
3625 if(strcmp(sys_cmd,
"test64")==0)
3641 Print(
"SIZEOF_LONG=%d\n",SIZEOF_LONG);
3647 if(strcmp(sys_cmd,
"cache_chinrem")==0)
3650 Print(
"caching inverse in chines remainder:%d\n",n_SwitchChinRem);
3652 n_SwitchChinRem=(int)(
long)h->Data();
3658 if(strcmp(sys_cmd,
"LU")==0)
3668 res->
data=(
char*)bb;
3673 WerrorS(
"system(\"LU\",<cmatrix>) expected");
3680 if(strcmp(sys_cmd,
"sort")==0)
3690 if(strcmp(sys_cmd,
"uniq")==0)
3700 if(strcmp(sys_cmd,
"GF")==0)
3705 int p=(int)(
long)h->Data();
3706 int n=(int)(
long)h->next->Data();
3707 char *v=(
char*)h->next->next->CopyD();
3723 if(strcmp(sys_cmd,
"power1")==0)
3726 poly f=(poly)h->CopyD();
3728 res->
data=(
void *)g;
3732 if(strcmp(sys_cmd,
"power2")==0)
3735 poly f=(poly)h->Data();
3737 for(
int i=0;i<2000;i++)
3739 res->
data=(
void *)g;
3742 if(strcmp(sys_cmd,
"power3")==0)
3745 poly f=(poly)h->Data();
3756 poly p1536=
pMult(p1024,p512);
3757 poly p1792=
pMult(p1536,p256);
3758 poly p1920=
pMult(p1792,p128);
3759 poly p1984=
pMult(p1920,p64);
3760 poly p2000=
pMult(p1984,p16);
3761 res->
data=(
void *)p2000;
STATIC_VAR coordinates * points
int posInT_pLength(const TSet set, const int length, LObject &p)
const CanonicalForm int s
poly pFastPower(poly f, int n, ring r)
void p_DebugPrint(poly p, const ring r)
Class used for (list of) interpreter objects.
const char * omError2String(omError_t error)
ring rSubring(ring org_ring, sleftv *rv)
void resize(int new_length)
int posInT2(const TSet set, const int length, LObject &p)
BOOLEAN jjSORTLIST(leftv, leftv arg)
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...
int posInT1(const TSet set, const int length, LObject &p)
short * iv2array(intvec *iv, const ring R)
number n_convFactoryNSingN(const CanonicalForm n, const coeffs r)
void sdb_edit(procinfo *pi)
STATIC_VAR int nfMinPoly[16]
static const int SW_USE_EZGCD_P
set to 1 to use EZGCD over F_q
int setNCExtensions(int iMask)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
void error(const char *fmt,...)
#define omFreeSize(addr, size)
VAR int(* test_PosInT)(const TSet T, const int tl, LObject &h)
poly pFastPowerMC(poly f, int n, ring r)
omError_t om_InternalErrorStatus
poly nc_rat_ReduceSpolyNew(const poly p1, poly p2, int ishift, const ring r)
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
void * dynl_sym(void *handle, const char *symbol)
void WerrorS(const char *s)
EXTERN_VAR int singular_homog_flag
int testGB(ideal I, ideal GI)
int posInT15(const TSet set, const int length, LObject &p)
CanonicalForm n_convSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
Creation data needed for finite fields.
int posInT0(const TSet, const int length, LObject &)
void * dynl_open(char *filename)
matrix mp_Transp(matrix a, const ring R)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
bool sca_Force(ring rGR, int b, int e)
unsigned long * computeMinimalPolynomial(unsigned long **matrix, unsigned n, unsigned long p)
#define pGetExp(p, i)
Exponent.
int posInT11(const TSet set, const int length, LObject &p)
int posInT17_c(const TSet set, const int length, LObject &p)
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...
matrix nc_PrintMat(int a, int b, ring r, int metric)
returns matrix with the info on noncomm multiplication
static int max(int a, int b)
poly uni_subst_bits(poly outer_uni, poly inner_multi, ring r)
poly multifastmult(poly f, poly g, ring r)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
The main handler for Singular numbers which are suitable for Singular polynomials.
const char feNotImplemented[]
BOOLEAN jjUNIQLIST(leftv, leftv arg)
const char * omError2Serror(omError_t error)
static FORCE_INLINE number n_InitMPZ(mpz_t n, const coeffs r)
conversion of a GMP integer to number
poly nc_rat_CreateSpoly(poly pp1, poly pp2, int ishift, const ring r)
void rDebugPrint(const ring r)
BOOLEAN assumeStdFlag(leftv h)
void PrintS(const char *s)
int posInT17(const TSet set, const int length, LObject &p)
static const int SW_USE_CHINREM_GCD
set to 1 to use modular gcd over Z
static unsigned pLength(poly a)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
matrix singntl_HNF(matrix m, const ring s)
static short scaFirstAltVar(ring r)
poly ringRedNF(poly f, ideal G, ring r)
poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing)
void rSetSyzComp(int k, const ring r)
ideal Approx_Step(ideal L)
Ann: ???
poly plain_spoly(poly f, poly g)
INLINE_THIS void Init(int l=0)
matrix mpNew(int r, int c)
create a r x c zero-matrix
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
const Variable & v
< [in] a sqrfree bivariate poly
#define omPrintUsedTrackAddrs(F, max)
matrix mp_InitI(int r, int c, int v, const ring R)
make it a v * unit matrix
CanonicalForm convSingPFactoryP(poly p, const ring r)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
poly fglmLinearCombination(ideal source, poly monset)
int probIrredTest(const CanonicalForm &F, double error)
given some error probIrredTest detects irreducibility or reducibility of F with confidence level 1-er...
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 (...
int posInT110(const TSet set, const int length, LObject &p)
static const int SW_USE_QGCD
set to 1 to use Encarnacion GCD over Q(a)
static const int SW_USE_EZGCD
set to 1 to use EZGCD over Z
static short scaLastAltVar(ring r)
static bool rIsSCA(const ring r)
BOOLEAN ncInitSpecialPairMultiplication(ring r)
CFList int bool & irred
[in,out] Is A irreducible?
#define omPrintCurrentBackTrace(fd)
static nc_type & ncRingType(nc_struct *p)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
int redRat(poly *h, poly *reducer, int *red_length, int rl, int ishift, ring r)
#define pLmDeleteAndNext(p)
like pLmDelete, returns pNext(p)
void pPrintDivisbleByStat()
void omMarkAsStaticAddr(void *addr)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
int posInT19(const TSet set, const int length, LObject &p)
ideal id_Vec2Ideal(poly vec, const ring R)
poly ringNF(poly f, ideal G, ring r)
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
poly fglmNewLinearCombination(ideal source, poly monset)
void Werror(const char *fmt,...)
int posInT13(const TSet set, const int length, LObject &p)
poly unifastmult(poly f, poly g, ring r)
#define pCopy(p)
return a copy of the poly
#define MATELEM(mat, i, j)
1-based access to matrix
void n_Print(number &a, const coeffs r)
print a number (BEWARE of string buffers!) mostly for debugging
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
VAR int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
ideal F5main(ideal id, ring r, int opt, int plus, int termination)