2268 char *sys_cmd=(
char *)(h->
Data());
2271 if (strcmp(sys_cmd,
"syz") == 0)
2288 const char *
s=(
const char *)h->
Data();
2289 if (strcmp(s,
"posInT_EcartFDegpLength")==0)
2291 else if (strcmp(s,
"posInT_FDegpLength")==0)
2293 else if (strcmp(s,
"posInT_pLength")==0)
2295 else if (strcmp(s,
"posInT0")==0)
2297 else if (strcmp(s,
"posInT1")==0)
2299 else if (strcmp(s,
"posInT2")==0)
2301 else if (strcmp(s,
"posInT11")==0)
2303 else if (strcmp(s,
"posInT110")==0)
2305 else if (strcmp(s,
"posInT13")==0)
2307 else if (strcmp(s,
"posInT15")==0)
2309 else if (strcmp(s,
"posInT17")==0)
2311 else if (strcmp(s,
"posInT17_c")==0)
2313 else if (strcmp(s,
"posInT19")==0)
2315 else Print(
"valid posInT:0,1,2,11,110,13,15,17,17_c,19,_EcartFDegpLength,_FDegpLength,_pLength,_EcartpLength\n");
2327 if(strcmp(sys_cmd,
"locNF")==0)
2334 ideal
m=(ideal)h->
Data();
2337 int n=(int)((
long)h->
Data());
2402 if(strcmp(sys_cmd,
"p")==0)
2407 Warn(
"Sorry: not available for release build!");
2413 if(strcmp(sys_cmd,
"setsyzcomp")==0)
2417 int k = (int)(
long)h->
Data();
2425 if(strcmp(sys_cmd,
"r")==0)
2430 Warn(
"Sorry: not available for release build!");
2442 if(strcmp(sys_cmd,
"changeRing")==0)
2446 for (
int i = 1;
i <= varN;
i++)
2449 sprintf(h,
"x%d",
i);
2454 res->
data = (
void*)0L;
2459 if(strcmp(sys_cmd,
"mtrack")==0)
2470 fd = fopen((
char*) h->Data(),
"w");
2472 Warn(
"Can not open %s for writing og mtrack. Using stdout");
2476 max = (int)(
long)h->Data();
2481 if (fd !=
NULL) fclose(fd);
2487 if(strcmp(sys_cmd,
"mtrack_all")==0)
2494 fd = fopen((
char*) h->Data(),
"w");
2496 Warn(
"Can not open %s for writing og mtrack. Using stdout");
2501 if (fd !=
NULL) fclose(fd);
2509 if(strcmp(sys_cmd,
"backtrace")==0)
2517 #if !defined(OM_NDEBUG) 2519 if (strcmp(sys_cmd,
"omMemoryTest")==0)
2523 PrintS(
"\n[om_Info]: \n");
2525 #define OM_PRINT(name) Print(" %-22s : %10ld \n", #name, om_Info . name) 2526 OM_PRINT(MaxBytesSystem);
2527 OM_PRINT(CurrentBytesSystem);
2528 OM_PRINT(MaxBytesSbrk);
2529 OM_PRINT(CurrentBytesSbrk);
2530 OM_PRINT(MaxBytesMmap);
2531 OM_PRINT(CurrentBytesMmap);
2532 OM_PRINT(UsedBytes);
2533 OM_PRINT(AvailBytes);
2534 OM_PRINT(UsedBytesMalloc);
2535 OM_PRINT(AvailBytesMalloc);
2536 OM_PRINT(MaxBytesFromMalloc);
2537 OM_PRINT(CurrentBytesFromMalloc);
2538 OM_PRINT(MaxBytesFromValloc);
2539 OM_PRINT(CurrentBytesFromValloc);
2540 OM_PRINT(UsedBytesFromValloc);
2541 OM_PRINT(AvailBytesFromValloc);
2543 OM_PRINT(UsedPages);
2544 OM_PRINT(AvailPages);
2545 OM_PRINT(MaxRegionsAlloc);
2546 OM_PRINT(CurrentRegionsAlloc);
2551 PrintS(
"\n[om_Opts]: \n");
2552 #define OM_PRINT(format, name) Print(" %-22s : %10" format"\n", #name, om_Opts . name) 2553 OM_PRINT(
"d", MinTrack);
2554 OM_PRINT(
"d", MinCheck);
2555 OM_PRINT(
"d", MaxTrack);
2556 OM_PRINT(
"d", MaxCheck);
2557 OM_PRINT(
"d", Keep);
2558 OM_PRINT(
"d", HowToReportErrors);
2559 OM_PRINT(
"d", MarkAsStatic);
2560 OM_PRINT(
"u", PagesPerRegion);
2561 OM_PRINT(
"p", OutOfMemoryFunc);
2562 OM_PRINT(
"p", MemoryLowFunc);
2563 OM_PRINT(
"p", ErrorHook);
2568 Print(
"\n\n[om_ErrorStatus] : '%s' (%s)\n",
2571 Print(
"[om_InternalErrorStatus]: '%s' (%s)\n",
2584 #if defined(PDEBUG) || defined(PDIV_DEBUG) 2585 if(strcmp(sys_cmd,
"pDivStat")==0)
2595 if(strcmp(sys_cmd,
"alarm")==0)
2602 struct itimerval t,o;
2603 memset(&t,0,
sizeof(t));
2604 t.it_value.tv_sec =(unsigned)((
unsigned long)h->Data());
2605 setitimer(ITIMER_VIRTUAL,&t,&o);
2615 if(strcmp(sys_cmd,
"red")==0)
2630 if(strcmp(sys_cmd,
"fastcomb")==0)
2638 Warn(
"Wrong types for poly= comb(ideal,poly)");
2643 (ideal)h->Data(),(
poly)h->next->Data());
2651 if(strcmp(sys_cmd,
"comb")==0)
2659 Warn(
"Wrong types for poly= comb(ideal,poly)");
2664 (ideal)h->Data(),(
poly)h->next->Data());
2673 if(strcmp(sys_cmd,
"listall")==0)
2675 void listall(
int showproc);
2677 if ((h!=
NULL) && (h->Typ()==
INT_CMD)) showproc=(int)((
long)h->Data());
2685 if(strcmp(sys_cmd,
"proclist")==0)
2687 void piShowProcList();
2695 if(strcmp(sys_cmd,
"newton")==0)
2699 || (h->next->next->Typ()!=
INT_CMD))
2701 WerrorS(
"system(\"newton\",<poly>,<int>,<int>) expected");
2710 for (i=0;pp!=
NULL;i++)
2723 (
int) (h->next->Data()),
2724 (
int) (h->next->next->Data())
2737 L->
m[1].
data=(
void *)(
long)r.achse;
2739 L->
m[2].
data=(
void *)(
long)r.deg;
2743 L->
m[3].
data=(
void *)(
long)r.anz_punkte;
2745 int anz = r.anz_punkte;
2748 for (i=0; i<anz*
dim; i++)
2751 L->
m[4].
data=(
void *)v;
2758 (*w)[
i] = r.deg_tab[
i];
2761 while (r.deg_tab[i-1] != -2);
2763 L->
m[5].
data=(
void *)w;
2772 res->
data=(
void *)L;
2795 if (strcmp(sys_cmd,
"minpoly") == 0)
2799 Werror(
"expected exactly one argument: %s",
2800 "a square matrix with number entries");
2810 WerrorS(
"expected exactly one argument: " 2811 "a square matrix with number entries");
2818 res->
data = (
void *)theMinPoly;
2819 for (
int i = 0; i < n; i++)
delete[] ml[i];
2821 delete[] polyCoeffs;
2828 if (strcmp(sys_cmd,
"sdb_flags") == 0)
2836 WerrorS(
"system(\"sdb_flags\",`int`) expected");
2845 if (strcmp(sys_cmd,
"sdb_edit") == 0)
2854 WerrorS(
"system(\"sdb_edit\",`proc`) expected");
2862 #if 0 // for testing only 2863 if (strcmp(sys_cmd,
"GF") == 0)
2880 if (strcmp(sys_cmd,
"svd") == 0)
2895 if (strcmp(sys_cmd,
"DLL") == 0)
2897 typedef void (*Void_Func)();
2898 typedef int (*Int_Func)(int);
2906 f=(Int_Func)
dynl_sym(hh,
"PlusDll");
2908 if (f!=
NULL) printf(
"%d\n",
f(i));
2909 else PrintS(
"cannot find PlusDll\n");
2915 f= (Void_Func)
dynl_sym(hh,
"TestDll");
2917 else PrintS(
"cannot find TestDll\n");
2924 #ifdef HAVE_RING2TOM 2926 if (strcmp(sys_cmd,
"findZeroPoly")==0)
2936 #ifdef HAVE_VANIDEAL 2937 if (strcmp(sys_cmd,
"createG0")==0)
2962 if (strcmp(sys_cmd,
"redNF_ring")==0)
2967 ideal
G = (ideal) h->Data();
2975 if (strcmp(sys_cmd,
"hilbroune") == 0)
2980 I=(ideal)h->CopyD();
2989 if (strcmp(sys_cmd,
"f5")==0)
2998 ideal G = (ideal) h->Data();
3002 opt = (int) (
long) h->Data();
3010 plus = (int) (
long) h->Data();
3018 termination = (int) (
long) h->Data();
3024 res->
data=(ideal)
F5main(G,r,opt,plus,termination);
3031 if (strcmp(sys_cmd,
"NF_ring")==0)
3036 ideal G = (ideal) h->Data();
3042 if (strcmp(sys_cmd,
"spoly")==0)
3053 if (strcmp(sys_cmd,
"testGB")==0)
3055 ideal I = (ideal) h->Data();
3057 ideal GI = (ideal) h->Data();
3066 if ( (strcmp(sys_cmd,
"AltVarStart") == 0) || (strcmp(sys_cmd,
"AltVarEnd") == 0) )
3070 if((h!=
NULL) && (h->Typ()==
RING_CMD)) r = (ring)h->Data();
else 3072 WerrorS(
"`system(\"AltVarStart/End\"[,<ring>])` expected");
3080 if(strcmp(sys_cmd,
"AltVarStart") == 0)
3087 WerrorS(
"`system(\"AltVarStart/End\",<ring>) requires a SCA ring");
3093 #ifdef HAVE_RATGRING 3094 if (strcmp(sys_cmd,
"intratNF") == 0)
3109 I=(ideal)h->CopyD();
3117 is=(int)((
long)(h->Data()));
3125 for(k=0; k < id; k++)
3129 Print(
"starting redRat\n");
3147 if (strcmp(sys_cmd,
"ratNF") == 0)
3166 is=(int)((
long)(h->Data()));
3181 if (strcmp(sys_cmd,
"ratSpoly") == 0)
3199 is=(int)((
long)(h->Data()));
3213 #endif // HAVE_RATGRING 3215 if (strcmp(sys_cmd,
"ratVar") == 0)
3232 return (start==0)||(end==0)||(start>end);
3236 if (strcmp(sys_cmd,
"unifastmult")==0)
3246 if (strcmp(sys_cmd,
"multifastmult")==0)
3256 if (strcmp(sys_cmd,
"mults")==0)
3263 if (strcmp(sys_cmd,
"fastpower")==0)
3268 int n=(int)((
long)h->Data());
3274 if (strcmp(sys_cmd,
"normalpower")==0)
3278 int n=(int)((
long)h->Data());
3284 if (strcmp(sys_cmd,
"MCpower")==0)
3289 int n=(int)((
long)h->Data());
3295 if (strcmp(sys_cmd,
"bit_subst")==0)
3307 if (strcmp(sys_cmd,
"gcd") == 0)
3324 int d=(int)(
long)h->next->Data();
3325 char *s=(
char *)h->Data();
3340 if (strcmp(sys_cmd,
"subring") == 0)
3354 if (strcmp(sys_cmd,
"HNF") == 0)
3375 if (strcmp (sys_cmd,
"probIrredTest") == 0)
3380 char *s=(
char *)h->next->Data();
3381 double error= atof (s);
3393 if (strcmp(sys_cmd,
"python") == 0)
3398 c=(
const char*)h->Data();
3399 if (!PyInitialized) {
3447 if(strcmp(sys_cmd,
"GNUmpLoad")==0)
3451 char* filename = (
char*)h->Data();
3452 FILE* f = fopen(filename,
"r");
3455 WerrorS(
"invalid file name (in paths use '/')");
3458 mpz_t
m; mpz_init(m);
3459 mpz_inp_str(m, f, 10);
3463 res->
data = (
void*)n;
3468 WerrorS(
"expected valid file name as a string");
3480 if(strcmp(sys_cmd,
"intvecMatchingSegments")==0)
3484 (h->next->next ==
NULL))
3489 int validEntries = 0;
3490 for (
int k = 0; k <= ivec->
rows() - jvec->
rows(); k++)
3492 if (memcmp(&(*ivec)[k], &(*jvec)[0],
3493 sizeof(
int) * jvec->
rows()) == 0)
3495 if (validEntries == 0)
3499 r->
resize(validEntries + 1);
3500 (*r)[validEntries] = k + 1;
3506 res->
data = (
void*)r;
3511 WerrorS(
"expected two non-empty intvecs as arguments");
3522 if(strcmp(sys_cmd,
"intvecOverlap")==0)
3526 (h->next->next ==
NULL))
3530 int ir = ivec->
rows();
int jr = jvec->
rows();
3531 int r = jr;
if (ir < jr) r = ir;
3532 while ((r >= 1) && (memcmp(&(*ivec)[ir - r], &(*jvec)[0],
3533 sizeof(
int) * r) != 0))
3536 res->
data = (
void*)(
long)
r;
3541 WerrorS(
"expected two non-empty intvecs as arguments");
3547 if(strcmp(sys_cmd,
"henselfactors")==0)
3550 (h->next !=
NULL) && (h->next->Typ() ==
INT_CMD) &&
3551 (h->next->next !=
NULL) && (h->next->next->Typ() ==
POLY_CMD) &&
3552 (h->next->next->next !=
NULL) &&
3553 (h->next->next->next->Typ() ==
POLY_CMD) &&
3554 (h->next->next->next->next !=
NULL) &&
3555 (h->next->next->next->next->Typ() ==
POLY_CMD) &&
3556 (h->next->next->next->next->next !=
NULL) &&
3557 (h->next->next->next->next->next->Typ() ==
INT_CMD) &&
3558 (h->next->next->next->next->next->next ==
NULL))
3560 int xIndex = (int)(
long)h->Data();
3561 int yIndex = (int)(
long)h->next->Data();
3562 poly hh = (
poly)h->next->next->Data();
3563 poly f0 = (
poly)h->next->next->next->Data();
3564 poly g0 = (
poly)h->next->next->next->next->Data();
3565 int d = (int)(
long)h->next->next->next->next->next->Data();
3573 res->
data = (
char *)L;
3578 WerrorS(
"expected argument list (int, int, poly, poly, poly, int)");
3584 if(strcmp(sys_cmd,
"neworder")==0)
3598 if (strcmp(sys_cmd,
"astep") == 0)
3603 I=(ideal)h->CopyD();
3616 if (strcmp(sys_cmd,
"PrintMat") == 0)
3626 a=(int)((
long)(h->Data()));
3631 b=(int)((
long)(h->Data()));
3646 metric=(int)((
long)(h->Data()));
3657 if(strcmp(sys_cmd,
"NCUseExtensions")==0)
3670 if(strcmp(sys_cmd,
"NCGetType")==0)
3676 res->
data=(
void *)(-1L);
3683 if(strcmp(sys_cmd,
"ForceSCA")==0)
3690 b = (int)((
long)(h->Data()));
3696 e = (int)((
long)(h->Data()));
3707 if(strcmp(sys_cmd,
"ForceNewNCMultiplication")==0)
3719 if(strcmp(sys_cmd,
"ForceNewOldNCMultiplication")==0)
3731 if(strcmp(sys_cmd,
"test64")==0)
3747 Print(
"SIZEOF_LONG=%d\n",SIZEOF_LONG);
3753 if(strcmp(sys_cmd,
"cache_chinrem")==0)
3756 Print(
"caching inverse in chines remainder:%d\n",n_SwitchChinRem);
3758 n_SwitchChinRem=(int)(
long)h->Data();
3764 if(strcmp(sys_cmd,
"LU")==0)
3774 res->
data=(
char*)bb;
3779 WerrorS(
"system(\"LU\",<cmatrix>) expected");
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)
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
#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)
static bool rIsPluralRing(const ring r)
we must always have this test!
CanonicalForm n_convSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
static int pLength(poly a)
int posInT0(const TSet, const int length, LObject &)
void * dynl_open(char *filename)
static poly fglmNewLinearCombination(ideal source, poly monset)
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)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#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)
const char feNotImplemented[]
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)
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
#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
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 > ...
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?
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 omPrintUsedTrackAddrs(FILE *fd, int max_frames)
void omMarkAsStaticAddr(void *addr)
void omPrintUsedAddrs(FILE *fd, int max_frames)
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)
char * singclap_neworder(ideal I, const ring r)
poly ringNF(poly f, ideal G, ring r)
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
void Werror(const char *fmt,...)
int posInT13(const TSet set, const int length, LObject &p)
poly unifastmult(poly f, poly g, ring r)
static poly fglmLinearCombination(ideal source, poly monset)
#define pCopy(p)
return a copy of the poly
#define MATELEM(mat, i, j)
void n_Print(number &a, const coeffs r)
print a number (BEWARE of string buffers!) mostly for debugging
ideal F5main(ideal id, ring r, int opt, int plus, int termination)