Loading...
Searching...
No Matches
misc_ip.cc File Reference

This file provides miscellaneous functionality. More...

`#include "kernel/mod2.h"`
`#include "kernel/oswrapper/vspace.h"`
`#include "misc/sirandom.h"`
`#include "omalloc/omalloc.h"`
`#include "misc/mylimits.h"`
`#include "reporter/si_signals.h"`
`#include "factory/factory.h"`
`#include "coeffs/si_gmp.h"`
`#include "coeffs/coeffs.h"`
`#include "coeffs/flintcf_Q.h"`
`#include "coeffs/flintcf_Qrat.h"`
`#include "coeffs/flintcf_Zn.h"`
`#include "coeffs/rmodulon.h"`
`#include "polys/ext_fields/algext.h"`
`#include "polys/ext_fields/transext.h"`
`#include "polys/nc/gb_hack.h"`
`#include "Singular/links/simpleipc.h"`
`#include "misc_ip.h"`
`#include "ipid.h"`
`#include "feOpt.h"`
`#include "links/silink.h"`
`#include "mod_lib.h"`
`#include "misc/distrib.h"`
`#include "misc/options.h"`
`#include "misc/intvec.h"`
`#include "polys/monomials/ring.h"`
`#include "polys/templates/p_Procs.h"`
`#include "kernel/GBEngine/kstd1.h"`
`#include "kernel/oswrapper/timer.h"`
`#include "resources/feResource.h"`
`#include "kernel/oswrapper/feread.h"`
`#include "subexpr.h"`
`#include "cntrlc.h"`
`#include "ipshell.h"`
`#include "fehelp.h"`
`#include <NTL/version.h>`
`#include <flint/flint.h>`

Go to the source code of this file.

## Macros

#define | PLURAL_INTERNAL_DECLARATIONS 1
#define | SI_SHOW_BUILTIN_MODULE(name)

## Functions

void | setListEntry (lists L, int index, mpz_t n)
void | setListEntry_ui (lists L, int index, unsigned long ui)
static int | factor_using_division (mpz_t t, unsigned int limit, lists primes, int *multiplicities, int &index, unsigned long bound)
static void | factor_using_pollard_rho (mpz_t n, unsigned long a, lists primes, int *multiplicities, int &index)
static void | factor_gmp (mpz_t t, lists primes, int *multiplicities, int &index, unsigned long bound)
lists | primeFactorisation (const number n, const int pBound)
| Factorises a given bigint number n into its prime factors less than or equal to a given bound, with corresponding multiplicities.
void | singular_example (char *str)
BOOLEAN | setOption (leftv res, leftv v)
char * | showOption ()
char * | versionString ()
int | singular_fstat (int fd, struct stat *buf)
void | m2_end (int i)
void | omSingOutOfMemoryFunc ()
static BOOLEAN | ii_FlintZn_init (leftv res, leftv a)
static BOOLEAN | ii_FlintQ_init (leftv res, leftv a)
int | flint_mod_init (SModulFunctions *psModulFunctions)
static BOOLEAN | iiFloat (leftv res, leftv pnn)
static BOOLEAN | iiCrossProd (leftv res, leftv args)
static void | callWerrorS (const char *s)
void | siInit (char *name)

## Variables

STATIC_VAR unsigned | add [] = {4, 2, 4, 2, 4, 6, 2, 6}
const struct soptionStruct | optionStruct []
const struct soptionStruct | verboseStruct []
const char * | singular_date = __DATE__ " " __TIME__
volatile BOOLEAN | m2_end_called = FALSE
STATIC_VAR n_coeffType | n_FlintZn =n_unknown
STATIC_VAR n_coeffType | n_FlintQ =n_unknown

## Detailed Description

This file provides miscellaneous functionality.

For more general information, see the documentation in misc_ip.h.

Definition in file misc_ip.cc.

## Macro Definition Documentation

## PLURAL_INTERNAL_DECLARATIONS

#define PLURAL_INTERNAL_DECLARATIONS 1

Definition at line 14 of file misc_ip.cc.

## SI_SHOW_BUILTIN_MODULE

#define SI_SHOW_BUILTIN_MODULE | ( |  | name | ) |

