2354 char *sys_cmd=(
char *)(h->
Data());
2357 if (strcmp(sys_cmd,
"syz") == 0)
2361 const char *
s=(
const char *)h->
Data();
2362 if (strcmp(s,
"posInT_EcartFDegpLength")==0)
2364 else if (strcmp(s,
"posInT_FDegpLength")==0)
2366 else if (strcmp(s,
"posInT_pLength")==0)
2368 else if (strcmp(s,
"posInT0")==0)
2370 else if (strcmp(s,
"posInT1")==0)
2372 else if (strcmp(s,
"posInT2")==0)
2374 else if (strcmp(s,
"posInT11")==0)
2376 else if (strcmp(s,
"posInT110")==0)
2378 else if (strcmp(s,
"posInT13")==0)
2380 else if (strcmp(s,
"posInT15")==0)
2382 else if (strcmp(s,
"posInT17")==0)
2384 else if (strcmp(s,
"posInT17_c")==0)
2386 else if (strcmp(s,
"posInT19")==0)
2388 else PrintS(
"valid posInT:0,1,2,11,110,13,15,17,17_c,19,_EcartFDegpLength,_FDegpLength,_pLength,_EcartpLength\n");
2400 if(strcmp(sys_cmd,
"locNF")==0)
2405 poly
f=(poly)h->
Data();
2407 ideal
m=(ideal)h->
Data();
2410 int n=(int)((
long)h->
Data());
2475 if(strcmp(sys_cmd,
"p")==0)
2480 WarnS(
"Sorry: not available for release build!");
2486 if(strcmp(sys_cmd,
"setsyzcomp")==0)
2490 int k = (int)(
long)h->
Data();
2498 if(strcmp(sys_cmd,
"r")==0)
2503 WarnS(
"Sorry: not available for release build!");
2515 if(strcmp(sys_cmd,
"changeRing")==0)
2519 for (
int i = 1;
i <= varN;
i++)
2522 sprintf(h,
"x%d",
i);
2527 res->
data = (
void*)0L;
2532 if(strcmp(sys_cmd,
"mtrack")==0)
2543 char *fn=(
char*) h->Data();
2544 fd = fopen(fn,
"w");
2546 Warn(
"Can not open %s for writing og mtrack. Using stdout",fn);
2550 max = (int)(
long)h->Data();
2555 if (fd !=
NULL) fclose(fd);
2559 WerrorS(
"system(\"mtrack\",..) is not implemented in this version");
2566 if(strcmp(sys_cmd,
"backtrace")==0)
2574 #if !defined(OM_NDEBUG) 2576 if (strcmp(sys_cmd,
"omMemoryTest")==0)
2580 PrintS(
"\n[om_Info]: \n");
2582 #define OM_PRINT(name) Print(" %-22s : %10ld \n", #name, om_Info . name) 2583 OM_PRINT(MaxBytesSystem);
2584 OM_PRINT(CurrentBytesSystem);
2585 OM_PRINT(MaxBytesSbrk);
2586 OM_PRINT(CurrentBytesSbrk);
2587 OM_PRINT(MaxBytesMmap);
2588 OM_PRINT(CurrentBytesMmap);
2589 OM_PRINT(UsedBytes);
2590 OM_PRINT(AvailBytes);
2591 OM_PRINT(UsedBytesMalloc);
2592 OM_PRINT(AvailBytesMalloc);
2593 OM_PRINT(MaxBytesFromMalloc);
2594 OM_PRINT(CurrentBytesFromMalloc);
2595 OM_PRINT(MaxBytesFromValloc);
2596 OM_PRINT(CurrentBytesFromValloc);
2597 OM_PRINT(UsedBytesFromValloc);
2598 OM_PRINT(AvailBytesFromValloc);
2600 OM_PRINT(UsedPages);
2601 OM_PRINT(AvailPages);
2602 OM_PRINT(MaxRegionsAlloc);
2603 OM_PRINT(CurrentRegionsAlloc);
2608 PrintS(
"\n[om_Opts]: \n");
2609 #define OM_PRINT(format, name) Print(" %-22s : %10" format"\n", #name, om_Opts . name) 2610 OM_PRINT(
"d", MinTrack);
2611 OM_PRINT(
"d", MinCheck);
2612 OM_PRINT(
"d", MaxTrack);
2613 OM_PRINT(
"d", MaxCheck);
2614 OM_PRINT(
"d", Keep);
2615 OM_PRINT(
"d", HowToReportErrors);
2616 OM_PRINT(
"d", MarkAsStatic);
2617 OM_PRINT(
"u", PagesPerRegion);
2618 OM_PRINT(
"p", OutOfMemoryFunc);
2619 OM_PRINT(
"p", MemoryLowFunc);
2620 OM_PRINT(
"p", ErrorHook);
2625 Print(
"\n\n[om_ErrorStatus] : '%s' (%s)\n",
2628 Print(
"[om_InternalErrorStatus]: '%s' (%s)\n",
2641 #if defined(PDEBUG) || defined(PDIV_DEBUG) 2642 if(strcmp(sys_cmd,
"pDivStat")==0)
2652 if(strcmp(sys_cmd,
"red")==0)
2667 if(strcmp(sys_cmd,
"fastcomb")==0)
2675 WarnS(
"Wrong types for poly= comb(ideal,poly)");
2680 (ideal)h->Data(),(poly)h->next->Data());
2688 if(strcmp(sys_cmd,
"comb")==0)
2696 WarnS(
"Wrong types for poly= comb(ideal,poly)");
2701 (ideal)h->Data(),(poly)h->next->Data());
2710 if(strcmp(sys_cmd,
"listall")==0)
2712 void listall(
int showproc);
2714 if ((h!=
NULL) && (h->Typ()==
INT_CMD)) showproc=(int)((
long)h->Data());
2722 if(strcmp(sys_cmd,
"proclist")==0)
2724 void piShowProcList();
2732 if(strcmp(sys_cmd,
"newton")==0)
2736 || (h->next->next->Typ()!=
INT_CMD))
2738 WerrorS(
"system(\"newton\",<poly>,<int>,<int>) expected");
2741 poly
p=(poly)(h->Data());
2747 for (i=0;pp!=
NULL;i++)
2760 (
int) (h->next->Data()),
2761 (
int) (h->next->next->Data())
2774 L->
m[1].
data=(
void *)(
long)r.achse;
2776 L->
m[2].
data=(
void *)(
long)r.deg;
2780 L->
m[3].
data=(
void *)(
long)r.anz_punkte;
2782 int anz = r.anz_punkte;
2785 for (i=0; i<anz*
dim; i++)
2788 L->
m[4].
data=(
void *)v;
2795 (*w)[
i] = r.deg_tab[
i];
2798 while (r.deg_tab[i-1] != -2);
2800 L->
m[5].
data=(
void *)w;
2809 res->
data=(
void *)L;
2832 if (strcmp(sys_cmd,
"minpoly") == 0)
2836 Werror(
"expected exactly one argument: %s",
2837 "a square matrix with number entries");
2847 WerrorS(
"expected exactly one argument: " 2848 "a square matrix with number entries");
2855 res->
data = (
void *)theMinPoly;
2856 for (
int i = 0; i < n; i++)
delete[] ml[i];
2858 delete[] polyCoeffs;
2865 if (strcmp(sys_cmd,
"sdb_flags") == 0)
2873 WerrorS(
"system(\"sdb_flags\",`int`) expected");
2882 if (strcmp(sys_cmd,
"sdb_edit") == 0)
2891 WerrorS(
"system(\"sdb_edit\",`proc`) expected");
2899 #if 0 // for testing only 2900 if (strcmp(sys_cmd,
"GF") == 0)
2917 if (strcmp(sys_cmd,
"svd") == 0)
2932 if (strcmp(sys_cmd,
"DLL") == 0)
2934 typedef void (*Void_Func)();
2935 typedef int (*Int_Func)(int);
2943 f=(Int_Func)
dynl_sym(hh,
"PlusDll");
2945 if (f!=
NULL) printf(
"%d\n",
f(i));
2946 else PrintS(
"cannot find PlusDll\n");
2952 f= (Void_Func)
dynl_sym(hh,
"TestDll");
2954 else PrintS(
"cannot find TestDll\n");
2961 #ifdef HAVE_RING2TOM 2963 if (strcmp(sys_cmd,
"findZeroPoly")==0)
2966 poly f = (poly) h->Data();
2973 #ifdef HAVE_VANIDEAL 2974 if (strcmp(sys_cmd,
"createG0")==0)
2999 if (strcmp(sys_cmd,
"redNF_ring")==0)
3002 poly f = (poly) h->Data();
3004 ideal
G = (ideal) h->Data();
3012 if (strcmp(sys_cmd,
"hilbroune") == 0)
3024 if (strcmp(sys_cmd,
"f5")==0)
3033 ideal G = (ideal) h->Data();
3037 opt = (int) (
long) h->Data();
3045 plus = (int) (
long) h->Data();
3053 termination = (int) (
long) h->Data();
3059 res->
data=(ideal)
F5main(G,r,opt,plus,termination);
3066 if (strcmp(sys_cmd,
"NF_ring")==0)
3069 poly f = (poly) h->Data();
3071 ideal G = (ideal) h->Data();
3077 if (strcmp(sys_cmd,
"spoly")==0)
3079 poly f =
pCopy((poly) h->Data());
3081 poly
g =
pCopy((poly) h->Data());
3088 if (strcmp(sys_cmd,
"testGB")==0)
3090 ideal I = (ideal) h->Data();
3092 ideal GI = (ideal) h->Data();
3101 if ( (strcmp(sys_cmd,
"AltVarStart") == 0) || (strcmp(sys_cmd,
"AltVarEnd") == 0) )
3105 if((h!=
NULL) && (h->Typ()==
RING_CMD)) r = (ring)h->Data();
else 3107 WerrorS(
"`system(\"AltVarStart/End\"[,<ring>])` expected");
3115 if(strcmp(sys_cmd,
"AltVarStart") == 0)
3122 WerrorS(
"`system(\"AltVarStart/End\",<ring>) requires a SCA ring");
3128 #ifdef HAVE_RATGRING 3129 if (strcmp(sys_cmd,
"intratNF") == 0)
3144 I=(ideal)h->CopyD();
3152 is=(int)((
long)(h->Data()));
3160 for(k=0; k < id; k++)
3164 PrintS(
"starting redRat\n");
3182 if (strcmp(sys_cmd,
"ratNF") == 0)
3201 is=(int)((
long)(h->Data()));
3216 if (strcmp(sys_cmd,
"ratSpoly") == 0)
3234 is=(int)((
long)(h->Data()));
3248 #endif // HAVE_RATGRING 3250 if (strcmp(sys_cmd,
"ratVar") == 0)
3267 return (start==0)||(end==0)||(start>end);
3271 if (strcmp(sys_cmd,
"unifastmult")==0)
3273 poly f = (poly)h->Data();
3275 poly g=(poly)h->Data();
3281 if (strcmp(sys_cmd,
"multifastmult")==0)
3283 poly f = (poly)h->Data();
3285 poly g=(poly)h->Data();
3291 if (strcmp(sys_cmd,
"mults")==0)
3298 if (strcmp(sys_cmd,
"fastpower")==0)
3301 poly f = (poly)h->Data();
3303 int n=(int)((
long)h->Data());
3309 if (strcmp(sys_cmd,
"normalpower")==0)
3311 poly f = (poly)h->Data();
3313 int n=(int)((
long)h->Data());
3319 if (strcmp(sys_cmd,
"MCpower")==0)
3322 poly f = (poly)h->Data();
3324 int n=(int)((
long)h->Data());
3330 if (strcmp(sys_cmd,
"bit_subst")==0)
3333 poly outer = (poly)h->Data();
3335 poly inner=(poly)h->Data();
3342 if (strcmp(sys_cmd,
"gcd") == 0)
3357 int d=(int)(
long)h->next->Data();
3358 char *s=(
char *)h->Data();
3373 if (strcmp(sys_cmd,
"subring") == 0)
3387 if (strcmp(sys_cmd,
"HNF") == 0)
3409 WerrorS(
"expected `system(\"HNF\",<matrix|intmat|bigintmat>)`");
3417 if (strcmp (sys_cmd,
"probIrredTest") == 0)
3422 char *s=(
char *)h->next->Data();
3423 double error= atof (s);
3434 if(strcmp(sys_cmd,
"GNUmpLoad")==0)
3438 char* filename = (
char*)h->Data();
3439 FILE* f = fopen(filename,
"r");
3442 WerrorS(
"invalid file name (in paths use '/')");
3445 mpz_t
m; mpz_init(m);
3446 mpz_inp_str(m, f, 10);
3450 res->
data = (
void*)n;
3455 WerrorS(
"expected valid file name as a string");
3467 if(strcmp(sys_cmd,
"intvecMatchingSegments")==0)
3471 (h->next->next ==
NULL))
3476 int validEntries = 0;
3477 for (
int k = 0; k <= ivec->
rows() - jvec->
rows(); k++)
3479 if (memcmp(&(*ivec)[k], &(*jvec)[0],
3480 sizeof(
int) * jvec->
rows()) == 0)
3482 if (validEntries == 0)
3486 r->
resize(validEntries + 1);
3487 (*r)[validEntries] = k + 1;
3493 res->
data = (
void*)r;
3498 WerrorS(
"expected two non-empty intvecs as arguments");
3509 if(strcmp(sys_cmd,
"intvecOverlap")==0)
3513 (h->next->next ==
NULL))
3517 int ir = ivec->
rows();
int jr = jvec->
rows();
3518 int r = jr;
if (ir < jr) r = ir;
3519 while ((r >= 1) && (memcmp(&(*ivec)[ir - r], &(*jvec)[0],
3520 sizeof(
int) * r) != 0))
3523 res->
data = (
void*)(
long)r;
3528 WerrorS(
"expected two non-empty intvecs as arguments");
3534 if(strcmp(sys_cmd,
"henselfactors")==0)
3537 (h->next !=
NULL) && (h->next->Typ() ==
INT_CMD) &&
3538 (h->next->next !=
NULL) && (h->next->next->Typ() ==
POLY_CMD) &&
3539 (h->next->next->next !=
NULL) &&
3540 (h->next->next->next->Typ() ==
POLY_CMD) &&
3541 (h->next->next->next->next !=
NULL) &&
3542 (h->next->next->next->next->Typ() ==
POLY_CMD) &&
3543 (h->next->next->next->next->next !=
NULL) &&
3544 (h->next->next->next->next->next->Typ() ==
INT_CMD) &&
3545 (h->next->next->next->next->next->next ==
NULL))
3547 int xIndex = (int)(
long)h->Data();
3548 int yIndex = (int)(
long)h->next->Data();
3549 poly hh = (poly)h->next->next->Data();
3550 poly f0 = (poly)h->next->next->next->Data();
3551 poly g0 = (poly)h->next->next->next->next->Data();
3552 int d = (int)(
long)h->next->next->next->next->next->Data();
3560 res->
data = (
char *)L;
3565 WerrorS(
"expected argument list (int, int, poly, poly, poly, int)");
3572 if (strcmp(sys_cmd,
"astep") == 0)
3577 I=(ideal)h->CopyD();
3590 if (strcmp(sys_cmd,
"PrintMat") == 0)
3600 a=(int)((
long)(h->Data()));
3605 b=(int)((
long)(h->Data()));
3620 metric=(int)((
long)(h->Data()));
3631 if(strcmp(sys_cmd,
"NCUseExtensions")==0)
3644 if(strcmp(sys_cmd,
"NCGetType")==0)
3650 res->
data=(
void *)(-1L);
3657 if(strcmp(sys_cmd,
"ForceSCA")==0)
3664 b = (int)((
long)(h->Data()));
3670 e = (int)((
long)(h->Data()));
3681 if(strcmp(sys_cmd,
"ForceNewNCMultiplication")==0)
3693 if(strcmp(sys_cmd,
"ForceNewOldNCMultiplication")==0)
3705 if(strcmp(sys_cmd,
"test64")==0)
3721 Print(
"SIZEOF_LONG=%d\n",SIZEOF_LONG);
3727 if(strcmp(sys_cmd,
"cache_chinrem")==0)
3730 Print(
"caching inverse in chines remainder:%d\n",n_SwitchChinRem);
3732 n_SwitchChinRem=(int)(
long)h->Data();
3738 if(strcmp(sys_cmd,
"LU")==0)
3748 res->
data=(
char*)bb;
3753 WerrorS(
"system(\"LU\",<cmatrix>) expected");
3760 if(strcmp(sys_cmd,
"sort")==0)
3770 if(strcmp(sys_cmd,
"uniq")==0)
3780 if(strcmp(sys_cmd,
"GF")==0)
3785 int p=(int)(
long)h->Data();
3786 int n=(int)(
long)h->next->Data();
3787 char *v=(
char*)h->next->next->CopyD();
3803 if(strcmp(sys_cmd,
"power1")==0)
3806 poly f=(poly)h->CopyD();
3808 res->
data=(
void *)g;
3812 if(strcmp(sys_cmd,
"power2")==0)
3815 poly f=(poly)h->Data();
3817 for(
int i=0;i<2000;i++)
3819 res->
data=(
void *)g;
3822 if(strcmp(sys_cmd,
"power3")==0)
3825 poly f=(poly)h->Data();
3836 poly p1536=
pMult(p1024,p512);
3837 poly p1792=
pMult(p1536,p256);
3838 poly p1920=
pMult(p1792,p128);
3839 poly p1984=
pMult(p1920,p64);
3840 poly p2000=
pMult(p1984,p16);
3841 res->
data=(
void *)p2000;
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 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)
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.
static coordinates * points
void * dynl_sym(void *handle, const char *symbol)
void WerrorS(const char *s)
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)
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)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
BOOLEAN ncInitSpecialPairMultiplication(ring r)
CFList int bool & irred
[in,out] Is A irreducible?
int(* test_PosInT)(const TSet T, const int tl, LObject &h)
#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)
int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
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
ideal F5main(ideal id, ring r, int opt, int plus, int termination)