Value:
StringAppend(" %s", #name);
StringAppend
#define StringAppend
Definition emacs.cc:79
name
char name(const Variable &v)
Definition factory.h:189

## Function Documentation

## callWerrorS()

void callWerrorS | ( | const char * | s | ) |

static

Definition at line 1363 of file misc_ip.cc.

{ WerrorS(s); }
s
const CanonicalForm int s
Definition facAbsFact.cc:51
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24

## factor_gmp()

void factor_gmp | ( | mpz_t | t,
|  | lists | primes,
|  | int * | multiplicities,
|  | int & | index,
|  | unsigned long | bound )

static

Definition at line 328 of file misc_ip.cc.

{
unsigned int division_limit;
if (mpz_sgn (t) == 0)
return;
/* Set the trial division limit according the size of t. */
division_limit = mpz_sizeinbase (t, 2);
if (division_limit > 1000)
division_limit = 1000 * 1000;
else
division_limit = division_limit * division_limit;
if (factor_using_division (t, division_limit,primes,multiplicities,index,bound))
{
if (mpz_cmp_ui (t, 1) != 0)
{
if (mpz_probab_prime_p (t, 10))
{
setListEntry(primes, index, t);
multiplicities[index++] = 1;
mpz_set_ui(t,1);
}
else
factor_using_pollard_rho (t, 1L, primes,multiplicities,index);
}
}
}
bound
static CanonicalForm bound(const CFMatrix &M)
Definition cf_linsys.cc:460
primes
STATIC_VAR unsigned short primes[]
primes, primes_len: used to step through possible extensions
Definition gengftables-conway.cc:60
factor_using_division
static int factor_using_division(mpz_t t, unsigned int limit, lists primes, int *multiplicities, int &index, unsigned long bound)
Definition misc_ip.cc:110
factor_using_pollard_rho
static void factor_using_pollard_rho(mpz_t n, unsigned long a, lists primes, int *multiplicities, int &index)
Definition misc_ip.cc:205
setListEntry
void setListEntry(lists L, int index, mpz_t n)
Definition misc_ip.cc:75
index
static int index(p_Length length, p_Ord ord)
Definition p_Procs_Impl.h:592

## factor_using_division()

int factor_using_division | ( | mpz_t | t,
|  | unsigned int | limit,
|  | lists | primes,
|  | int * | multiplicities,
|  | int & | index,
|  | unsigned long | bound )

static

Definition at line 110 of file misc_ip.cc.

{
mpz_t q, r;
unsigned long int f;
int ai;
unsigned *addv = add;
unsigned int failures;
int bound_not_reached=1;
mpz_init (q);
mpz_init (r);
f = mpz_scan1 (t, 0);
mpz_div_2exp (t, t, f);
if (f>0)
{
setListEntry_ui(primes, index, 2);
multiplicities[index++] = f;
}
f=0;
loop
{
mpz_tdiv_qr_ui (q, r, t, 3);
if (mpz_sgn1 (r) != 0)
break;
mpz_set (t, q);
f++;
}
if (f>0)
{
setListEntry_ui(primes, index, 3);
multiplicities[index++] = f;
}
f=0;
loop
{
mpz_tdiv_qr_ui (q, r, t, 5);
if (mpz_sgn1 (r) != 0)
break;
mpz_set (t, q);
f++;
}
if (f>0)
{
setListEntry_ui(primes, index, 5);
multiplicities[index++] = f;
}
failures = 0;
f = 7;
ai = 0;
unsigned long last_f=0;
while (mpz_cmp_ui (t, 1) != 0)
{
mpz_tdiv_qr_ui (q, r, t, f);
if (mpz_sgn1 (r) != 0)
{
f += addv[ai];
if (mpz_cmp_ui (t, f) < 0)
break;
ai = (ai + 1) & 7;
failures++;
if (failures > limit)
break;
if ((bound!=0) && (f>bound))
{
bound_not_reached=0;
break;
}
}
else
{
mpz_swap (t, q);
if (f!=last_f)
{
setListEntry_ui(primes, index, f);
multiplicities[index]++;
index++;
}
else
{
multiplicities[index-1]++;
}
last_f=f;
failures = 0;
}
}
mpz_clear (q);
mpz_clear (r);
//printf("bound=%d,f=%d,failures=%d, reached=%d\n",bound,f,failures,bound_not_reached);
return bound_not_reached;
}
f
FILE * f
Definition checklibs.c:9
setListEntry_ui
void setListEntry_ui(lists L, int index, unsigned long ui)
Definition misc_ip.cc:92
add
STATIC_VAR unsigned add[]
Definition misc_ip.cc:108
mpz_sgn1
#define mpz_sgn1(A)
Definition si_gmp.h:18
loop
#define loop
Definition structs.h:71

## factor_using_pollard_rho()

void factor_using_pollard_rho | ( | mpz_t | n,
|  | unsigned long | a,
|  | lists | primes,
|  | int * | multiplicities,
|  | int & | index )

static

Definition at line 205 of file misc_ip.cc.

{
mpz_t x, x1, y, P;
mpz_t t1, t2;
mpz_t last_f;
unsigned long long k, l, i;
mpz_init (t1);
mpz_init (t2);
mpz_init_set_ui (last_f, 0);
mpz_init_set_ui (y, 2);
mpz_init_set_ui (x, 2);
mpz_init_set_ui (x1, 2);
mpz_init_set_ui (P, 1);
k = 1;
l = 1;
while (mpz_cmp_ui (n, 1) != 0)
{
loop
{
do
{
mpz_mul (t1, x, x);
mpz_mod (x, t1, n);
mpz_add_ui (x, x, a);
mpz_sub (t1, x1, x);
mpz_mul (t2, P, t1);
mpz_mod (P, t2, n);
if (k % 32 == 1)
{
mpz_gcd (t1, P, n);
if (mpz_cmp_ui (t1, 1) != 0)
goto factor_found;
mpz_set (y, x);
}
}
while (--k != 0);
mpz_gcd (t1, P, n);
if (mpz_cmp_ui (t1, 1) != 0)
goto factor_found;
mpz_set (x1, x);
k = l;
l = 2 * l;
for (i = 0; i < k; i++)
{
mpz_mul (t1, x, x);
mpz_mod (x, t1, n);
mpz_add_ui (x, x, a);
}
mpz_set (y, x);
}
factor_found:
do
{
mpz_mul (t1, y, y);
mpz_mod (y, t1, n);
mpz_add_ui (y, y, a);
mpz_sub (t1, x1, y);
mpz_gcd (t1, t1, n);
}
while (mpz_cmp_ui (t1, 1) == 0);
mpz_divexact (n, n, t1); /* divide by t1, before t1 is overwritten */
if (!mpz_probab_prime_p (t1, 10))
{
do
{
mp_limb_t a_limb;
mpn_random (&a_limb, (mp_size_t) 1);
a = a_limb;
}
while (a == 0);
factor_using_pollard_rho (t1, a, primes,multiplicities,index);
}
else
{
if (mpz_cmp(t1,last_f)==0)
{
multiplicities[index-1]++;
}
else
{
mpz_set(last_f,t1);
setListEntry(primes, index, t1);
multiplicities[index++] = 1;
}
}
mpz_mod (x, x, n);
mpz_mod (x1, x1, n);
mpz_mod (y, y, n);
if (mpz_probab_prime_p (n, 10))
{
if (mpz_cmp(n,last_f)==0)
{
multiplicities[index-1]++;
}
else
{
mpz_set(last_f,n);
setListEntry(primes, index, n);
multiplicities[index++] = 1;
}
mpz_set_ui(n,1);
break;
}
}
mpz_clear (P);
mpz_clear (t2);
mpz_clear (t1);
mpz_clear (x1);
mpz_clear (x);
mpz_clear (y);
mpz_clear (last_f);
}
l
int l
Definition cfEzgcd.cc:100
i
int i
Definition cfEzgcd.cc:132
k
int k
Definition cfEzgcd.cc:99
x
Variable x
Definition cfModGcd.cc:4090
y
const CanonicalForm int const CFList const Variable & y
Definition facAbsFact.cc:53

## flint_mod_init()

int flint_mod_init | ( | SModulFunctions * | psModulFunctions | ) |

Definition at line 1275 of file misc_ip.cc.

{
package save=currPack;
currPack=basePack;
n_FlintQ=nRegister(n_unknown,flintQ_InitChar);
if (n_FlintQ!=n_unknown)
{
iiAddCproc("kernel","flintQp",FALSE,ii_FlintQ_init);
nRegisterCfByName(flintQInitCfByName,n_FlintQ);
}
#if __FLINT_RELEASE >= 20503
iiAddCproc("kernel","flintQ",FALSE,ii_FlintQrat_init);
nRegisterCfByName(flintQInitCfByName,n_FlintQ);
#endif
n_FlintZn=nRegister(n_unknown,flintZn_InitChar);
if (n_FlintZn!=n_unknown)
{
iiAddCproc("kernel","flintZn",FALSE,ii_FlintZn_init);
nRegisterCfByName(flintZnInitCfByName,n_FlintZn);
}
currPack=save;
return MAX_TOK;
}
FALSE
#define FALSE
Definition auxiliary.h:97
n_unknown
@ n_unknown
Definition coeffs.h:28
flintQ_InitChar
BOOLEAN flintQ_InitChar(coeffs cf, void *infoStruct)
Definition flintcf_Q.cc:636
flintQInitCfByName
coeffs flintQInitCfByName(char *s, n_coeffType n)
Definition flintcf_Q.cc:608
flintZn_InitChar
BOOLEAN flintZn_InitChar(coeffs cf, void *infoStruct)
Definition flintcf_Zn.cc:486
flintZnInitCfByName
coeffs flintZnInitCfByName(char *s, n_coeffType n)
Definition flintcf_Zn.cc:432
basePack
VAR package basePack
Definition ipid.cc:56
currPack
VAR package currPack
Definition ipid.cc:55
iiAddCproc
int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition iplib.cc:1073
ii_FlintQ_init
static BOOLEAN ii_FlintQ_init(leftv res, leftv a)
Definition misc_ip.cc:1230
n_FlintQ
STATIC_VAR n_coeffType n_FlintQ
Definition misc_ip.cc:1214
ii_FlintZn_init
static BOOLEAN ii_FlintZn_init(leftv res, leftv a)
Definition misc_ip.cc:1216
n_FlintZn
STATIC_VAR n_coeffType n_FlintZn
Definition misc_ip.cc:1213
nRegisterCfByName
void nRegisterCfByName(cfInitCfByNameProc p, n_coeffType n)
Definition numbers.cc:631
nRegister
n_coeffType nRegister(n_coeffType n, cfInitCharProc p)
Definition numbers.cc:590
MAX_TOK
@ MAX_TOK
Definition tok.h:220

## ii_FlintQ_init()

BOOLEAN ii_FlintQ_init | ( | leftv | res,
|  | leftv | a )

static

Definition at line 1230 of file misc_ip.cc.

{
const short t[]={1,STRING_CMD};
if (iiCheckTypes(a,t,1))
{
char* p;
p=(char*)a->Data();
res->rtyp=CRING_CMD;
res->data=(void*)nInitChar(n_FlintQ,(void*)p);
return FALSE;
}
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
p
int p
Definition cfModGcd.cc:4086
sleftv::Data
void * Data()
Definition subexpr.cc:1192
nInitChar
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition numbers.cc:412
res
CanonicalForm res
Definition facAbsFact.cc:60
iiCheckTypes
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 (...
Definition ipshell.cc:6576
CRING_CMD
@ CRING_CMD
Definition tok.h:56
STRING_CMD
@ STRING_CMD
Definition tok.h:187

## ii_FlintZn_init()

BOOLEAN ii_FlintZn_init | ( | leftv | res,
|  | leftv | a )

static

Definition at line 1216 of file misc_ip.cc.

{
const short t[]={2,INT_CMD,STRING_CMD};
if (iiCheckTypes(a,t,1))
{
flintZn_struct p;
p.ch=(int)(long)a->Data();
p.name=(char*)a->next->Data();
res->rtyp=CRING_CMD;
res->data=(void*)nInitChar(n_FlintZn,(void*)&p);
return FALSE;
}
return TRUE;
}
sleftv::next
leftv next
Definition subexpr.h:86
flintZn_struct
Definition flintcf_Zn.h:17
INT_CMD
@ INT_CMD
Definition tok.h:96

## iiCrossProd()

BOOLEAN iiCrossProd | ( | leftv | res,
|  | leftv | args )

static

Definition at line 1329 of file misc_ip.cc.

{
leftv h=args;
coeffs *c=NULL;
coeffs cf=NULL;
int i=0;
if (h==NULL) goto crossprod_error;
while (h!=NULL)
{
if (h->Typ()!=CRING_CMD) goto crossprod_error;
i++;
h=h->next;
}
c=(coeffs*)omAlloc0((i+1)*sizeof(coeffs));
h=args;
i=0;
while (h!=NULL)
{
c[i]=(coeffs)h->CopyD();
i++;
h=h->next;
}
cf=nInitChar(n_nTupel,c);
res->data=cf;
res->rtyp=CRING_CMD;
return FALSE;
crossprod_error:
WerrorS("expected `crossprod(coeffs, ...)`");
return TRUE;
}
cf
CanonicalForm cf
Definition cfModGcd.cc:4091
n_nTupel
@ n_nTupel
n-tupel of cf: ZZ/p1,... ZZ/pn, R, long_R
Definition coeffs.h:42
h
STATIC_VAR Poly * h
Definition janet.cc:971
coeffs
The main handler for Singular numbers which are suitable for Singular polynomials.
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211
NULL
#define NULL
Definition omList.c:12
leftv
sleftv * leftv
Definition structs.h:53

## iiFloat()

BOOLEAN iiFloat | ( | leftv | res,
|  | leftv | pnn )

static

Definition at line 1300 of file misc_ip.cc.

{
short float_len=3;
short float_len2=SHORT_REAL_LENGTH;
coeffs cf=NULL;
if ((pnn!=NULL) && (pnn->Typ()==INT_CMD))
{
float_len=(int)(long)pnn->Data();
float_len2=float_len;
pnn=pnn->next;
if ((pnn!=NULL) && (pnn->Typ()==INT_CMD))
{
float_len2=(int)(long)pnn->Data();
pnn=pnn->next;
}
}
if (float_len2 <= (short)SHORT_REAL_LENGTH)
cf=nInitChar(n_R, NULL);
else // longR or longC?
{
LongComplexInfo param;
param.float_len = si_min (float_len, 32767);
param.float_len2 = si_min (float_len2, 32767);
cf = nInitChar(n_long_R, (void*)&param);
}
res->rtyp=CRING_CMD;
res->data=cf;
return cf==NULL;
}
si_min
static int si_min(const int a, const int b)
Definition auxiliary.h:126
sleftv::Typ
int Typ()
Definition subexpr.cc:1048
n_R
@ n_R
single prescision (6,6) real numbers
Definition coeffs.h:31
n_long_R
@ n_long_R
real floating point (GMP) numbers
Definition coeffs.h:33
LongComplexInfo::float_len2
short float_len2
additional char-flags, rInit
Definition coeffs.h:109
LongComplexInfo::float_len
short float_len
additional char-flags, rInit
Definition coeffs.h:108
LongComplexInfo
Definition coeffs.h:107
SHORT_REAL_LENGTH
#define SHORT_REAL_LENGTH
Definition numbers.h:57

## m2_end()

void m2_end | ( | int | i | ) |

Definition at line 1104 of file misc_ip.cc.

{
if (!m2_end_called)
{
EXTERN_VAR FILE* File_Profiling;
EXTERN_VAR FILE* File_Log;
EXTERN_VAR BOOLEAN File_Log_written;
if (File_Profiling!=NULL) { fclose(File_Profiling); File_Profiling=NULL; }
if (File_Log!=NULL)
{
fclose(File_Log);
File_Log=NULL;
if (File_Log_written==FALSE) // remove empty logs
{
int pid=getpid();
char buf[20];
snprintf(buf,20,"/tmp/sing_log.%d",pid);
remove(buf);
}
}
m2_end_called = TRUE;
#ifdef HAVE_SIMPLEIPC
for (int j = SIPC_MAX_SEMAPHORES-1; j >= 0; j--)
{
if (semaphore[j] != NULL)
{
while (sem_acquired[j] > 0)
{
#if PORTABLE_SEMAPHORES
sem_post(semaphore[j]->sig);
#else
sem_post(semaphore[j]);
#endif
sem_acquired[j]--;
}
}
}
#endif // HAVE_SIMPLEIPC
monitor(NULL,0);
if (ssiToBeClosed_inactive)
{
link_list hh=ssiToBeClosed;
while(hh!=NULL)
{
//Print("close %s\n",hh->l->name);
slPrepClose(hh->l);
hh=(link_list)hh->next;
}
ssiToBeClosed_inactive=FALSE;
idhdl h = currPack->idroot;
while(h != NULL)
{
if(IDTYP(h) == LINK_CMD)
{
idhdl hh=h->next;
//Print("kill %s\n",IDID(h));
killhdl(h, currPack);
h = hh;
}
else
{
h = h->next;
}
}
hh=ssiToBeClosed;
while(hh!=NULL)
{
//Print("close %s\n",hh->l->name);
slClose(hh->l);
hh=ssiToBeClosed;
}
}
#ifdef PAGE_TEST
mmEndStat();
#endif
fe_reset_input_mode();
if (!singular_in_batchmode)
{
if (TEST_V_QUIET)
{
if ((i==0)||(i==1))
printf("Auf Wiedersehen.\n");
}
if (i>1)
{
printf("\nhalt %d\n",i);
}
}
if (i>1) exit(i);
else if (i==1) exit(0);
else if (i<0) _exit(0);
}
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
singular_in_batchmode
VAR BOOLEAN singular_in_batchmode
Definition cntrlc.cc:62
j
int j
Definition facHensel.cc:110
monitor
void monitor(void *F, int mode)
Definition febase.cc:68
fe_reset_input_mode
void fe_reset_input_mode()
Definition fereadl.c:831
File_Profiling
VAR FILE * File_Profiling
Definition fevoices.cc:32
File_Log_written
VAR BOOLEAN File_Log_written
Definition fevoices.cc:34
File_Log
VAR FILE * File_Log
Definition fevoices.cc:33
EXTERN_VAR
#define EXTERN_VAR
Definition globaldefs.h:6
killhdl
void killhdl(idhdl h, package proot)
Definition ipid.cc:414
IDTYP
#define IDTYP(a)
Definition ipid.h:119
m2_end_called
volatile BOOLEAN m2_end_called
Definition misc_ip.cc:1097
TEST_V_QUIET
#define TEST_V_QUIET
Definition options.h:135
idhdl
idrec * idhdl
Definition ring.h:22
semaphore
VAR sipc_sem_t * semaphore[SIPC_MAX_SEMAPHORES]
Definition semaphore.c:24
sem_acquired
VAR int sem_acquired[SIPC_MAX_SEMAPHORES]
Definition semaphore.c:25
buf
int status int void * buf
Definition si_signals.h:69
slPrepClose
BOOLEAN slPrepClose(si_link l)
Definition silink.cc:223
slClose
BOOLEAN slClose(si_link l)
Definition silink.cc:240
ssiToBeClosed_inactive
EXTERN_VAR volatile BOOLEAN ssiToBeClosed_inactive
Definition silink.h:131
link_list
link_struct * link_list
Definition silink.h:128
link_struct::next
void * next
Definition silink.h:125
link_struct::l
si_link l
Definition silink.h:124
ssiToBeClosed
EXTERN_VAR link_list ssiToBeClosed
Definition silink.h:130
SIPC_MAX_SEMAPHORES
#define SIPC_MAX_SEMAPHORES
Definition simpleipc.h:10
LINK_CMD
@ LINK_CMD
Definition tok.h:117

## omSingOutOfMemoryFunc()

void omSingOutOfMemoryFunc | ( |  | ) |

Definition at line 1202 of file misc_ip.cc.

{
fprintf(stderr, "\nSingular error: no more memory\n");
omPrintStats(stderr);
m2_end(14);
/* should never get here */
exit(1);
}
m2_end
void m2_end(int i)
Definition misc_ip.cc:1104
omPrintStats
#define omPrintStats(F)
Definition xalloc.h:231

## primeFactorisation()

lists primeFactorisation | ( | const number | n,
|  | const int | pBound )

Factorises a given bigint number n into its prime factors less than or equal to a given bound, with corresponding multiplicities.

The method finds all prime factors with multiplicities. If a positive bound is given, then only the prime factors <= pBound are being found. In this case, there may remain an unfactored portion m of n. Also, when n is negative, m will contain the sign. If n is zero, m will be zero. The method returns a list L filled with three entries: L[1] a list; L[1][i] contains the i-th prime factor of |n| as int or bigint (sorted in ascending order), L[2] a list; L[2][i] contains the multiplicity of L[1, i] in |n| as int L[3] contains the remainder m as int or bigint, depending on the size,

We thus have: n = L[1][1]^L[2][1] * ... * L[1][k]^L[2][k] * L[3], where k is the number of mutually distinct prime factors (<= a provided non- zero bound). Note that for n = 0, L[1] and L[2] will be empty lists and L[3] will be zero.

Returns
  the factorisation data in a SINGULAR-internal list

Parameters

  [in] | n | the bigint > 0 to be factorised
  [in] | pBound | bound on the prime factors seeked

Definition at line 358 of file misc_ip.cc.

{
int i;
int index=0;
mpz_t nn; number2mpz(n, coeffs_BIGINT, nn);
lists primes = (lists)omAllocBin(slists_bin); primes->Init(1000);
int* multiplicities = (int*)omAlloc0(1000*sizeof(int));
int positive=1;
if (!n_IsZero(n, coeffs_BIGINT))
{
if (!n_GreaterZero(n, coeffs_BIGINT))
{
positive=-1;
mpz_neg(nn,nn);
}
factor_gmp(nn,primes,multiplicities,index,pBound);
}
lists primesL = (lists)omAllocBin(slists_bin);
primesL->Init(index);
for (i = 0; i < index; i++)
{
primesL->m[i].rtyp = primes->m[i].rtyp;
primesL->m[i].data = primes->m[i].data;
primes->m[i].rtyp=0;
primes->m[i].data=NULL;
}
primes->Clean(NULL);
lists multiplicitiesL = (lists)omAllocBin(slists_bin);
multiplicitiesL->Init(index);
for (i = 0; i < index; i++)
{
multiplicitiesL->m[i].rtyp = INT_CMD;
multiplicitiesL->m[i].data = (void*)(long)multiplicities[i];
}
omFree(multiplicities);
lists L=(lists)omAllocBin(slists_bin);
L->Init(3);
if (positive==-1) mpz_neg(nn,nn);
L->m[0].rtyp = LIST_CMD; L->m[0].data = (void*)primesL;
L->m[1].rtyp = LIST_CMD; L->m[1].data = (void*)multiplicitiesL;
setListEntry(L, 2, nn);
mpz_clear(nn);
return L;
}
sleftv::rtyp
int rtyp
Definition subexpr.h:91
sleftv::data
void * data
Definition subexpr.h:88
slists::m
sleftv * m
Definition lists.h:46
slists::Init
INLINE_THIS void Init(int l=0)
number2mpz
static FORCE_INLINE void number2mpz(number n, coeffs c, mpz_t m)
Definition coeffs.h:990
n_GreaterZero
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2),...
Definition coeffs.h:500
n_IsZero
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition coeffs.h:470
slists_bin
VAR omBin slists_bin
Definition lists.cc:23
factor_gmp
static void factor_gmp(mpz_t t, lists primes, int *multiplicities, int &index, unsigned long bound)
Definition misc_ip.cc:328
lists
slists * lists
Definition mpr_numeric.h:146
omAllocBin
#define omAllocBin(bin)
Definition omAllocDecl.h:205
omFree
#define omFree(addr)
Definition omAllocDecl.h:261
coeffs_BIGINT
VAR coeffs coeffs_BIGINT
Definition polys.cc:14
LIST_CMD
@ LIST_CMD
Definition tok.h:118

## setListEntry()

void setListEntry | ( | lists | L,
|  | int | index,
|  | mpz_t | n )

Definition at line 75 of file misc_ip.cc.

{ /* assumes n > 0 */
/* try to fit nn into an int: */
if (mpz_size1(n)<=1)
{
int ui=(int)mpz_get_si(n);
if ((((ui<<3)>>3)==ui)
&& (mpz_cmp_si(n,(long)ui)==0))
{
L->m[index].rtyp = INT_CMD; L->m[index].data = (void*)(long)ui;
return;
}
}
number nn = mpz2number(n, coeffs_BIGINT);
L->m[index].rtyp = BIGINT_CMD; L->m[index].data = (void*)nn;
}
mpz2number
static FORCE_INLINE number mpz2number(mpz_t m, coeffs c)
Definition coeffs.h:991
mpz_size1
#define mpz_size1(A)
Definition si_gmp.h:17
BIGINT_CMD
@ BIGINT_CMD
Definition tok.h:38

## setListEntry_ui()

void setListEntry_ui | ( | lists | L,
|  | int | index,
|  | unsigned long | ui )

Definition at line 92 of file misc_ip.cc.

{ /* assumes n > 0 */
/* try to fit nn into an int: */
int i=(int)ui;
if ((((unsigned long)i)==ui) && (((i<<3)>>3)==i))
{
L->m[index].rtyp = INT_CMD; L->m[index].data = (void*)(long)i;
}
else
{
number nn = n_Init(ui, coeffs_BIGINT);
L->m[index].rtyp = BIGINT_CMD; L->m[index].data = (void*)nn;
}
}
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition coeffs.h:541

## setOption()

BOOLEAN setOption | ( | leftv | res,
|  | leftv | v )

Definition at line 570 of file misc_ip.cc.

{
const char *n;
do
{
if (v->Typ()==STRING_CMD)
{
n=(const char *)v->CopyD(STRING_CMD);
}
else
{
if (v->name==NULL)
return TRUE;
if (v->rtyp==0)
{
n=v->name;
v->name=NULL;
}
else
{
n=omStrDup(v->name);
}
}
int i;
if(strcmp(n,"get")==0)
{
intvec *w=new intvec(2);
(*w)[0]=si_opt_1;
(*w)[1]=si_opt_2;
res->rtyp=INTVEC_CMD;
res->data=(void *)w;
goto okay;
}
if(strcmp(n,"set")==0)
{
if((v->next!=NULL)
&&(v->next->Typ()==INTVEC_CMD))
{
v=v->next;
intvec *w=(intvec*)v->Data();
si_opt_1=(*w)[0];
si_opt_2=(*w)[1];
#if 0
if (TEST_OPT_INTSTRATEGY && (currRing!=NULL)
&& rField_has_simple_inverse()
&& !rField_is_Ring(currRing)
) {
si_opt_1 &=~Sy_bit(OPT_INTSTRATEGY);
}
#endif
goto okay;
}
}
if(strcmp(n,"none")==0)
{
si_opt_1=0;
si_opt_2=0;
goto okay;
}
for (i=0; (i==0) || (optionStruct[i-1].setval!=0); i++)
{
if (strcmp(n,optionStruct[i].name)==0)
{
if (optionStruct[i].setval & validOpts)
{
si_opt_1 |= optionStruct[i].setval;
// optOldStd disables redthrough
if (optionStruct[i].setval == Sy_bit(OPT_OLDSTD))
si_opt_1 &= ~Sy_bit(OPT_REDTHROUGH);
}
else
WarnS("cannot set option");
#if 0
if (TEST_OPT_INTSTRATEGY && (currRing!=NULL)
&& rField_has_simple_inverse()
&& !rField_is_Ring(currRing)
) {
test &=~Sy_bit(OPT_INTSTRATEGY);
}
#endif
goto okay;
}
else if ((strncmp(n,"no",2)==0)
&& (strcmp(n+2,optionStruct[i].name)==0))
{
if (optionStruct[i].setval & validOpts)
{
si_opt_1 &= optionStruct[i].resetval;
}
else
WarnS("cannot clear option");
goto okay;
}
}
for (i=0; (i==0) || (verboseStruct[i-1].setval!=0); i++)
{
if (strcmp(n,verboseStruct[i].name)==0)
{
si_opt_2 |= verboseStruct[i].setval;
#ifdef YYDEBUG
#if YYDEBUG
/*debugging the bison grammar --> grammar.cc*/
EXTERN_VAR int yydebug;
if (BVERBOSE(V_YACC)) yydebug=1;
else yydebug=0;
#endif
#endif
goto okay;
}
else if ((strncmp(n,"no",2)==0)
&& (strcmp(n+2,verboseStruct[i].name)==0))
{
si_opt_2 &= verboseStruct[i].resetval;
#ifdef YYDEBUG
#if YYDEBUG
/*debugging the bison grammar --> grammar.cc*/
EXTERN_VAR int yydebug;
if (BVERBOSE(V_YACC)) yydebug=1;
else yydebug=0;
#endif
#endif
goto okay;
}
}
Werror("unknown option `%s`",n);
okay:
if (currRing != NULL)
currRing->options = si_opt_1 & TEST_RINGDEP_OPTS;
omFreeBinAddr((ADDRESS)n);
v=v->next;
} while (v!=NULL);
// set global variable to show memory usage
if (BVERBOSE(V_SHOW_MEM)) om_sing_opt_show_mem = 1;
else om_sing_opt_show_mem = 0;
return FALSE;
}
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
test
CanonicalForm test
Definition cfModGcd.cc:4104
intvec
Definition intvec.h:24
WarnS
#define WarnS
Definition emacs.cc:78
w
const CanonicalForm & w
Definition facAbsFact.cc:51
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
yydebug
int yydebug
Definition grammar.cc:1843
verboseStruct
const struct soptionStruct verboseStruct[]
Definition misc_ip.cc:539
optionStruct
const struct soptionStruct optionStruct[]
Definition misc_ip.cc:508
validOpts
VAR BITSET validOpts
Definition kstd1.cc:60
omStrDup
#define omStrDup(s)
Definition omAllocDecl.h:263
omFreeBinAddr
#define omFreeBinAddr(addr)
Definition omAllocDecl.h:258
om_sing_opt_show_mem
int om_sing_opt_show_mem
si_opt_2
VAR unsigned si_opt_2
Definition options.c:6
si_opt_1
VAR unsigned si_opt_1
Definition options.c:5
OPT_INTSTRATEGY
#define OPT_INTSTRATEGY
Definition options.h:93
TEST_OPT_INTSTRATEGY
#define TEST_OPT_INTSTRATEGY
Definition options.h:112
BVERBOSE
#define BVERBOSE(a)
Definition options.h:35
V_SHOW_MEM
#define V_SHOW_MEM
Definition options.h:43
V_YACC
#define V_YACC
Definition options.h:44
OPT_REDTHROUGH
#define OPT_REDTHROUGH
Definition options.h:83
Sy_bit
#define Sy_bit(x)
Definition options.h:31
TEST_RINGDEP_OPTS
#define TEST_RINGDEP_OPTS
Definition options.h:101
OPT_OLDSTD
#define OPT_OLDSTD
Definition options.h:87
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
Werror
void Werror(const char *fmt,...)
Definition reporter.cc:189
rField_has_simple_inverse
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition ring.h:554
rField_is_Ring
#define rField_is_Ring(R)
Definition ring.h:491
INTVEC_CMD
@ INTVEC_CMD
Definition tok.h:101

## showOption()

char * showOption | ( |  | ) |

Definition at line 711 of file misc_ip.cc.

{
int i;
BITSET tmp;
StringSetS("//options:");
if ((si_opt_1!=0)||(si_opt_2!=0))
{
tmp=si_opt_1;
if(tmp)
{
for (i=0; optionStruct[i].setval!=0; i++)
{
if (optionStruct[i].setval & tmp)
{
StringAppend(" %s",optionStruct[i].name);
tmp &=optionStruct[i].resetval;
}
}
for (i=0; i<32; i++)
{
if (tmp & Sy_bit(i)) StringAppend(" %d",i);
}
}
tmp=si_opt_2;
if (tmp)
{
for (i=0; verboseStruct[i].setval!=0; i++)
{
if (verboseStruct[i].setval & tmp)
{
StringAppend(" %s",verboseStruct[i].name);
tmp &=verboseStruct[i].resetval;
}
}
for (i=1; i<32; i++)
{
if (tmp & Sy_bit(i)) StringAppend(" %d",i+32);
}
}
return StringEndS();
}
StringAppendS(" none");
return StringEndS();
}
BITSET
#define BITSET
Definition auxiliary.h:85
StringSetS
void StringSetS(const char *st)
Definition reporter.cc:128
StringAppendS
void StringAppendS(const char *st)
Definition reporter.cc:107
StringEndS
char * StringEndS()
Definition reporter.cc:151

## siInit()

void siInit | ( | char * | name | ) |

Definition at line 1364 of file misc_ip.cc.

{
// memory initialization: -----------------------------------------------
om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc;
#ifndef OM_NDEBUG
#ifndef __OPTIMIZE__
#ifndef MAKE_DISTRUBTION
om_Opts.ErrorHook = dErrorBreak;
#endif
#else
om_Opts.Keep = 0; /* !OM_NDEBUG, __OPTIMIZE__*/
#endif
#else
om_Opts.Keep = 0; /* OM_NDEBUG */
#endif
omInitInfo();
// factory
#ifndef HAVE_NTL
extern void initPT();
initPT();
#endif
{ // set cpus (in siInit), if SINGULAR_CPUS is set, set within the limits
char *env_cpu=getenv("SINGULAR_CPUS");
if (env_cpu!=NULL)
{
int cpu_n,cpus;
#ifdef _SC_NPROCESSORS_ONLN
if ((cpu_n=sysconf(_SC_NPROCESSORS_ONLN))>cpus) cpus=cpu_n;
#elif defined(_SC_NPROCESSORS_CONF)
if ((cpu_n=sysconf(_SC_NPROCESSORS_CONF))>cpus) cpus=cpu_n;
#endif
#ifdef HAVE_SIMPLEIPC
if (cpus>SIPC_MAX_SEMAPHORES) cpus=SIPC_MAX_SEMAPHORES;
#endif
int t=atoi(env_cpu);
if ((t>=0)&&(t<cpus)) cpus=t;
feSetOptValue(FE_OPT_CPUS, cpus);
// how many threads ? -----------------------------------------------------
feSetOptValue(FE_OPT_THREADS, cpus);
}
}
// options ---------------------------------------------------------------
si_opt_1=0;
// interpreter tables etc.: -----------------------------------------------
memset(&sLastPrinted,0,sizeof(sleftv));
sLastPrinted.rtyp=NONE;
extern int iiInitArithmetic(); iiInitArithmetic(); // iparith.cc
basePack=(package)omAlloc0(sizeof(*basePack));
currPack=basePack;
idhdl h;
h=enterid("Top", 0, PACKAGE_CMD, &IDROOT, FALSE);
IDPACKAGE(h)=basePack;
IDPACKAGE(h)->language = LANG_TOP;
currPackHdl=h;
basePackHdl=h;
coeffs_BIGINT = nInitChar(n_Q,(void*)1);
#if 1
// def HAVE_POLYEXTENSIONS
if(TRUE)
{
n_coeffType type;
#ifdef SINGULAR_4_2
type = nRegister(n_polyExt, n2pInitChar);
assume(type == n_polyExt);
#endif
type = nRegister(n_algExt, naInitChar);
assume(type == n_algExt);
type = nRegister(n_transExt, ntInitChar);
assume(type == n_transExt);
(void)type;
}
#endif
// random generator: -----------------------------------------------
{
int t=startTimer();
if (t==0) t=1;
initRTimer();
siSeed=t;
factoryseed(t);
siRandomStart=t;
feOptSpec[FE_OPT_RANDOM].value = (void*) ((long)siRandomStart);
}
// ressource table: ----------------------------------------------------
// Don't worry: ifdef OM_NDEBUG, then all these calls are undef'ed
// hack such that all shared' libs in the bindir are loaded correctly
feInitResources(name);
// singular links: --------------------------------------------------
slStandardInit();
myynest=0;
// default coeffs
{
idhdl h;
h=enterid("QQ",0/*level*/, CRING_CMD,&(basePack->idroot),FALSE /*init*/,FALSE /*search*/);
IDDATA(h)=(char*)nInitChar(n_Q,NULL);
h=enterid("ZZ",0/*level*/, CRING_CMD,&(basePack->idroot),FALSE /*init*/,FALSE /*search*/);
IDDATA(h)=(char*)nInitChar(n_Z,NULL);
nRegisterCfByName(nrnInitCfByName,n_Zn); // and n_Znm
iiAddCproc("kernel","crossprod",FALSE,iiCrossProd);
iiAddCproc("kernel","Float",FALSE,iiFloat);
//h=enterid("RR",0/*level*/, CRING_CMD,&(basePack->idroot),FALSE /*init*/,FALSE /*search*/);
//IDDATA(h)=(char*)nInitChar(n_R,NULL);
//h=enterid("CC",0/*level*/, CRING_CMD,&(basePack->idroot),FALSE /*init*/,FALSE /*search*/);
//IDDATA(h)=(char*)nInitChar(n_long_C,NULL);
}
// setting routines for PLURAL QRINGS:
// allowing to use libpolys without libSingular(kStd)
#ifdef HAVE_PLURAL
nc_NF=k_NF;
gnc_gr_bba=k_gnc_gr_bba;
gnc_gr_mora=k_gnc_gr_mora;
sca_bba=k_sca_bba;
sca_mora=k_sca_mora;
sca_gr_bba=k_sca_gr_bba;
#endif
// loading standard.lib -----------------------------------------------
if (! feOptValue(FE_OPT_NO_STDLIB))
{
BITSET save1,save2;
SI_SAVE_OPT(save1,save2);
si_opt_2 &= ~Sy_bit(V_LOAD_LIB);
iiLibCmd("standard.lib", TRUE,TRUE,TRUE);
SI_RESTORE_OPT(save1,save2);
}
// interpreter error handling
#ifndef __CYGWIN__
factoryError=callWerrorS; // to honour later changes of variable WerrorS
#endif
errorreported = 0;
}
naInitChar
BOOLEAN naInitChar(coeffs cf, void *infoStruct)
Initialize the coeffs object.
Definition algext.cc:1433
n2pInitChar
BOOLEAN n2pInitChar(coeffs cf, void *infoStruct)
Definition algext.cc:1687
slStandardInit
void slStandardInit()
Definition asciiLink.cc:633
initPT
void initPT()
factoryseed
void factoryseed(int s)
random seed initializer
Definition cf_random.cc:186
factoryError
VAR void(* factoryError)(const char *s)
Definition cf_util.cc:80
sleftv
Class used for (list of) interpreter objects.
Definition subexpr.h:83
siRandomStart
VAR int siRandomStart
Definition cntrlc.cc:99
n_coeffType
n_coeffType
Definition coeffs.h:27
n_polyExt
@ n_polyExt
used to represent polys as coefficients
Definition coeffs.h:34
n_Q
@ n_Q
rational (GMP) numbers
Definition coeffs.h:30
n_algExt
@ n_algExt
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic
Definition coeffs.h:35
n_Zn
@ n_Zn
only used if HAVE_RINGS is defined
Definition coeffs.h:44
n_transExt
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition coeffs.h:38
n_Z
@ n_Z
only used if HAVE_RINGS is defined
Definition coeffs.h:43
errorreported
VAR short errorreported
Definition feFopen.cc:23
feSetOptValue
const char * feSetOptValue(feOptIndex opt, char *optarg)
Definition feOpt.cc:154
feOptValue
static void * feOptValue(feOptIndex opt)
Definition feOpt.h:40
feOptSpec
EXTERN_VAR struct fe_option feOptSpec[]
Definition feOpt.h:17
feInitResources
void feInitResources(const char *argv0)
Definition feResource.cc:160
myynest
VAR int myynest
Definition febase.cc:41
getenv
char * getenv()
gnc_gr_bba
EXTERN_VAR BBA_Proc gnc_gr_bba
Definition gb_hack.h:10
gnc_gr_mora
EXTERN_VAR BBA_Proc gnc_gr_mora
Definition gb_hack.h:10
sca_gr_bba
EXTERN_VAR BBA_Proc sca_gr_bba
Definition gb_hack.h:10
nc_NF
EXTERN_VAR NF_Proc nc_NF
Definition gb_hack.h:9
sca_mora
EXTERN_VAR BBA_Proc sca_mora
Definition gb_hack.h:10
sca_bba
EXTERN_VAR BBA_Proc sca_bba
Definition gb_hack.h:10
k_gnc_gr_bba
ideal k_gnc_gr_bba(const ideal F, const ideal Q, const intvec *, const bigintmat *, kStrategy strat, const ring _currRing)
Definition gr_kstd2.cc:1030
k_gnc_gr_mora
ideal k_gnc_gr_mora(const ideal F, const ideal Q, const intvec *, const bigintmat *, kStrategy strat, const ring _currRing)
Definition gr_kstd2.cc:1283
iiInitArithmetic
int iiInitArithmetic()
initialisation of arithmetic structured data
Definition iparith.cc:9988
enterid
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition ipid.cc:279
currPackHdl
VAR idhdl currPackHdl
Definition ipid.cc:53
basePackHdl
VAR idhdl basePackHdl
Definition ipid.cc:54
IDDATA
#define IDDATA(a)
Definition ipid.h:126
IDROOT
#define IDROOT
Definition ipid.h:19
IDPACKAGE
#define IDPACKAGE(a)
Definition ipid.h:139
iiLibCmd
BOOLEAN iiLibCmd(const char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force)
Definition iplib.cc:894
k_sca_bba
ideal k_sca_bba(const ideal F, const ideal Q, const intvec *, const bigintmat *, kStrategy strat, const ring _currRing)
Modified modern Sinuglar Buchberger's algorithm.
Definition sca.cc:368
k_sca_gr_bba
ideal k_sca_gr_bba(const ideal F, const ideal Q, const intvec *, const bigintmat *, kStrategy strat, const ring _currRing)
Modified Plural's Buchberger's algorithmus.
Definition sca.cc:95
k_sca_mora
ideal k_sca_mora(const ideal F, const ideal Q, const intvec *, const bigintmat *, kStrategy strat, const ring _currRing)
Modified modern Sinuglar Mora's algorithm.
Definition sca.cc:878
k_NF
poly k_NF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce, const ring _currRing)
NOTE: this is just a wrapper which sets currRing for the actual kNF call.
Definition kstd1.cc:3443
iiCrossProd
static BOOLEAN iiCrossProd(leftv res, leftv args)
Definition misc_ip.cc:1329
omSingOutOfMemoryFunc
void omSingOutOfMemoryFunc()
Definition misc_ip.cc:1202
iiFloat
static BOOLEAN iiFloat(leftv res, leftv pnn)
Definition misc_ip.cc:1300
callWerrorS
static void callWerrorS(const char *s)
Definition misc_ip.cc:1363
dErrorBreak
void dErrorBreak(void)
Definition dError.cc:140
assume
#define assume(x)
Definition mod2.h:389
om_Opts
omOpts_t om_Opts
Definition omOpts.c:13
SI_SAVE_OPT
#define SI_SAVE_OPT(A, B)
Definition options.h:20
V_LOAD_LIB
#define V_LOAD_LIB
Definition options.h:47
SI_RESTORE_OPT
#define SI_RESTORE_OPT(A, B)
Definition options.h:23
nrnInitCfByName
coeffs nrnInitCfByName(char *s, n_coeffType)
Definition rmodulon.cc:33
siSeed
VAR int siSeed
Definition sirandom.c:30
package
ip_package * package
Definition structs.h:39
sLastPrinted
INST_VAR sleftv sLastPrinted
Definition subexpr.cc:46
LANG_TOP
@ LANG_TOP
Definition subexpr.h:22
startTimer
int startTimer()
Definition timer.cc:66
initRTimer
void initRTimer()
Definition timer.cc:136
PACKAGE_CMD
@ PACKAGE_CMD
Definition tok.h:150
NONE
#define NONE
Definition tok.h:223
ntInitChar
BOOLEAN ntInitChar(coeffs cf, void *infoStruct)
Initialize the coeffs object.
Definition transext.cc:2636
omInitInfo
#define omInitInfo()
Definition xalloc.h:228

## singular_example()

void singular_example | ( | char * | str | ) |

Definition at line 431 of file misc_ip.cc.

{
assume(str!=NULL);
char *s=str;
while (*s==' ') s++;
char *ss=s;
while (*ss!='\0') ss++;
while (*ss<=' ')
{
*ss='\0';
ss--;
}
idhdl h=IDROOT->get_level(s,0);
if ((h!=NULL) && (IDTYP(h)==PROC_CMD))
{
char *lib=iiGetLibName(IDPROC(h));
if((lib!=NULL)&&(*lib!='\0'))
{
Print("// proc %s from lib %s\n",s,lib);
s=iiGetLibProcBuffer(IDPROC(h), 2);
if (s!=NULL)
{
if (strlen(s)>5)
{
iiEStart(s,IDPROC(h));
omFree((ADDRESS)s);
return;
}
else omFree((ADDRESS)s);
}
}
}
else
{
char sing_file[MAXPATHLEN];
FILE *fd=NULL;
char *res_m=feResource('m', 0);
if (res_m!=NULL)
{
snprintf(sing_file,MAXPATHLEN, "%s/%s.sing", res_m, s);
fd = feFopen(sing_file, "r");
}
if (fd != NULL)
{
int old_echo = si_echo;
int length, got;
char* s;
fseek(fd, 0, SEEK_END);
length = ftell(fd);
fseek(fd, 0, SEEK_SET);
s = (char*) omAlloc((length+20)*sizeof(char));
got = fread(s, sizeof(char), length, fd);
fclose(fd);
if (got != length)
{
Werror("Error while reading file %s", sing_file);
}
else
{
s[length] = '\0';
strcat(s, "\n;return();\n\n");
si_echo = 2;
iiEStart(s, NULL);
si_echo = old_echo;
}
omFree(s);
}
else
{
Werror("no example for %s", str);
}
}
}
Print
#define Print
Definition emacs.cc:80
feFopen
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
Definition feFopen.cc:47
feResource
static char * feResource(feResourceConfig config, int warn)
Definition feResource.cc:233
si_echo
VAR int si_echo
Definition febase.cc:35
PROC_CMD
@ PROC_CMD
Definition grammar.cc:281
length
static BOOLEAN length(leftv result, leftv arg)
Definition interval.cc:257
IDPROC
#define IDPROC(a)
Definition ipid.h:140
iiEStart
BOOLEAN iiEStart(char *example, procinfo *pi)
Definition iplib.cc:763
iiGetLibProcBuffer
char * iiGetLibProcBuffer(procinfo *pi, int part)
Definition iplib.cc:197
iiGetLibName
static char * iiGetLibName(const procinfov pi)
find the library of an proc
Definition ipshell.h:66
SEEK_SET
#define SEEK_SET
Definition mod2.h:115
SEEK_END
#define SEEK_END
Definition mod2.h:111
LibThread::str
char * str(leftv arg)
Definition shared.cc:699
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210
MAXPATHLEN
#define MAXPATHLEN
Definition omRet2Info.c:22
fd
int status int fd
Definition si_signals.h:69

## singular_fstat()

int singular_fstat | ( | int | fd,
|  | struct stat * | buf )

Definition at line 1084 of file misc_ip.cc.

{
return si_fstat(fd,buf);
}

## versionString()

char * versionString | ( |  | ) |

Definition at line 769 of file misc_ip.cc.

{
StringSetS("");
StringAppend("Singular for %s version %s (%d, %d bit) %s",
S_UNAME, VERSION, // SINGULAR_VERSION,
SINGULAR_VERSION, sizeof(void*)*8,
#ifdef MAKE_DISTRIBUTION
VERSION_DATE);
#else
singular_date);
#endif
StringAppendS("\nwith\n\t");
#if defined(mpir_version)
StringAppend("MPIR(%s)~GMP(%s),", mpir_version, gmp_version);
#elif defined(gmp_version)
// #if defined (__GNU_MP_VERSION) && defined (__GNU_MP_VERSION_MINOR)
// StringAppend("GMP(%d.%d),",__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR);
StringAppend("GMP(%s),", gmp_version);
#endif
#ifdef HAVE_NTL
StringAppend("NTL(%s),",NTL_VERSION);
#endif
#ifdef HAVE_FLINT
StringAppend("FLINT(%s),",FLINT_VERSION);
#endif
// StringAppendS("factory(" FACTORYVERSION "),");
StringAppendS("\n\t");
#ifndef HAVE_OMALLOC
StringAppendS("xalloc,");
#else
StringAppendS("omalloc,");
#endif
#if defined(HAVE_DYN_RL)
if (fe_fgets_stdin==fe_fgets_dummy)
StringAppendS("no input,");
else if (fe_fgets_stdin==fe_fgets)
StringAppendS("fgets,");
if (fe_fgets_stdin==fe_fgets_stdin_drl)
StringAppend("dynamic readline%d),",RL_VERSION_MAJOR);
#ifdef HAVE_FEREAD
else if (fe_fgets_stdin==fe_fgets_stdin_emu)
StringAppendS("emulated readline,");
#endif
else
StringAppendS("unknown fgets method,");
#else
#if defined(HAVE_READLINE) && !defined(FEREAD)
StringAppend("static readline(%d),",RL_VERSION_MAJOR);
#else
#ifdef HAVE_FEREAD
StringAppendS("emulated readline,");
#else
StringAppendS("fgets,");
#endif
#endif
#endif
#ifdef HAVE_PLURAL
StringAppendS("Plural,");
#endif
#ifdef HAVE_VSPACE
#if defined(__GNUC__) && (__GNUC__<9) &&!defined(__clang__)
StringAppendS("vspace(1),");
#else
StringAppendS("vspace(2),");
#endif
#endif
#ifdef HAVE_DBM
StringAppendS("DBM,\n\t");
#else
StringAppendS("\n\t");
#endif
#ifdef HAVE_DYNAMIC_LOADING
StringAppendS("dynamic modules,");
#endif
#ifdef HAVE_DYNANIC_PPROCS
StringAppendS("dynamic p_Procs,");
#endif
#if YYDEBUG
StringAppendS("YYDEBUG=1,");
#endif
#ifdef MDEBUG
StringAppend("MDEBUG=%d,",MDEBUG);
#endif
#ifdef OM_CHECK
StringAppend("OM_CHECK=%d,",OM_CHECK);
#endif
#ifdef OM_TRACK
StringAppend("OM_TRACK=%d,",OM_TRACK);
#endif
#ifdef OM_NDEBUG
StringAppendS("OM_NDEBUG,");
#endif
#ifdef SING_NDEBUG
StringAppendS("SING_NDEBUG,");
#endif
#ifdef PDEBUG
StringAppendS("PDEBUG,");
#endif
#ifdef KDEBUG
StringAppendS("KDEBUG,");
#endif
#ifdef HAVE_SDB
StringAppendS("sdb,");
#endif
StringAppendS("\n\t");
#ifdef __OPTIMIZE__
StringAppendS("CC:OPTIMIZE,");
#endif
#ifdef __OPTIMIZE_SIZE__
StringAppendS("CC:OPTIMIZE_SIZE,");
#endif
#ifdef __NO_INLINE__
StringAppendS("CC:NO_INLINE,");
#endif
#ifdef HAVE_NTL
#ifdef NTL_AVOID_BRANCHING
#undef HAVE_GENERIC_ADD
#endif
#endif
#ifdef HAVE_GENERIC_ADD
StringAppendS("GenericAdd,");
#else
StringAppendS("AvoidBranching,");
#endif
#ifdef HAVE_GENERIC_MULT
StringAppendS("GenericMult,");
#else
StringAppendS("TableMult,");
#endif
#ifdef HAVE_INVTABLE
StringAppendS("invTable,");
#else
StringAppendS("no invTable,");
#endif
StringAppendS("\n\t");
#ifdef HAVE_EIGENVAL
StringAppendS("eigenvalues,");
#endif
#ifdef HAVE_GMS
StringAppendS("Gauss-Manin system,");
#endif
#ifdef HAVE_RATGRING
StringAppendS("ratGB,");
#endif
StringAppend("random=%d\n",siRandomStart);
#define SI_SHOW_BUILTIN_MODULE(name) StringAppend(" %s", #name);
StringAppendS("built-in modules: {");
SI_FOREACH_BUILTIN(SI_SHOW_BUILTIN_MODULE)
StringAppendS("}\n");
#undef SI_SHOW_BUILTIN_MODULE
StringAppend("AC_CONFIGURE_ARGS = %s,\n"
"CC = %s,FLAGS : %s,\n"
"CXX = %s,FLAGS : %s,\n"
"DEFS : %s,CPPFLAGS : %s,\n"
"LDFLAGS : %s,LIBS : %s "
#ifdef __GNUC__
"(ver: " __VERSION__ ")"
#endif
"\n",AC_CONFIGURE_ARGS, CC,CFLAGS " " PTHREAD_CFLAGS,
CXX,CXXFLAGS " " PTHREAD_CFLAGS, DEFS,CPPFLAGS, LDFLAGS,
LIBS " " PTHREAD_LIBS);
feStringAppendResources(0);
feStringAppendBrowsers(0);
StringAppendS("\n");
return StringEndS();
}
VERSION
#define VERSION
Definition factoryconf.h:277
feStringAppendBrowsers
void feStringAppendBrowsers(int warn)
Definition fehelp.cc:341
fe_fgets_dummy
char * fe_fgets_dummy(const char *, char *, int)
Definition feread.cc:455
fe_fgets_stdin
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
Definition feread.cc:32
fe_fgets
char * fe_fgets(const char *pr, char *s, int size)
Definition feread.cc:309
fe_fgets_stdin_drl
char * fe_fgets_stdin_drl(const char *pr, char *s, int size)
Definition feread.cc:269
fe_fgets_stdin_emu
char * fe_fgets_stdin_emu(const char *pr, char *s, int size)
Definition feread.cc:253
SI_SHOW_BUILTIN_MODULE
#define SI_SHOW_BUILTIN_MODULE(name)
singular_date
const char * singular_date
Definition misc_ip.cc:766
SINGULAR_VERSION
#define SINGULAR_VERSION
Definition mod2.h:87
MDEBUG
#define MDEBUG
Definition mod2.h:180
SI_FOREACH_BUILTIN
#define SI_FOREACH_BUILTIN(add)
Data for type_of_LIB to determine built-in modules, use add(name) to add built-in library to macro.
Definition mod_lib.h:17
OM_TRACK
#define OM_TRACK
Definition omalloc_debug.c:10
OM_CHECK
#define OM_CHECK
Definition omalloc_debug.c:11
feStringAppendResources
void feStringAppendResources(int warn)
Definition reporter.cc:402

## Variable Documentation

## add

STATIC_VAR unsigned add[] = {4, 2, 4, 2, 4, 6, 2, 6}

Definition at line 108 of file misc_ip.cc.

{4, 2, 4, 2, 4, 6, 2, 6};

## m2_end_called

volatile BOOLEAN m2_end_called = FALSE

Definition at line 1097 of file misc_ip.cc.

## n_FlintQ

STATIC_VAR n_coeffType n_FlintQ =n_unknown

Definition at line 1214 of file misc_ip.cc.

## n_FlintZn

STATIC_VAR n_coeffType n_FlintZn =n_unknown

Definition at line 1213 of file misc_ip.cc.

## optionStruct

const struct soptionStruct optionStruct[]

Initial value:
=
{
{"prot", Sy_bit(OPT_PROT), ~Sy_bit(OPT_PROT) },
{"redSB", Sy_bit(OPT_REDSB), ~Sy_bit(OPT_REDSB) },
{"notBuckets", Sy_bit(OPT_NOT_BUCKETS), ~Sy_bit(OPT_NOT_BUCKETS) },
{"notSugar", Sy_bit(OPT_NOT_SUGAR), ~Sy_bit(OPT_NOT_SUGAR) },
{"interrupt", Sy_bit(OPT_INTERRUPT), ~Sy_bit(OPT_INTERRUPT) },
{"sugarCrit", Sy_bit(OPT_SUGARCRIT), ~Sy_bit(OPT_SUGARCRIT) },
{"teach", Sy_bit(OPT_DEBUG), ~Sy_bit(OPT_DEBUG) },
{"notSyzMinim", Sy_bit(OPT_NO_SYZ_MINIM), ~Sy_bit(OPT_NO_SYZ_MINIM) },
{"returnSB", Sy_bit(OPT_RETURN_SB), ~Sy_bit(OPT_RETURN_SB) },
{"fastHC", Sy_bit(OPT_FASTHC), ~Sy_bit(OPT_FASTHC) },
{"staircaseBound",Sy_bit(OPT_STAIRCASEBOUND),~Sy_bit(OPT_STAIRCASEBOUND) },
{"multBound", Sy_bit(OPT_MULTBOUND), ~Sy_bit(OPT_MULTBOUND) },
{"degBound", Sy_bit(OPT_DEGBOUND), ~Sy_bit(OPT_DEGBOUND) },
{"redTailSyz", Sy_bit(OPT_REDTAIL_SYZ), ~Sy_bit(OPT_REDTAIL_SYZ) },
{"redTail", Sy_bit(OPT_REDTAIL), ~Sy_bit(OPT_REDTAIL) },
{"redThrough", Sy_bit(OPT_REDTHROUGH), ~Sy_bit(OPT_REDTHROUGH) },
{"lazy", Sy_bit(OPT_OLDSTD), ~Sy_bit(OPT_OLDSTD) },
{"intStrategy", Sy_bit(OPT_INTSTRATEGY), ~Sy_bit(OPT_INTSTRATEGY) },
{"infRedTail", Sy_bit(OPT_INFREDTAIL), ~Sy_bit(OPT_INFREDTAIL) },
{"notRegularity",Sy_bit(OPT_NOTREGULARITY), ~Sy_bit(OPT_NOTREGULARITY) },
{"weightM", Sy_bit(OPT_WEIGHTM), ~Sy_bit(OPT_WEIGHTM) },
{"ne", 0, 0 }
}
OPT_SUGARCRIT
#define OPT_SUGARCRIT
Definition options.h:81
OPT_PROT
#define OPT_PROT
Definition options.h:76
OPT_INFREDTAIL
#define OPT_INFREDTAIL
Definition options.h:95
OPT_WEIGHTM
#define OPT_WEIGHTM
Definition options.h:98
OPT_REDTAIL_SYZ
#define OPT_REDTAIL_SYZ
Definition options.h:88
OPT_REDTAIL
#define OPT_REDTAIL
Definition options.h:92
OPT_RETURN_SB
#define OPT_RETURN_SB
Definition options.h:85
OPT_NOT_SUGAR
#define OPT_NOT_SUGAR
Definition options.h:79
OPT_REDSB
#define OPT_REDSB
Definition options.h:77
OPT_NOTREGULARITY
#define OPT_NOTREGULARITY
Definition options.h:97
OPT_DEBUG
#define OPT_DEBUG
Definition options.h:82
OPT_MULTBOUND
#define OPT_MULTBOUND
Definition options.h:90
OPT_STAIRCASEBOUND
#define OPT_STAIRCASEBOUND
Definition options.h:89
OPT_INTERRUPT
#define OPT_INTERRUPT
Definition options.h:80
OPT_DEGBOUND
#define OPT_DEGBOUND
Definition options.h:91
OPT_NOT_BUCKETS
#define OPT_NOT_BUCKETS
Definition options.h:78
OPT_FASTHC
#define OPT_FASTHC
Definition options.h:86
OPT_NO_SYZ_MINIM
#define OPT_NO_SYZ_MINIM
Definition options.h:84

Definition at line 508 of file misc_ip.cc.

{
{"prot", Sy_bit(OPT_PROT), ~Sy_bit(OPT_PROT) },
{"redSB", Sy_bit(OPT_REDSB), ~Sy_bit(OPT_REDSB) },
{"notBuckets", Sy_bit(OPT_NOT_BUCKETS), ~Sy_bit(OPT_NOT_BUCKETS) },
{"notSugar", Sy_bit(OPT_NOT_SUGAR), ~Sy_bit(OPT_NOT_SUGAR) },
{"interrupt", Sy_bit(OPT_INTERRUPT), ~Sy_bit(OPT_INTERRUPT) },
{"sugarCrit", Sy_bit(OPT_SUGARCRIT), ~Sy_bit(OPT_SUGARCRIT) },
{"teach", Sy_bit(OPT_DEBUG), ~Sy_bit(OPT_DEBUG) },
{"notSyzMinim", Sy_bit(OPT_NO_SYZ_MINIM), ~Sy_bit(OPT_NO_SYZ_MINIM) },
/* 9 return SB in syz, quotient, intersect, modulo */
{"returnSB", Sy_bit(OPT_RETURN_SB), ~Sy_bit(OPT_RETURN_SB) },
{"fastHC", Sy_bit(OPT_FASTHC), ~Sy_bit(OPT_FASTHC) },
/* 11-19 sort in L/T */
{"staircaseBound",Sy_bit(OPT_STAIRCASEBOUND),~Sy_bit(OPT_STAIRCASEBOUND) },
{"multBound", Sy_bit(OPT_MULTBOUND), ~Sy_bit(OPT_MULTBOUND) },
{"degBound", Sy_bit(OPT_DEGBOUND), ~Sy_bit(OPT_DEGBOUND) },
{"redTailSyz", Sy_bit(OPT_REDTAIL_SYZ), ~Sy_bit(OPT_REDTAIL_SYZ) },
/* 25 no redTail(p)/redTail(s) */
{"redTail", Sy_bit(OPT_REDTAIL), ~Sy_bit(OPT_REDTAIL) },
{"redThrough", Sy_bit(OPT_REDTHROUGH), ~Sy_bit(OPT_REDTHROUGH) },
{"lazy", Sy_bit(OPT_OLDSTD), ~Sy_bit(OPT_OLDSTD) },
{"intStrategy", Sy_bit(OPT_INTSTRATEGY), ~Sy_bit(OPT_INTSTRATEGY) },
{"infRedTail", Sy_bit(OPT_INFREDTAIL), ~Sy_bit(OPT_INFREDTAIL) },
/* 30: use not regularity for syz */
{"notRegularity",Sy_bit(OPT_NOTREGULARITY), ~Sy_bit(OPT_NOTREGULARITY) },
{"weightM", Sy_bit(OPT_WEIGHTM), ~Sy_bit(OPT_WEIGHTM) },
/*special for "none" and also end marker for showOption:*/
{"ne", 0, 0 }
};

## singular_date

const char* singular_date = __DATE__ " " __TIME__

Definition at line 766 of file misc_ip.cc.

## verboseStruct

const struct soptionStruct verboseStruct[]

Initial value:
=
{
{"assign_none",Sy_bit(V_ASSIGN_NONE),~Sy_bit(V_ASSIGN_NONE)},
{"mem", Sy_bit(V_SHOW_MEM), ~Sy_bit(V_SHOW_MEM) },
{"yacc", Sy_bit(V_YACC), ~Sy_bit(V_YACC) },
{"redefine", Sy_bit(V_REDEFINE), ~Sy_bit(V_REDEFINE) },
{"reading", Sy_bit(V_READING), ~Sy_bit(V_READING) },
{"loadLib", Sy_bit(V_LOAD_LIB), ~Sy_bit(V_LOAD_LIB) },
{"debugLib", Sy_bit(V_DEBUG_LIB), ~Sy_bit(V_DEBUG_LIB) },
{"loadProc", Sy_bit(V_LOAD_PROC), ~Sy_bit(V_LOAD_PROC) },
{"defRes", Sy_bit(V_DEF_RES), ~Sy_bit(V_DEF_RES) },
{"usage", Sy_bit(V_SHOW_USE), ~Sy_bit(V_SHOW_USE) },
{"Imap", Sy_bit(V_IMAP), ~Sy_bit(V_IMAP) },
{"prompt", Sy_bit(V_PROMPT), ~Sy_bit(V_PROMPT) },
{"length", Sy_bit(V_LENGTH), ~Sy_bit(V_LENGTH) },
{"notWarnSB",Sy_bit(V_NSB), ~Sy_bit(V_NSB) },
{"contentSB",Sy_bit(V_CONTENTSB), ~Sy_bit(V_CONTENTSB) },
{"cancelunit",Sy_bit(V_CANCELUNIT),~Sy_bit(V_CANCELUNIT)},
{"modpsolve",Sy_bit(V_MODPSOLVSB),~Sy_bit(V_MODPSOLVSB)},
{"geometricSB",Sy_bit(V_UPTORADICAL),~Sy_bit(V_UPTORADICAL)},
{"findMonomials",Sy_bit(V_FINDMONOM),~Sy_bit(V_FINDMONOM)},
{"coefStrat",Sy_bit(V_COEFSTRAT), ~Sy_bit(V_COEFSTRAT)},
{"qringNF", Sy_bit(V_QRING), ~Sy_bit(V_QRING)},
{"warn", Sy_bit(V_ALLWARN), ~Sy_bit(V_ALLWARN)},
{"intersectSyz",Sy_bit(V_INTERSECT_SYZ), ~Sy_bit(V_INTERSECT_SYZ)},
{"intersectElim",Sy_bit(V_INTERSECT_ELIM), ~Sy_bit(V_INTERSECT_ELIM)},
{"pure_gb",Sy_bit(V_PURE_GB), ~Sy_bit(V_PURE_GB)},
{"ne", 0, 0 }
}
V_QRING
#define V_QRING
Definition options.h:42
V_DEF_RES
#define V_DEF_RES
Definition options.h:50
V_INTERSECT_SYZ
#define V_INTERSECT_SYZ
Definition options.h:69
V_ALLWARN
#define V_ALLWARN
Definition options.h:67
V_READING
#define V_READING
Definition options.h:46
V_COEFSTRAT
#define V_COEFSTRAT
Definition options.h:61
V_ASSIGN_NONE
#define V_ASSIGN_NONE
Definition options.h:70
V_CONTENTSB
#define V_CONTENTSB
Definition options.h:56
V_DEBUG_LIB
#define V_DEBUG_LIB
Definition options.h:48
V_MODPSOLVSB
#define V_MODPSOLVSB
Definition options.h:58
V_LOAD_PROC
#define V_LOAD_PROC
Definition options.h:49
V_UPTORADICAL
#define V_UPTORADICAL
Definition options.h:59
V_FINDMONOM
#define V_FINDMONOM
Definition options.h:60
V_CANCELUNIT
#define V_CANCELUNIT
Definition options.h:57
V_REDEFINE
#define V_REDEFINE
Definition options.h:45
V_INTERSECT_ELIM
#define V_INTERSECT_ELIM
Definition options.h:68
V_PURE_GB
#define V_PURE_GB
Definition options.h:71
V_NSB
#define V_NSB
Definition options.h:55
V_LENGTH
#define V_LENGTH
Definition options.h:64
V_IMAP
#define V_IMAP
Definition options.h:53
V_PROMPT
#define V_PROMPT
Definition options.h:54
V_SHOW_USE
#define V_SHOW_USE
Definition options.h:52

Definition at line 539 of file misc_ip.cc.

{
{"assign_none",Sy_bit(V_ASSIGN_NONE),~Sy_bit(V_ASSIGN_NONE)},
{"mem", Sy_bit(V_SHOW_MEM), ~Sy_bit(V_SHOW_MEM) },
{"yacc", Sy_bit(V_YACC), ~Sy_bit(V_YACC) },
{"redefine", Sy_bit(V_REDEFINE), ~Sy_bit(V_REDEFINE) },
{"reading", Sy_bit(V_READING), ~Sy_bit(V_READING) },
{"loadLib", Sy_bit(V_LOAD_LIB), ~Sy_bit(V_LOAD_LIB) },
{"debugLib", Sy_bit(V_DEBUG_LIB), ~Sy_bit(V_DEBUG_LIB) },
{"loadProc", Sy_bit(V_LOAD_PROC), ~Sy_bit(V_LOAD_PROC) },
{"defRes", Sy_bit(V_DEF_RES), ~Sy_bit(V_DEF_RES) },
{"usage", Sy_bit(V_SHOW_USE), ~Sy_bit(V_SHOW_USE) },
{"Imap", Sy_bit(V_IMAP), ~Sy_bit(V_IMAP) },
{"prompt", Sy_bit(V_PROMPT), ~Sy_bit(V_PROMPT) },
{"length", Sy_bit(V_LENGTH), ~Sy_bit(V_LENGTH) },
{"notWarnSB",Sy_bit(V_NSB), ~Sy_bit(V_NSB) },
{"contentSB",Sy_bit(V_CONTENTSB), ~Sy_bit(V_CONTENTSB) },
{"cancelunit",Sy_bit(V_CANCELUNIT),~Sy_bit(V_CANCELUNIT)},
{"modpsolve",Sy_bit(V_MODPSOLVSB),~Sy_bit(V_MODPSOLVSB)},
{"geometricSB",Sy_bit(V_UPTORADICAL),~Sy_bit(V_UPTORADICAL)},
{"findMonomials",Sy_bit(V_FINDMONOM),~Sy_bit(V_FINDMONOM)},
{"coefStrat",Sy_bit(V_COEFSTRAT), ~Sy_bit(V_COEFSTRAT)},
{"qringNF", Sy_bit(V_QRING), ~Sy_bit(V_QRING)},
{"warn", Sy_bit(V_ALLWARN), ~Sy_bit(V_ALLWARN)},
{"intersectSyz",Sy_bit(V_INTERSECT_SYZ), ~Sy_bit(V_INTERSECT_SYZ)},
{"intersectElim",Sy_bit(V_INTERSECT_ELIM), ~Sy_bit(V_INTERSECT_ELIM)},
{"pure_gb",Sy_bit(V_PURE_GB), ~Sy_bit(V_PURE_GB)},
/*special for "none" and also end marker for showOption:*/
{"ne", 0, 0 }
};