Loading...
Searching...
No Matches
kstd1.h File Reference
`#include "kernel/structs.h"`
`#include "polys/monomials/ring.h"`
`#include "coeffs/bigintmat.h"`

Go to the source code of this file.

## Macros

#define | KSTD_NF_LAZY 1
#define | KSTD_NF_ECART 2
#define | KSTD_NF_NONORM 4
#define | KSTD_NF_CANCELUNIT 8
#define | KSTD_NF_NOLF 4096

## Typedefs

typedef BOOLEAN(* | s_poly_proc_t) (kStrategy strat)

## Functions

ideal | mora (ideal F, ideal Q, intvec *w, bigintmat *hilb, kStrategy strat)
poly | kNF1 (ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
ideal | kNF1 (ideal F, ideal Q, ideal q, kStrategy strat, int lazyReduce)
poly | kNF (ideal F, ideal Q, poly p, int syzComp=0, int lazyReduce=0)
ideal | kNF (ideal F, ideal Q, ideal p, int syzComp=0, int lazyReduce=0)
poly | kNFBound (ideal F, ideal Q, poly p, int bound, int syzComp=0, int lazyReduce=0)
ideal | kNFBound (ideal F, ideal Q, ideal p, int bound, int syzComp=0, int lazyReduce=0)
ideal | idDivRem (ideal A, const ideal quot, ideal &factor, ideal *unit, int lazyReduce=0)
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.
ideal | kSba (ideal F, ideal Q, tHomog h, intvec **mw, int incremental=0, int arri=0, bigintmat *hilb=NULL, int syzComp=0, int newIdeal=0, intvec *vw=NULL)
ideal | kStd (ideal F, ideal Q, tHomog h, intvec **mw, intvec *hilb=NULL, int syzComp=0, int newIdeal=0, intvec *vw=NULL, s_poly_proc_t sp=NULL)
| generic interface to GB/SB computations
ideal | kStd2 (ideal F, ideal Q, tHomog h, intvec **mw, bigintmat *hilb=NULL, int syzComp=0, int newIdeal=0, intvec *vw=NULL, s_poly_proc_t sp=NULL)
| generic interface to GB/SB computations, large hilbert vectors
ideal | kStd_internal (ideal F, ideal Q, tHomog h, intvec **w, bigintmat *hilb=NULL, int syzComp=0, int newIdeal=0, intvec *vw=NULL, s_poly_proc_t sp=NULL)
| pure GB/SB computations
ideal | kStdShift (ideal F, ideal Q, tHomog h, intvec **mw, bigintmat *hilb=NULL, int syzComp=0, int newIdeal=0, intvec *vw=NULL, BOOLEAN rightGB=FALSE)
ideal | kTryHilbstd (ideal F, ideal Q)
ideal | kTryHilbstd_par (ideal F, ideal Q, tHomog h, intvec **mw)
poly | kTryHC (ideal F, ideal Q)
ideal | rightgb (ideal F, const ideal Q)
void | initMora (ideal F, kStrategy strat)
ideal | kInterRed (ideal F, const ideal Q=NULL)
ideal | kInterRedOld (ideal F, const ideal Q=NULL)
ideal | kInterRedBba (ideal F, ideal Q, int &need_retry)
long | kModDeg (poly p, const ring r=currRing)
long | kHomModDeg (poly p, const ring r=currRing)
ideal | stdred (ideal F, ideal Q, tHomog h, intvec **w)
ideal | kMin_std2 (ideal F, ideal Q, tHomog h, intvec **w, ideal &M, bigintmat *hilb, int syzComp=0, int reduced=0)
ideal | kMin_std (ideal F, ideal Q, tHomog h, intvec **w, ideal &M, intvec *hilb, int syzComp=0, int reduced=0)
BOOLEAN | kVerify (ideal F, ideal Q)

## Variables

EXTERN_VAR int | Kstd1_mu
EXTERN_VAR int | Kstd1_deg
EXTERN_VAR BITSET | kOptions
EXTERN_VAR BITSET | validOpts
EXTERN_VAR intvec * | kModW
EXTERN_VAR intvec * | kHomW

## Macro Definition Documentation

## KSTD_NF_CANCELUNIT

#define KSTD_NF_CANCELUNIT 8

Definition at line 24 of file kstd1.h.

## KSTD_NF_ECART

#define KSTD_NF_ECART 2

Definition at line 20 of file kstd1.h.

## KSTD_NF_LAZY

#define KSTD_NF_LAZY 1

Definition at line 18 of file kstd1.h.

## KSTD_NF_NOLF

#define KSTD_NF_NOLF 4096

Definition at line 26 of file kstd1.h.

## KSTD_NF_NONORM

#define KSTD_NF_NONORM 4

Definition at line 22 of file kstd1.h.

## Typedef Documentation

## s_poly_proc_t

typedef BOOLEAN(* s_poly_proc_t) (kStrategy strat)

Definition at line 15 of file kstd1.h.

## Function Documentation

## idDivRem()

ideal idDivRem | ( | ideal | A,
|  | const ideal | quot,
|  | ideal & | factor,
|  | ideal * | unit,
|  | int | lazyReduce = 0 )

Definition at line 347 of file kLiftstd.cc.

{
/* special cases */
if (idIs0(A) || idIs0(quot))
{
factor=idInit(1,IDELEMS(quot));
setUnit(A->rank,unit);
return idCopy(A);
}
/* ideal or module? */
ring orig_ring=currRing;
int k=id_RankFreeModule(quot,orig_ring);
int lsmod=0;
if (k==0) { lsmod=1;k=1;} /*ideal*/
/* NF(A 0 E,quot E 0)
* A,quot: 1..k, 0,E: k+1..k+IDELEMS(quot),
* E,0: k+IDELEMS(quot)..k+IDELEMS(quot)+IDELEMS(A) */
/* new ring */
ring syz_ring=rAssure_SyzOrder(orig_ring,TRUE);
rSetSyzComp(1,syz_ring);
rChangeCurrRing(syz_ring);
/* move ideals to new ring */
ideal s_quot;
ideal s_A;
if (orig_ring != syz_ring)
{
s_quot=idrCopyR_NoSort(quot,orig_ring,syz_ring);
s_A=idrCopyR_NoSort(A,orig_ring,syz_ring);
}
else
{
s_quot=id_Copy(quot,syz_ring);
s_A=id_Copy(A,syz_ring);
}
/* quot[i] -> quot[i]+e(k+i+1) */
for(int i=0;i<IDELEMS(s_quot);i++)
{
p_Shift(&s_quot->m[i],lsmod,syz_ring);
poly p=p_One(syz_ring);
p_SetComp(p,k+i+2,syz_ring);
p_Setm(p,syz_ring);
s_quot->m[i]=p_Add_q(s_quot->m[i],p,syz_ring);
}
s_quot->rank=k+IDELEMS(quot)+1;
/* A[i] -> A[i]*e(1) */
if (lsmod==1)
{
for(int i=0;i<IDELEMS(s_A);i++)
{
p_Shift(&s_A->m[i],1,syz_ring);
}
}
if (unit!=NULL)
{
int u_k=k+IDELEMS(quot)+2;
for(int i=0;i<IDELEMS(s_A);i++)
{
poly p=p_One(syz_ring);
p_SetComp(p,u_k+i,syz_ring);
p_Setm(p,syz_ring);
s_A->m[i]=p_Add_q(s_A->m[i],p,syz_ring);
}
s_A->rank=k+IDELEMS(quot)+IDELEMS(A)+1;
}
/* normalform */
#if 0
PrintS("to reduce:\n");
{
void ipPrint_MA0(matrix m, const char *name);
matrix m = id_Module2Matrix(id_Copy(s_A,currRing),currRing);
ipPrint_MA0(m, "A");
id_Delete((ideal *) &m,currRing);
}
PrintS("with:\n");
{
void ipPrint_MA0(matrix m, const char *name);
matrix m = id_Module2Matrix(id_Copy(s_quot,currRing),currRing);
ipPrint_MA0(m, "B");
id_Delete((ideal *) &m,currRing);
}
#endif
ideal rest=kNF(s_quot,syz_ring->qideal,s_A,0,lazyReduce);
#if 0
PrintS("result NF:\n");
{
void ipPrint_MA0(matrix m, const char *name);
matrix m = id_Module2Matrix(id_Copy(rest,currRing),currRing);
ipPrint_MA0(m, "A");
id_Delete((ideal *) &m,currRing);
}
#endif
/* clean s_quot,s_A */
id_Delete(&s_quot,syz_ring);
id_Delete(&s_A,syz_ring);
/* interpret rest: remainder */
ideal result=idInit(IDELEMS(rest),A->rank);
for(int i=0;i<IDELEMS(rest);i++)
{
poly p=rest->m[i];
poly d=NULL;
while(p!=NULL)
{
poly q=p; pIter(p);
pNext(q)=NULL;
if (p_GetComp(q,syz_ring)<=k)
{
result->m[i]=p_Add_q(result->m[i],q,syz_ring);
}
else
{
d=p_Add_q(d,q,syz_ring);
}
}
rest->m[i]=d;
p_Shift(&result->m[i],-lsmod,syz_ring);
}
#if 0
PrintS("rest:\n");
{
void ipPrint_MA0(matrix m, const char *name);
matrix m = id_Module2Matrix(id_Copy(result,currRing),currRing);
ipPrint_MA0(m, "_");
id_Delete((ideal *) &m,currRing);
}
#endif
#if 0
PrintS("factor+unit:\n");
{
void ipPrint_MA0(matrix m, const char *name);
matrix m = id_Module2Matrix(id_Copy(rest,currRing),currRing);
ipPrint_MA0(m, "_");
id_Delete((ideal *) &m,currRing);
}
#endif
/* interpret rest: factors */
factor=idInit(IDELEMS(rest),IDELEMS(quot));
if (unit==NULL)
{
for(int i=0;i<IDELEMS(rest);i++)
{
poly p=rest->m[i];
p_Shift(&p,-k-lsmod,syz_ring);
factor->m[i]=p;
factor->m[i]=p_Neg(factor->m[i],syz_ring);
rest->m[i]=NULL;
}
}
else
{
*unit=idInit(IDELEMS(A),IDELEMS(A));
/* comp k+1..u_k-1 -> rest, u_k.. -> unit*/
int u_k=k+IDELEMS(quot)+2;
for(int i=0;i<IDELEMS(rest);i++)
{
poly p=rest->m[i];
rest->m[i]=NULL;
poly d=NULL;
while(p!=NULL)
{
poly q=p; pIter(p);
pNext(q)=NULL;
if(p_GetComp(q,syz_ring)<u_k)
{
p_Shift(&q,-k-1,syz_ring);
factor->m[i]=p_Add_q(factor->m[i],q,syz_ring);
}
else
{
d=p_Add_q(d,q,syz_ring);
}
}
(*unit)->m[i]=d;
/*fix sign:*/
factor->m[i]=p_Neg(factor->m[i],syz_ring);
p_Shift(&(*unit)->m[i],-(IDELEMS(quot)+k+1),syz_ring);
}
}
id_Delete(&rest,syz_ring);
if (orig_ring != syz_ring)
{
rChangeCurrRing(orig_ring);
result=idrMoveR_NoSort(result, syz_ring, orig_ring);
factor=idrMoveR(factor, syz_ring, orig_ring);
if (unit!=NULL)
{
*unit=idrMoveR(*unit, syz_ring, orig_ring);
}
rDelete(syz_ring);
}
return result;
}
TRUE
#define TRUE
Definition auxiliary.h:101
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
k
int k
Definition cfEzgcd.cc:99
p
int p
Definition cfModGcd.cc:4086
result
return result
Definition facAbsBiFact.cc:76
factor
CanonicalForm factor
Definition facAbsFact.cc:97
name
char name(const Variable &v)
Definition factory.h:189
ipPrint_MA0
void ipPrint_MA0(matrix m, const char *name)
Definition ipprint.cc:57
id_Copy
ideal id_Copy(ideal h1, const ring r)
copy an ideal
Definition simpleideals.cc:542
idIs0
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
Definition simpleideals.cc:960
idCopy
ideal idCopy(ideal A)
Definition ideals.h:60
setUnit
static void setUnit(int e, ideal *unit)
Definition kLiftstd.cc:334
kNF
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition kstd1.cc:3229
matrix
ip_smatrix * matrix
Definition matpol.h:43
p_GetComp
#define p_GetComp(p, r)
Definition monomials.h:64
pIter
#define pIter(p)
Definition monomials.h:37
pNext
#define pNext(p)
Definition monomials.h:36
NULL
#define NULL
Definition omList.c:12
p_Shift
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
Definition p_polys.cc:4860
p_One
poly p_One(const ring r)
Definition p_polys.cc:1314
p_Neg
static poly p_Neg(poly p, const ring r)
Definition p_polys.h:1114
p_Add_q
static poly p_Add_q(poly p, poly q, const ring r)
Definition p_polys.h:938
p_SetComp
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition p_polys.h:249
p_Setm
static void p_Setm(poly p, const ring r)
Definition p_polys.h:235
rChangeCurrRing
void rChangeCurrRing(ring r)
Definition polys.cc:16
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
idrMoveR
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
Definition prCopy.cc:248
idrMoveR_NoSort
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
Definition prCopy.cc:261
idrCopyR_NoSort
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition prCopy.cc:205
PrintS
void PrintS(const char *s)
Definition reporter.cc:288
rAssure_SyzOrder
ring rAssure_SyzOrder(const ring r, BOOLEAN complete)
Definition ring.cc:4522
rDelete
void rDelete(ring r)
unconditionally deletes fields in r
Definition ring.cc:454
rSetSyzComp
void rSetSyzComp(int k, const ring r)
Definition ring.cc:5230
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition simpleideals.cc:123
id_Module2Matrix
matrix id_Module2Matrix(ideal mod, const ring R)
Definition simpleideals.cc:1594
id_RankFreeModule
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
Definition simpleideals.cc:992
IDELEMS
#define IDELEMS(i)
Definition simpleideals.h:23
A
#define A
Definition sirandom.c:24

## initMora()

void initMora | ( | ideal | F,
|  | kStrategy | strat )

Definition at line 1820 of file kstd1.cc.

{
int i,j;
strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN));
for (j=(currRing->N); j>0; j--) strat->NotUsedAxis[j] = TRUE;
strat->enterS = enterSMora;
strat->initEcartPair = initEcartPairMora; /*- ecart approximation -*/
strat->posInLOld = strat->posInL;
strat->posInLOldFlag = TRUE;
strat->initEcart = initEcartNormal;
if (strat->homog)
strat->red = redFirst; /*take the first possible in T*/
else
strat->red = redEcart;/*take the first possible in under ecart-restriction*/
if ( currRing->ppNoether!=NULL )
{
strat->kNoether = pCopy((currRing->ppNoether));
if (TEST_OPT_PROT)
{
Print("H(%ld)",p_FDeg(strat->kNoether,currRing)+1);
mflush();
}
}
if (strat->kNoether!=NULL)
{
HCord = currRing->pFDeg((strat->kNoether),currRing)+1;
}
else
{
HCord = INT_MAX-3;/*- very large -*/
}
if (rField_is_Ring(currRing))
{
if (rField_is_Z(currRing))
strat->red = redRiloc_Z;
else
strat->red = redRiloc;
}
/*reads the ecartWeights used for Graebes method from the
*intvec ecart and set ecartWeights
*/
if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
{
//interred machen Aenderung
strat->pOrigFDeg=currRing->pFDeg;
strat->pOrigLDeg=currRing->pLDeg;
ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
/*uses automatic computation of the ecartWeights to set them*/
kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights,currRing);
pSetDegProcs(currRing,totaldegreeWecart, maxdegreeWecart);
if (TEST_OPT_PROT)
{
for(i=1; i<=(currRing->N); i++)
Print(" %d",ecartWeights[i]);
PrintLn();
mflush();
}
}
kOptimizeLDeg(currRing->pLDeg, strat);
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
skStrategy::posInLOldFlag
char posInLOldFlag
Definition kutil.h:379
skStrategy::kNoether
poly kNoether
Definition kutil.h:328
skStrategy::NotUsedAxis
BOOLEAN * NotUsedAxis
Definition kutil.h:331
skStrategy::posInL
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.h:283
skStrategy::pOrigFDeg
pFDegProc pOrigFDeg
Definition kutil.h:295
skStrategy::posInLOld
int(* posInLOld)(const LSet Ls, const int Ll, LObject *Lo, const kStrategy strat)
Definition kutil.h:287
skStrategy::initEcartPair
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
Definition kutil.h:286
skStrategy::enterS
void(* enterS)(LObject *h, int pos, kStrategy strat, int atR)
Definition kutil.h:285
skStrategy::initEcart
void(* initEcart)(TObject *L)
Definition kutil.h:281
skStrategy::red
int(* red)(LObject *L, kStrategy strat)
Definition kutil.h:279
skStrategy::homog
char homog
Definition kutil.h:369
skStrategy::pOrigLDeg
pLDegProc pOrigLDeg
Definition kutil.h:296
Print
#define Print
Definition emacs.cc:80
j
int j
Definition facHensel.cc:110
redFirst
int redFirst(LObject *h, kStrategy strat)
Definition kstd1.cc:794
redEcart
int redEcart(LObject *h, kStrategy strat)
Definition kstd1.cc:168
enterSMora
void enterSMora(LObject *p, int atS, kStrategy strat, int atR)
Definition kstd1.cc:1629
kOptimizeLDeg
static void kOptimizeLDeg(pLDegProc ldeg, kStrategy strat)
Definition kstd1.cc:100
redRiloc
int redRiloc(LObject *h, kStrategy strat)
Definition kstd1.cc:385
redRiloc_Z
int redRiloc_Z(LObject *h, kStrategy strat)
Definition kstd1.cc:566
HCord
VAR int HCord
Definition kutil.cc:239
initEcartPairMora
void initEcartPairMora(LObject *Lp, poly, poly, int ecartF, int ecartG)
Definition kutil.cc:1315
initEcartNormal
void initEcartNormal(TObject *h)
Definition kutil.cc:1293
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210
TEST_OPT_WEIGHTM
#define TEST_OPT_WEIGHTM
Definition options.h:123
TEST_OPT_PROT
#define TEST_OPT_PROT
Definition options.h:105
pSetDegProcs
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition p_polys.cc:3762
p_FDeg
static long p_FDeg(const poly p, const ring r)
Definition p_polys.h:382
pCopy
#define pCopy(p)
return a copy of the poly
Definition polys.h:186
PrintLn
void PrintLn()
Definition reporter.cc:314
mflush
#define mflush()
Definition reporter.h:58
rField_is_Z
static BOOLEAN rField_is_Z(const ring r)
Definition ring.h:515
rField_is_Ring
#define rField_is_Ring(R)
Definition ring.h:491
totaldegreeWecart
long totaldegreeWecart(poly p, ring r)
Definition weight.cc:217
maxdegreeWecart
long maxdegreeWecart(poly p, int *l, ring r)
Definition weight.cc:247
kEcartWeights
void kEcartWeights(poly *s, int sl, short *eweight, const ring R)
Definition weight.cc:182
ecartWeights
EXTERN_VAR short * ecartWeights
Definition weight.h:12

## 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 at line 3443 of file kstd1.cc.

{
const ring save = currRing;
if( currRing != _currRing ) rChangeCurrRing(_currRing);
poly ret = kNF(F, Q, p, syzComp, lazyReduce);
if( currRing != save ) rChangeCurrRing(save);
return ret;
}
Q
#define Q
Definition sirandom.c:26

## kHomModDeg()

long kHomModDeg | ( | poly | p,
|  | const ring | r = currRing )

Definition at line 2421 of file kstd1.cc.

{
int i;
long j=0;
for (i=r->N;i>0;i--)
j+=p_GetExp(p,i,r)*(*kHomW)[i-1];
if (kModW == NULL) return j;
i = __p_GetComp(p,r);
if (i==0) return j;
return j+(*kModW)[i-1];
}
kModW
VAR intvec * kModW
Definition kstd1.cc:2409
__p_GetComp
#define __p_GetComp(p, r)
Definition monomials.h:63
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition p_polys.h:471

## kInterRed()

ideal kInterRed | ( | ideal | F,
|  | const ideal | Q = NULL )

Definition at line 3802 of file kstd1.cc.

{
#ifdef HAVE_PLURAL
if(rIsPluralRing(currRing)) return kInterRedOld(F,Q);
#endif
if ((rHasLocalOrMixedOrdering(currRing))|| (rField_is_numeric(currRing))
||(rField_is_Ring(currRing))
)
return kInterRedOld(F,Q);
//return kInterRedOld(F,Q);
BITSET save1;
SI_SAVE_OPT1(save1);
//si_opt_1|=Sy_bit(OPT_NOT_SUGAR);
si_opt_1|=Sy_bit(OPT_REDTHROUGH);
//si_opt_1&= ~Sy_bit(OPT_REDTAIL);
//si_opt_1&= ~Sy_bit(OPT_REDSB);
//extern char * showOption() ;
//Print("%s\n",showOption());
int need_retry;
int counter=3;
ideal res, res1;
int elems=0;
ideal null=NULL;
if ((Q==NULL) || (!TEST_OPT_REDSB))
{
elems=idElem(F);
res=kInterRedBba(F,Q,need_retry);
}
else
{
ideal FF=idSimpleAdd(F,Q);
res=kInterRedBba(FF,NULL,need_retry);
idDelete(&FF);
null=idInit(1,1);
if (need_retry)
res1=kNF(null,Q,res,0,KSTD_NF_LAZY | KSTD_NF_NONORM);
else
res1=kNF(null,Q,res);
idDelete(&res);
res=res1;
need_retry=1;
}
if (idElem(res)<=1) need_retry=0;
while (need_retry && (counter>0))
{
#ifdef KDEBUG
if (TEST_OPT_DEBUG) { Print("retry counter %d\n",counter); }
#endif
res1=kInterRedBba(res,Q,need_retry);
int new_elems=idElem(res1);
counter -= (new_elems >= elems);
elems = new_elems;
idDelete(&res);
if (idElem(res1)<=1) need_retry=0;
if ((Q!=NULL) && (TEST_OPT_REDSB))
{
if (need_retry)
res=kNF(null,Q,res1,0,KSTD_NF_LAZY | KSTD_NF_NONORM);
else
res=kNF(null,Q,res1);
idDelete(&res1);
}
else
res = res1;
if (idElem(res)<=1) need_retry=0;
}
if (null!=NULL) idDelete(&null);
SI_RESTORE_OPT1(save1);
idSkipZeroes(res);
return res;
}
BITSET
#define BITSET
Definition auxiliary.h:85
res
CanonicalForm res
Definition facAbsFact.cc:60
idDelete
#define idDelete(H)
delete an ideal
Definition ideals.h:29
idSimpleAdd
#define idSimpleAdd(A, B)
Definition ideals.h:42
kInterRedBba
ideal kInterRedBba(ideal F, ideal Q, int &need_retry)
Definition kstd1.cc:3551
kInterRedOld
ideal kInterRedOld(ideal F, const ideal Q)
Definition kstd1.cc:3456
KSTD_NF_LAZY
#define KSTD_NF_LAZY
Definition kstd1.h:18
KSTD_NF_NONORM
#define KSTD_NF_NONORM
Definition kstd1.h:22
si_opt_1
VAR unsigned si_opt_1
Definition options.c:5
SI_SAVE_OPT1
#define SI_SAVE_OPT1(A)
Definition options.h:21
SI_RESTORE_OPT1
#define SI_RESTORE_OPT1(A)
Definition options.h:24
OPT_REDTHROUGH
#define OPT_REDTHROUGH
Definition options.h:83
Sy_bit
#define Sy_bit(x)
Definition options.h:31
TEST_OPT_REDSB
#define TEST_OPT_REDSB
Definition options.h:106
TEST_OPT_DEBUG
#define TEST_OPT_DEBUG
Definition options.h:110
rHasLocalOrMixedOrdering
static BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition ring.h:769
rIsPluralRing
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition ring.h:406
rField_is_numeric
static BOOLEAN rField_is_numeric(const ring r)
Definition ring.h:521
idSkipZeroes
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
Definition simpleideals.cc:201
idElem
static int idElem(const ideal F)
number of non-zero polys in F
Definition simpleideals.h:69

## kInterRedBba()

ideal kInterRedBba | ( | ideal | F,
|  | ideal | Q,
|  | int & | need_retry )

Definition at line 3551 of file kstd1.cc.

{
need_retry=0;
int red_result = 1;
int olddeg,reduc;
// BOOLEAN withT = FALSE;
// BOOLEAN toReset=FALSE;
kStrategy strat=new skStrategy;
tHomog h;
if (rField_has_simple_inverse(currRing))
strat->LazyPass=20;
else
strat->LazyPass=2;
strat->LazyDegree = 1;
strat->ak = id_RankFreeModule(F,currRing);
strat->syzComp = strat->ak;
strat->kModW=kModW=NULL;
strat->kHomW=kHomW=NULL;
if (strat->ak == 0)
{
h = (tHomog)idHomIdeal(F,Q);
}
else if (!TEST_OPT_DEGBOUND)
{
h = (tHomog)idHomIdeal(F,Q);
}
else
h = isNotHomog;
if (h==isHomog)
{
strat->LazyPass*=2;
}
strat->homog=h;
#ifdef KDEBUG
idTest(F);
#endif
initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit*/
if(rField_is_Ring(currRing))
initBuchMoraPosRing(strat);
else
initBuchMoraPos(strat);
initBba(strat);
/*set enterS, spSpolyShort, reduce, red, initEcart, initEcartPair*/
strat->posInL=posInL0; /* ord according pComp */
/*Shdl=*/initBuchMora(F, Q, strat);
reduc = olddeg = 0;
#ifndef NO_BUCKETS
if (!TEST_OPT_NOT_BUCKETS)
strat->use_buckets = 1;
#endif
// redtailBBa against T for inhomogeneous input
//if (!TEST_OPT_OLDSTD)
// withT = ! strat->homog;
// strat->posInT = posInT_pLength;
kTest_TS(strat);
#ifdef HAVE_TAIL_RING
kStratInitChangeTailRing(strat);
#endif
/* compute------------------------------------------------------- */
while (strat->Ll >= 0)
{
#ifdef KDEBUG
if (TEST_OPT_DEBUG) messageSets(strat);
#endif
if (strat->Ll== 0) strat->interpt=TRUE;
/* picks the last element from the lazyset L */
strat->P = strat->L[strat->Ll];
strat->Ll--;
if (strat->P.p1 == NULL)
{
// for input polys, prepare reduction
strat->P.PrepareRed(strat->use_buckets);
}
if (strat->P.p == NULL && strat->P.t_p == NULL)
{
red_result = 0;
}
else
{
if (TEST_OPT_PROT)
message(strat->P.pFDeg(),
&olddeg,&reduc,strat, red_result);
/* reduction of the element chosen from L */
red_result = strat->red(&strat->P,strat);
}
// reduction to non-zero new poly
if (red_result == 1)
{
/* statistic */
if (TEST_OPT_PROT) PrintS("s");
// get the polynomial (canonicalize bucket, make sure P.p is set)
strat->P.GetP(strat->lmBin);
int pos=posInS(strat,strat->sl,strat->P.p,strat->P.ecart);
// reduce the tail and normalize poly
// in the ring case we cannot expect LC(f) = 1,
// therefore we call pCleardenom instead of pNorm
if (TEST_OPT_INTSTRATEGY)
{
strat->P.pCleardenom();
}
else
{
strat->P.pNorm();
}
#ifdef KDEBUG
if (TEST_OPT_DEBUG){PrintS("new s:");strat->P.wrp();PrintLn();}
#endif
// enter into S, L, and T
if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp))
{
enterT(&strat->P, strat);
// posInS only depends on the leading term
strat->enterS(&strat->P, pos, strat, strat->tl);
if (pos<strat->sl)
{
need_retry++;
// move all "larger" elements fromS to L
// remove them from T
int ii=pos+1;
for(;ii<=strat->sl;ii++)
{
LObject h;
h.Clear();
h.tailRing=strat->tailRing;
h.p=strat->S[ii]; strat->S[ii]=NULL;
strat->initEcart(&h);
h.sev=strat->sevS[ii];
int jj=strat->tl;
while (jj>=0)
{
if (strat->T[jj].p==h.p)
{
strat->T[jj].p=NULL;
if (jj<strat->tl)
{
memmove(&(strat->T[jj]),&(strat->T[jj+1]),
(strat->tl-jj)*sizeof(strat->T[jj]));
memmove(&(strat->sevT[jj]),&(strat->sevT[jj+1]),
(strat->tl-jj)*sizeof(strat->sevT[jj]));
}
strat->tl--;
break;
}
jj--;
}
int lpos=strat->posInL(strat->L,strat->Ll,&h,strat);
enterL(&strat->L,&strat->Ll,&strat->Lmax,h,lpos);
#ifdef KDEBUG
if (TEST_OPT_DEBUG)
{
Print("move S[%d] -> L[%d]: ",ii,pos);
p_wrp(h.p,currRing, strat->tailRing);
PrintLn();
}
#endif
}
if (strat->fromQ!=NULL)
{
for(ii=pos+1;ii<=strat->sl;ii++) strat->fromQ[ii]=0;
}
strat->sl=pos;
}
}
else
{
// clean P
}
kDeleteLcm(&strat->P);
}
#ifdef KDEBUG
if (TEST_OPT_DEBUG)
{
messageSets(strat);
}
strat->P.Clear();
#endif
//kTest_TS(strat);: i_r out of sync in kInterRedBba, but not used!
}
#ifdef KDEBUG
//if (TEST_OPT_DEBUG) messageSets(strat);
#endif
/* complete reduction of the standard basis--------- */
if((need_retry<=0) && (TEST_OPT_REDSB))
{
completeReduce(strat);
if (strat->completeReduce_retry)
{
// completeReduce needed larger exponents, retry
// hopefully: kStratChangeTailRing already provided a larger tailRing
// (otherwise: it will fail again)
strat->completeReduce_retry=FALSE;
completeReduce(strat);
if (strat->completeReduce_retry)
{
#ifdef HAVE_TAIL_RING
if(currRing->bitmask>strat->tailRing->bitmask)
{
// retry without T
strat->completeReduce_retry=FALSE;
cleanT(strat);strat->tailRing=currRing;
int i;
for(i=strat->sl;i>=0;i--) strat->S_2_R[i]=-1;
completeReduce(strat);
}
if (strat->completeReduce_retry)
#endif
Werror("exponent bound is %ld",currRing->bitmask);
}
}
}
else if (TEST_OPT_PROT) PrintLn();
/* release temp data-------------------------------- */
exitBuchMora(strat);
// if (TEST_OPT_WEIGHTM)
// {
// pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
// if (ecartWeights)
// {
// omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
// ecartWeights=NULL;
// }
// }
//if (TEST_OPT_PROT) messageStat(0/*hilbcount*/,strat);
if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
ideal res=strat->Shdl;
strat->Shdl=NULL;
delete strat;
return res;
}
FALSE
#define FALSE
Definition auxiliary.h:97
skStrategy
Definition kutil.h:276
skStrategy::kModW
intvec * kModW
Definition kutil.h:334
skStrategy::syzComp
int syzComp
Definition kutil.h:353
skStrategy::S_2_R
int * S_2_R
Definition kutil.h:341
skStrategy::tailRing
ring tailRing
Definition kutil.h:342
skStrategy::Ll
int Ll
Definition kutil.h:350
skStrategy::T
TSet T
Definition kutil.h:325
skStrategy::lmBin
omBin lmBin
Definition kutil.h:343
skStrategy::S
polyset S
Definition kutil.h:305
skStrategy::ak
int ak
Definition kutil.h:352
skStrategy::tl
int tl
Definition kutil.h:349
skStrategy::sevT
unsigned long * sevT
Definition kutil.h:324
skStrategy::kHomW
intvec * kHomW
Definition kutil.h:335
skStrategy::Shdl
ideal Shdl
Definition kutil.h:302
skStrategy::fromQ
intset fromQ
Definition kutil.h:320
skStrategy::use_buckets
char use_buckets
Definition kutil.h:380
skStrategy::interpt
char interpt
Definition kutil.h:368
skStrategy::completeReduce_retry
char completeReduce_retry
Definition kutil.h:400
skStrategy::P
LObject P
Definition kutil.h:301
skStrategy::Lmax
int Lmax
Definition kutil.h:350
skStrategy::LazyPass
int LazyPass
Definition kutil.h:352
skStrategy::L
LSet L
Definition kutil.h:326
skStrategy::sl
int sl
Definition kutil.h:347
skStrategy::LazyDegree
int LazyDegree
Definition kutil.h:352
skStrategy::sevS
unsigned long * sevS
Definition kutil.h:321
idTest
#define idTest(id)
Definition ideals.h:47
idHomIdeal
static BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition ideals.h:91
h
STATIC_VAR Poly * h
Definition janet.cc:971
initBba
void initBba(kStrategy strat)
Definition kstd1.cc:1690
kHomW
VAR intvec * kHomW
Definition kstd1.cc:2409
initBuchMora
void initBuchMora(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:9749
message
void message(int i, int *olddeg, int *reduc, kStrategy strat, int red_result)
Definition kutil.cc:7463
kTest_TS
BOOLEAN kTest_TS(kStrategy strat)
Definition kutil.cc:1067
enterL
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
Definition kutil.cc:1269
initBuchMoraPos
void initBuchMoraPos(kStrategy strat)
Definition kutil.cc:9580
posInL0
int posInL0(const LSet set, const int length, LObject *p, const kStrategy)
Definition kutil.cc:5611
exitBuchMora
void exitBuchMora(kStrategy strat)
Definition kutil.cc:9837
posInS
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
Definition kutil.cc:4663
enterT
void enterT(LObject *p, kStrategy strat, int atT)
Definition kutil.cc:9143
cleanT
void cleanT(kStrategy strat)
Definition kutil.cc:557
updateResult
void updateResult(ideal r, ideal Q, kStrategy strat)
Definition kutil.cc:10051
kStratInitChangeTailRing
void kStratInitChangeTailRing(kStrategy strat)
Definition kutil.cc:11036
initBuchMoraCrit
void initBuchMoraCrit(kStrategy strat)
Definition kutil.cc:9435
completeReduce
void completeReduce(kStrategy strat, BOOLEAN withT)
Definition kutil.cc:10257
initBuchMoraPosRing
void initBuchMoraPosRing(kStrategy strat)
Definition kutil.cc:9664
messageSets
void messageSets(kStrategy strat)
Definition kutil.cc:7536
kDeleteLcm
static void kDeleteLcm(LObject *P)
Definition kutil.h:876
LObject
class sLObject LObject
Definition kutil.h:59
TEST_OPT_IDLIFT
#define TEST_OPT_IDLIFT
Definition options.h:131
TEST_OPT_INTSTRATEGY
#define TEST_OPT_INTSTRATEGY
Definition options.h:112
TEST_OPT_DEGBOUND
#define TEST_OPT_DEGBOUND
Definition options.h:115
TEST_OPT_NOT_BUCKETS
#define TEST_OPT_NOT_BUCKETS
Definition options.h:107
p_wrp
void p_wrp(poly p, ring lmRing, ring tailRing)
Definition polys0.cc:373
pGetComp
#define pGetComp(p)
Component.
Definition polys.h:38
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
tHomog
tHomog
Definition structs.h:31
isHomog
@ isHomog
Definition structs.h:33
isNotHomog
@ isNotHomog
Definition structs.h:32
kStrategy
skStrategy * kStrategy
Definition structs.h:54

## kInterRedOld()

ideal kInterRedOld | ( | ideal | F,
|  | const ideal | Q = NULL )

Definition at line 3456 of file kstd1.cc.

{
int j;
kStrategy strat = new skStrategy;
ideal tempF = F;
ideal tempQ = Q;
#ifdef HAVE_PLURAL
if(rIsSCA(currRing))
{
const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
tempF = id_KillSquares(F, m_iFirstAltVar, m_iLastAltVar, currRing);
// this should be done on the upper level!!! :
// tempQ = SCAQuotient(currRing);
if(Q == currRing->qideal)
tempQ = SCAQuotient(currRing);
}
#endif
// if (TEST_OPT_PROT)
// {
// writeTime("start InterRed:");
// mflush();
// }
//strat->syzComp = 0;
strat->kAllAxis = (currRing->ppNoether) != NULL;
strat->kNoether=pCopy((currRing->ppNoether));
strat->ak = 0;
if (id_IsModule(tempF,currRing)) strat->ak = id_RankFreeModule(tempF,currRing);
initBuchMoraCrit(strat);
strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN));
for (j=(currRing->N); j>0; j--) strat->NotUsedAxis[j] = TRUE;
strat->enterS = enterSBba;
strat->posInT = posInT17;
strat->initEcart = initEcartNormal;
strat->sl = -1;
strat->tl = -1;
strat->tmax = setmaxT;
strat->T = initT();
strat->R = initR();
strat->sevT = initsevT();
if (rHasLocalOrMixedOrdering(currRing)) strat->honey = TRUE;
initS(tempF, tempQ, strat);
if (TEST_OPT_REDSB)
strat->noTailReduction=FALSE;
updateS(TRUE,strat);
if (TEST_OPT_REDSB && TEST_OPT_INTSTRATEGY)
completeReduce(strat);
//else if (TEST_OPT_PROT) PrintLn();
cleanT(strat);
if (strat->kNoether!=NULL) pLmFree(&strat->kNoether);
omFreeSize((ADDRESS)strat->T,strat->tmax*sizeof(TObject));
omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
omfree(strat->sevT);
omfree(strat->S_2_R);
omfree(strat->R);
if (strat->fromQ)
{
for (j=IDELEMS(strat->Shdl)-1;j>=0;j--)
{
if(strat->fromQ[j]) pDelete(&strat->Shdl->m[j]);
}
omFree((ADDRESS)strat->fromQ);
strat->fromQ=NULL;
}
// if (TEST_OPT_PROT)
// {
// writeTime("end Interred:");
// mflush();
// }
ideal shdl=strat->Shdl;
idSkipZeroes(shdl);
if (strat->fromQ)
{
omfree(strat->fromQ);
strat->fromQ=NULL;
ideal res=kInterRed(shdl,NULL);
idDelete(&shdl);
shdl=res;
}
delete(strat);
#ifdef HAVE_PLURAL
if( tempF != F )
id_Delete( &tempF, currRing);
#endif
return shdl;
}
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
skStrategy::noTailReduction
char noTailReduction
Definition kutil.h:375
skStrategy::ecartS
intset ecartS
Definition kutil.h:308
skStrategy::honey
char honey
Definition kutil.h:374
skStrategy::R
TObject ** R
Definition kutil.h:339
skStrategy::tmax
int tmax
Definition kutil.h:349
skStrategy::kAllAxis
char kAllAxis
Definition kutil.h:373
skStrategy::posInT
int(* posInT)(const TSet T, const int tl, LObject &h)
Definition kutil.h:282
initT
KINLINE TSet initT()
Definition kInline.h:84
initR
KINLINE TObject ** initR()
Definition kInline.h:95
initsevT
KINLINE unsigned long * initsevT()
Definition kInline.h:100
kInterRed
ideal kInterRed(ideal F, const ideal Q)
Definition kstd1.cc:3802
posInT17
int posInT17(const TSet set, const int length, LObject &p)
Definition kutil.cc:5278
enterSBba
void enterSBba(LObject *p, int atS, kStrategy strat, int atR)
Definition kutil.cc:8792
initS
void initS(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:7586
updateS
void updateS(BOOLEAN toT, kStrategy strat)
Definition kutil.cc:8557
setmaxT
#define setmaxT
Definition kutil.h:34
TObject
class sTObject TObject
Definition kutil.h:58
rIsSCA
static bool rIsSCA(const ring r)
Definition nc.h:190
id_KillSquares
ideal id_KillSquares(const ideal id, const short iFirstAltVar, const short iLastAltVar, const ring r, const bool bSkipZeroes)
Definition sca.cc:1518
omfree
#define omfree(addr)
Definition omAllocDecl.h:237
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260
omFree
#define omFree(addr)
Definition omAllocDecl.h:261
pDelete
#define pDelete(p_ptr)
Definition polys.h:187
pLmFree
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
Definition polys.h:71
SCAQuotient
ideal SCAQuotient(const ring r)
Definition sca.h:10
scaLastAltVar
static short scaLastAltVar(ring r)
Definition sca.h:25
scaFirstAltVar
static short scaFirstAltVar(ring r)
Definition sca.h:18
id_IsModule
BOOLEAN id_IsModule(ideal A, const ring src)
Definition simpleideals.cc:1011

## kMin_std()

ideal kMin_std | ( | ideal | F,
|  | ideal | Q,
|  | tHomog | h,
|  | intvec ** | w,
|  | ideal & | M,
|  | intvec * | hilb,
|  | int | syzComp = 0,
|  | int | reduced = 0 )

Definition at line 3221 of file kstd1.cc.

{
bigintmat *hh=iv2biv(hilb,coeffs_BIGINT);
ideal res=kMin_std2(F,Q,h,w,M,hh,syzComp,reduced);
if (hh!=NULL) delete hh;
return res;
}
bigintmat
Matrices of numbers.
Definition bigintmat.h:51
w
const CanonicalForm & w
Definition facAbsFact.cc:51
iv2biv
bigintmat * iv2biv(intvec *hilb, const coeffs cf)
Definition intvec.cc:851
kMin_std2
ideal kMin_std2(ideal F, ideal Q, tHomog h, intvec **w, ideal &M, bigintmat *hilb, int syzComp, int reduced)
Definition kstd1.cc:3069
coeffs_BIGINT
VAR coeffs coeffs_BIGINT
Definition polys.cc:14
M
#define M
Definition sirandom.c:25

## kMin_std2()

ideal kMin_std2 | ( | ideal | F,
|  | ideal | Q,
|  | tHomog | h,
|  | intvec ** | w,
|  | ideal & | M,
|  | bigintmat * | hilb,
|  | int | syzComp = 0,
|  | int | reduced = 0 )

Definition at line 3069 of file kstd1.cc.

{
if(idIs0(F))
{
M=idInit(1,F->rank);
return idInit(1,F->rank);
}
if(rField_is_Ring(currRing))
{
ideal sb;
sb = kStd2(F, Q, h, w, hilb);
idSkipZeroes(sb);
if(IDELEMS(sb) <= IDELEMS(F))
{
M = idCopy(sb);
idSkipZeroes(M);
return(sb);
}
else
{
M = idCopy(F);
idSkipZeroes(M);
return(sb);
}
}
ideal r=NULL;
int Kstd1_OldDeg = Kstd1_deg,i;
intvec* temp_w=NULL;
BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
BOOLEAN delete_w=(w==NULL);
BOOLEAN oldDegBound=TEST_OPT_DEGBOUND;
kStrategy strat=new skStrategy;
if(!TEST_OPT_RETURN_SB)
strat->syzComp = syzComp;
if (rField_has_simple_inverse(currRing))
strat->LazyPass=20;
else
strat->LazyPass=2;
strat->LazyDegree = 1;
strat->minim=(reduced % 2)+1;
strat->ak = 0;
if (id_IsModule(F,currRing)) strat->ak = id_RankFreeModule(F,currRing);
if (delete_w)
{
temp_w=new intvec((strat->ak)+1);
w = &temp_w;
}
if (h==testHomog)
{
if (strat->ak == 0)
{
h = (tHomog)idHomIdeal(F,Q);
w=NULL;
}
else
{
h = (tHomog)idHomModule(F,Q,w);
}
}
if (h==isHomog)
{
if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
{
kModW = *w;
strat->kModW = *w;
assume(currRing->pFDeg != NULL && currRing->pLDeg != NULL);
strat->pOrigFDeg = currRing->pFDeg;
strat->pOrigLDeg = currRing->pLDeg;
pSetDegProcs(currRing,kModDeg);
toReset = TRUE;
if (reduced>1)
{
Kstd1_OldDeg=Kstd1_deg;
Kstd1_deg = -1;
for (i=IDELEMS(F)-1;i>=0;i--)
{
if ((F->m[i]!=NULL) && (currRing->pFDeg(F->m[i],currRing)>=Kstd1_deg))
Kstd1_deg = currRing->pFDeg(F->m[i],currRing)+1;
}
}
}
currRing->pLexOrder = TRUE;
strat->LazyPass*=2;
}
strat->homog=h;
ideal SB=NULL;
if (rHasLocalOrMixedOrdering(currRing))
{
r=idMinBase(F,&SB); // SB and M via minbase
strat->M=r;
r=SB;
}
else
{
if (w!=NULL)
r=bba(F,Q,*w,hilb,strat);
else
r=bba(F,Q,NULL,hilb,strat);
}
#ifdef KDEBUG
{
int i;
for (i=IDELEMS(r)-1; i>=0; i--) pTest(r->m[i]);
}
#endif
idSkipZeroes(r);
if (toReset)
{
pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
kModW = NULL;
}
currRing->pLexOrder = b;
if ((delete_w)&&(temp_w!=NULL)) delete temp_w;
if ((IDELEMS(r)==1) && (r->m[0]!=NULL) && pIsConstant(r->m[0]) && (strat->ak==0))
{
M=idInit(1,F->rank);
M->m[0]=pOne();
//if (strat->ak!=0) { pSetComp(M->m[0],strat->ak); pSetmComp(M->m[0]); }
if (strat->M!=NULL) idDelete(&strat->M);
}
else if (strat->M==NULL)
{
M=idInit(1,F->rank);
WarnS("no minimal generating set computed");
}
else
{
idSkipZeroes(strat->M);
M=strat->M;
strat->M=NULL;
}
delete(strat);
if (reduced>2)
{
Kstd1_deg=Kstd1_OldDeg;
if (!oldDegBound)
si_opt_1 &= ~Sy_bit(OPT_DEGBOUND);
}
else
{
if (IDELEMS(M)>IDELEMS(r))
{
idDelete(&M);
M=idCopy(r);
}
}
return r;
}
b
CanonicalForm b
Definition cfModGcd.cc:4111
intvec
Definition intvec.h:24
skStrategy::minim
int minim
Definition kutil.h:356
skStrategy::M
ideal M
Definition kutil.h:304
WarnS
#define WarnS
Definition emacs.cc:78
idMinBase
ideal idMinBase(ideal h1, ideal *SB)
Definition ideals.cc:51
idHomModule
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition ideals.h:96
kModDeg
long kModDeg(poly p, const ring r)
Definition kstd1.cc:2411
kStd2
ideal kStd2(ideal F, ideal Q, tHomog h, intvec **w, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
generic interface to GB/SB computations, large hilbert vectors
Definition kstd1.cc:2607
Kstd1_deg
EXTERN_VAR int Kstd1_deg
Definition kstd1.h:70
bba
ideal bba(ideal F, ideal Q, intvec *w, bigintmat *hilb, kStrategy strat)
Definition kstd2.cc:2614
assume
#define assume(x)
Definition mod2.h:389
TEST_OPT_RETURN_SB
#define TEST_OPT_RETURN_SB
Definition options.h:114
OPT_DEGBOUND
#define OPT_DEGBOUND
Definition options.h:91
pRestoreDegProcs
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition p_polys.cc:3774
pTest
#define pTest(p)
Definition polys.h:415
pIsConstant
#define pIsConstant(p)
like above, except that Comp must be 0
Definition polys.h:239
pOne
#define pOne()
Definition polys.h:316
testHomog
@ testHomog
Definition structs.h:34

## kModDeg()

long kModDeg | ( | poly | p,
|  | const ring | r = currRing )

Definition at line 2411 of file kstd1.cc.

{
long o=p_WDegree(p, r);
long i=__p_GetComp(p, r);
if (i==0) return o;
//assume((i>0) && (i<=kModW->length()));
if (i<=kModW->length())
return o+(*kModW)[i-1];
return o;
}
length
static BOOLEAN length(leftv result, leftv arg)
Definition interval.cc:257
p_WDegree
long p_WDegree(poly p, const ring r)
Definition p_polys.cc:715

## kNF() [1/2]

ideal kNF | ( | ideal | F,
|  | ideal | Q,
|  | ideal | p,
|  | int | syzComp = 0,
|  | int | lazyReduce = 0 )

Definition at line 3327 of file kstd1.cc.

{
ideal res;
if (TEST_OPT_PROT)
{
Print("(S:%d)",IDELEMS(p));mflush();
}
if (idIs0(p))
return idInit(IDELEMS(p),si_max(p->rank,F->rank));
ideal pp = p;
#ifdef HAVE_PLURAL
if(rIsSCA(currRing))
{
const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
pp = id_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing, false);
if(Q == currRing->qideal)
Q = SCAQuotient(currRing);
}
#endif
if (idIs0(Q)) Q=NULL;
if ((idIs0(F))&&(Q==NULL))
{
#ifdef HAVE_PLURAL
if(p != pp)
return pp;
#endif
return idCopy(p); /*F+Q=0*/
}
kStrategy strat=new skStrategy;
strat->syzComp = syzComp;
strat->ak = si_max(id_RankFreeModule(F,currRing),id_RankFreeModule(p,currRing));
if (strat->ak>0) // only for module case, see Tst/Short/bug_reduce.tst
{
strat->ak = si_max(strat->ak,(int)F->rank);
}
if (rHasLocalOrMixedOrdering(currRing))
{
#ifdef HAVE_SHIFTBBA
if (currRing->isLPring)
{
WerrorS("No local ordering possible for shift algebra");
return(NULL);
}
#endif
res=kNF1(F,Q,pp,strat,lazyReduce);
}
else
res=kNF2(F,Q,pp,strat,lazyReduce);
delete(strat);
#ifdef HAVE_PLURAL
if(pp != p)
id_Delete(&pp, currRing);
#endif
return res;
}
si_max
static int si_max(const int a, const int b)
Definition auxiliary.h:125
pp
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f ).
Definition cf_gcd.cc:676
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
kNF1
poly kNF1(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
Definition kstd1.cc:2119
kNF2
poly kNF2(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
Definition kstd2.cc:3927

## kNF() [2/2]

poly kNF | ( | ideal | F,
|  | ideal | Q,
|  | poly | p,
|  | int | syzComp = 0,
|  | int | lazyReduce = 0 )

Definition at line 3229 of file kstd1.cc.

{
if (p==NULL)
return NULL;
poly pp = p;
#ifdef HAVE_PLURAL
if(rIsSCA(currRing))
{
const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
pp = p_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing);
if(Q == currRing->qideal)
Q = SCAQuotient(currRing);
}
#endif
if(idIs0(Q)) Q=NULL;
if ((idIs0(F))&&(Q==NULL))
{
#ifdef HAVE_PLURAL
if(p != pp)
return pp;
#endif
return pCopy(p); /*F+Q=0*/
}
kStrategy strat=new skStrategy;
strat->syzComp = syzComp;
strat->ak = si_max(id_RankFreeModule(F,currRing),pMaxComp(p));
poly res;
if (rHasLocalOrMixedOrdering(currRing))
{
#ifdef HAVE_SHIFTBBA
if (currRing->isLPring)
{
WerrorS("No local ordering possible for shift algebra");
return(NULL);
}
#endif
res=kNF1(F,Q,pp,strat,lazyReduce);
}
else
res=kNF2(F,Q,pp,strat,lazyReduce);
delete(strat);
#ifdef HAVE_PLURAL
if(pp != p)
p_Delete(&pp, currRing);
#endif
return res;
}
p_KillSquares
poly p_KillSquares(const poly p, const short iFirstAltVar, const short iLastAltVar, const ring r)
Definition sca.cc:1463
p_Delete
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903
pMaxComp
#define pMaxComp(p)
Definition polys.h:300

## kNF1() [1/2]

ideal kNF1 | ( | ideal | F,
|  | ideal | Q,
|  | ideal | q,
|  | kStrategy | strat,
|  | int | lazyReduce )

Definition at line 2260 of file kstd1.cc.

{
assume(!idIs0(q));
assume(!(idIs0(F)&&(Q==NULL)));
// lazy_reduce flags: can be combined by |
//#define KSTD_NF_LAZY 1
// do only a reduction of the leading term
//#define KSTD_NF_ECART 2
// only local: reduce even with bad ecart
poly p;
int i;
int j;
int o;
LObject h;
ideal res;
BITSET save1;
SI_SAVE_OPT1(save1);
//if (idIs0(q)) return idInit(IDELEMS(q),si_max(q->rank,F->rank));
//if ((idIs0(F))&&(Q==NULL))
// return idCopy(q); /*F=0*/
//strat->ak = si_max(idRankFreeModule(F),idRankFreeModule(q));
/*- creating temp data structures------------------- -*/
strat->kAllAxis = (currRing->ppNoether) != NULL;
strat->kNoether=pCopy((currRing->ppNoether));
si_opt_1|=Sy_bit(OPT_REDTAIL);
if (TEST_OPT_STAIRCASEBOUND
&& (0<Kstd1_deg)
&& ((strat->kNoether==NULL)
||(TEST_OPT_DEGBOUND && (pWTotaldegree(strat->kNoether)<Kstd1_deg))))
{
pLmDelete(&strat->kNoether);
strat->kNoether=pOne();
pSetExp(strat->kNoether,1, Kstd1_deg+1);
pSetm(strat->kNoether);
//strat->kAllAxis=TRUE;
}
initBuchMoraCrit(strat);
if(rField_is_Ring(currRing))
initBuchMoraPosRing(strat);
else
initBuchMoraPos(strat);
initMora(F,strat);
strat->enterS = enterSMoraNF;
/*- set T -*/
strat->tl = -1;
strat->tmax = setmaxT;
strat->T = initT();
strat->R = initR();
strat->sevT = initsevT();
/*- set S -*/
strat->sl = -1;
/*- init local data struct.-------------------------- -*/
/*Shdl=*/initS(F,Q,strat);
if ((strat->ak!=0)
&& (strat->kNoether!=NULL))
{
if (strat->ak!=1)
{
pSetComp(strat->kNoether,1);
pSetmComp(strat->kNoether);
poly p=pHead(strat->kNoether);
pSetComp(p,strat->ak);
pSetmComp(p);
p=pAdd(strat->kNoether,p);
strat->kNoether=pNext(p);
p_LmDelete(p,currRing);
}
}
if (((lazyReduce & KSTD_NF_LAZY)==0)
&& (!rField_is_Ring(currRing)))
{
for (i=strat->sl; i>=0; i--)
pNorm(strat->S[i]);
}
/*- compute------------------------------------------- -*/
res=idInit(IDELEMS(q),strat->ak);
for (i=0; i<IDELEMS(q); i++)
{
if (q->m[i]!=NULL)
{
p = pCopy(q->m[i]);
deleteHC(&p,&o,&j,strat);
if (p!=NULL)
{
/*- puts the elements of S also to T -*/
for (j=0; j<=strat->sl; j++)
{
h.p = strat->S[j];
h.ecart = strat->ecartS[j];
h.pLength = h.length = pLength(h.p);
if (strat->sevS[j] == 0) strat->sevS[j] = pGetShortExpVector(h.p);
else assume(strat->sevS[j] == pGetShortExpVector(h.p));
h.sev = strat->sevS[j];
h.SetpFDeg();
if(rField_is_Ring(currRing) && rHasLocalOrMixedOrdering(currRing))
enterT_strong(&h,strat);
else
enterT(&h,strat);
}
if (TEST_OPT_PROT) { PrintS("r"); mflush(); }
if(rField_is_Ring(currRing))
{
p = redMoraNFRing(p,strat, lazyReduce);
}
else
p = redMoraNF(p,strat, lazyReduce);
if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
{
if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
p = redtail(p,strat->sl,strat);
}
cleanT(strat);
}
res->m[i]=p;
}
//else
// res->m[i]=NULL;
}
/*- release temp data------------------------------- -*/
assume(strat->L==NULL); /*strat->L unused */
assume(strat->B==NULL); /*strat->B unused */
omFreeSize((ADDRESS)strat->T,strat->tmax*sizeof(TObject));
omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
omFree(strat->sevT);
omFree(strat->S_2_R);
omFree(strat->R);
omfree((ADDRESS)strat->fromQ);
strat->fromQ=NULL;
if (strat->kNoether!=NULL) pLmFree(&strat->kNoether);
// if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
// {
// pFDeg=strat->pOrigFDeg;
// pLDeg=strat->pOrigLDeg;
// if (ecartWeights)
// {
// omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
// ecartWeights=NULL;
// }
// }
idDelete(&strat->Shdl);
SI_RESTORE_OPT1(save1);
if (TEST_OPT_PROT) PrintLn();
return res;
}
skStrategy::B
LSet B
Definition kutil.h:327
initMora
void initMora(ideal F, kStrategy strat)
Definition kstd1.cc:1820
redMoraNFRing
static poly redMoraNFRing(poly h, kStrategy strat, int flag)
Definition kstd1.cc:1080
redMoraNF
static poly redMoraNF(poly h, kStrategy strat, int flag)
Definition kstd1.cc:976
enterSMoraNF
void enterSMoraNF(LObject *p, int atS, kStrategy strat, int atR)
Definition kstd1.cc:1682
redtail
poly redtail(LObject *L, int end_pos, kStrategy strat)
Definition kutil.cc:6836
enterT_strong
void enterT_strong(LObject *p, kStrategy strat, int atT)
Definition kutil.cc:9242
deleteHC
void deleteHC(LObject *L, kStrategy strat, BOOLEAN fromNext)
Definition kutil.cc:286
OPT_REDTAIL
#define OPT_REDTAIL
Definition options.h:92
TEST_OPT_STAIRCASEBOUND
#define TEST_OPT_STAIRCASEBOUND
Definition options.h:117
pLength
static int pLength(poly a)
Definition p_polys.h:190
p_LmDelete
static void p_LmDelete(poly p, const ring r)
Definition p_polys.h:725
pAdd
#define pAdd(p, q)
Definition polys.h:204
pHead
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
Definition polys.h:68
pSetm
#define pSetm(p)
Definition polys.h:272
pNorm
void pNorm(poly p)
Definition polys.h:363
pSetComp
#define pSetComp(p, v)
Definition polys.h:39
pLmDelete
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition polys.h:77
pGetShortExpVector
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl....
Definition polys.h:153
pSetmComp
#define pSetmComp(p)
TODO:
Definition polys.h:274
pSetExp
#define pSetExp(p, i, v)
Definition polys.h:43
pWTotaldegree
#define pWTotaldegree(p)
Definition polys.h:284

## kNF1() [2/2]

poly kNF1 | ( | ideal | F,
|  | ideal | Q,
|  | poly | q,
|  | kStrategy | strat,
|  | int | lazyReduce )

Definition at line 2119 of file kstd1.cc.

{
assume(q!=NULL);
assume(!(idIs0(F)&&(Q==NULL)));
// lazy_reduce flags: can be combined by |
//#define KSTD_NF_LAZY 1
// do only a reduction of the leading term
//#define KSTD_NF_ECART 2
// only local: reduce even with bad ecart
poly p;
int i;
int j;
int o;
LObject h;
BITSET save1;
SI_SAVE_OPT1(save1);
//if ((idIs0(F))&&(Q==NULL))
// return pCopy(q); /*F=0*/
//strat->ak = si_max(idRankFreeModule(F),pMaxComp(q));
/*- creating temp data structures------------------- -*/
strat->kAllAxis = (currRing->ppNoether) != NULL;
strat->kNoether = pCopy((currRing->ppNoether));
si_opt_1|=Sy_bit(OPT_REDTAIL);
if (!rField_is_Ring(currRing))
si_opt_1&=~Sy_bit(OPT_INTSTRATEGY);
if (TEST_OPT_STAIRCASEBOUND
&& (! TEST_V_DEG_STOP)
&& (0<Kstd1_deg)
&& ((strat->kNoether==NULL)
||(TEST_OPT_DEGBOUND && (pWTotaldegree(strat->kNoether)<Kstd1_deg))))
{
pLmDelete(&strat->kNoether);
strat->kNoether=pOne();
pSetExp(strat->kNoether,1, Kstd1_deg+1);
pSetm(strat->kNoether);
// strat->kAllAxis=TRUE;
}
initBuchMoraCrit(strat);
if(rField_is_Ring(currRing))
initBuchMoraPosRing(strat);
else
initBuchMoraPos(strat);
initMora(F,strat);
strat->enterS = enterSMoraNF;
/*- set T -*/
strat->tl = -1;
strat->tmax = setmaxT;
strat->T = initT();
strat->R = initR();
strat->sevT = initsevT();
/*- set S -*/
strat->sl = -1;
/*- init local data struct.-------------------------- -*/
/*Shdl=*/initS(F,Q,strat);
if ((strat->ak!=0)
&& (strat->kAllAxis)) /*never true for ring-cf*/
{
if (strat->ak!=1)
{
pSetComp(strat->kNoether,1);
pSetmComp(strat->kNoether);
poly p=pHead(strat->kNoether);
pSetComp(p,strat->ak);
pSetmComp(p);
p=pAdd(strat->kNoether,p);
strat->kNoether=pNext(p);
p_LmDelete(p,currRing);
}
}
if (((lazyReduce & KSTD_NF_LAZY)==0)
&& (!rField_is_Ring(currRing)))
{
for (i=strat->sl; i>=0; i--)
pNorm(strat->S[i]);
}
/*- puts the elements of S also to T -*/
for (i=0; i<=strat->sl; i++)
{
h.p = strat->S[i];
h.ecart = strat->ecartS[i];
if (strat->sevS[i] == 0) strat->sevS[i] = pGetShortExpVector(h.p);
else assume(strat->sevS[i] == pGetShortExpVector(h.p));
h.length = pLength(h.p);
h.sev = strat->sevS[i];
h.SetpFDeg();
enterT(&h,strat);
}
#ifdef KDEBUG
// kDebugPrint(strat);
#endif
/*- compute------------------------------------------- -*/
p = pCopy(q);
deleteHC(&p,&o,&j,strat);
kTest(strat);
if (TEST_OPT_PROT) { PrintS("r"); mflush(); }
if (BVERBOSE(23)) kDebugPrint(strat);
if(rField_is_Ring(currRing))
{
if (p!=NULL) p = redMoraNFRing(p,strat, lazyReduce & (KSTD_NF_ECART|KSTD_NF_CANCELUNIT));
}
else
{
if (p!=NULL) p = redMoraNF(p,strat, lazyReduce & (KSTD_NF_ECART|KSTD_NF_CANCELUNIT));
}
if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
{
if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
p = redtail(p,strat->sl,strat);
}
/*- release temp data------------------------------- -*/
cleanT(strat);
assume(strat->L==NULL); /*strat->L unused */
assume(strat->B==NULL); /*strat->B unused */
omFreeSize((ADDRESS)strat->T,strat->tmax*sizeof(TObject));
omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
omFree(strat->sevT);
omFree(strat->S_2_R);
omFree(strat->R);
omfree((ADDRESS)strat->fromQ);
strat->fromQ=NULL;
if (strat->kNoether!=NULL) pLmFree(&strat->kNoether);
// if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
// {
// pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
// if (ecartWeights)
// {
// omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
// ecartWeights=NULL;
// }
// }
idDelete(&strat->Shdl);
SI_RESTORE_OPT1(save1);
if (TEST_OPT_PROT) PrintLn();
return p;
}
kDebugPrint
void kDebugPrint(kStrategy strat)
Definition kutil.cc:11478
KSTD_NF_CANCELUNIT
#define KSTD_NF_CANCELUNIT
Definition kstd1.h:24
KSTD_NF_ECART
#define KSTD_NF_ECART
Definition kstd1.h:20
kTest
BOOLEAN kTest(kStrategy strat)
Definition kutil.cc:1004
OPT_INTSTRATEGY
#define OPT_INTSTRATEGY
Definition options.h:93
BVERBOSE
#define BVERBOSE(a)
Definition options.h:35
TEST_V_DEG_STOP
#define TEST_V_DEG_STOP
Definition options.h:140

## kNFBound() [1/2]

ideal kNFBound | ( | ideal | F,
|  | ideal | Q,
|  | ideal | p,
|  | int | bound,
|  | int | syzComp = 0,
|  | int | lazyReduce = 0 )

Definition at line 3392 of file kstd1.cc.

{
ideal res;
if (TEST_OPT_PROT)
{
Print("(S:%d)",IDELEMS(p));mflush();
}
if (idIs0(p))
return idInit(IDELEMS(p),si_max(p->rank,F->rank));
ideal pp = p;
#ifdef HAVE_PLURAL
if(rIsSCA(currRing))
{
const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
pp = id_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing, false);
if(Q == currRing->qideal)
Q = SCAQuotient(currRing);
}
#endif
if ((idIs0(F))&&(Q==NULL))
{
#ifdef HAVE_PLURAL
if(p != pp)
return pp;
#endif
return idCopy(p); /*F+Q=0*/
}
kStrategy strat=new skStrategy;
strat->syzComp = syzComp;
strat->ak = si_max(id_RankFreeModule(F,currRing),id_RankFreeModule(p,currRing));
if (strat->ak>0) // only for module case, see Tst/Short/bug_reduce.tst
{
strat->ak = si_max(strat->ak,(int)F->rank);
}
res=kNF2Bound(F,Q,pp,bound,strat,lazyReduce);
delete(strat);
#ifdef HAVE_PLURAL
if(pp != p)
id_Delete(&pp, currRing);
#endif
return res;
}
bound
static CanonicalForm bound(const CFMatrix &M)
Definition cf_linsys.cc:460
kNF2Bound
poly kNF2Bound(ideal F, ideal Q, poly q, int bound, kStrategy strat, int lazyReduce)
Definition kstd2.cc:4015

## kNFBound() [2/2]

poly kNFBound | ( | ideal | F,
|  | ideal | Q,
|  | poly | p,
|  | int | bound,
|  | int | syzComp = 0,
|  | int | lazyReduce = 0 )

Definition at line 3285 of file kstd1.cc.

{
if (p==NULL)
return NULL;
poly pp = p;
#ifdef HAVE_PLURAL
if(rIsSCA(currRing))
{
const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
pp = p_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing);
if(Q == currRing->qideal)
Q = SCAQuotient(currRing);
}
#endif
if ((idIs0(F))&&(Q==NULL))
{
#ifdef HAVE_PLURAL
if(p != pp)
return pp;
#endif
return pCopy(p); /*F+Q=0*/
}
kStrategy strat=new skStrategy;
strat->syzComp = syzComp;
strat->ak = si_max(id_RankFreeModule(F,currRing),pMaxComp(p));
poly res;
res=kNF2Bound(F,Q,pp,bound,strat,lazyReduce);
delete(strat);
#ifdef HAVE_PLURAL
if(pp != p)
p_Delete(&pp, currRing);
#endif
return res;
}

## kSba()

ideal kSba | ( | ideal | F,
|  | ideal | Q,
|  | tHomog | h,
|  | intvec ** | mw,
|  | int | incremental = 0,
|  | int | arri = 0,
|  | bigintmat * | hilb = NULL,
|  | int | syzComp = 0,
|  | int | newIdeal = 0,
|  | intvec * | vw = NULL )

Definition at line 2668 of file kstd1.cc.

{
if(idIs0(F))
return idInit(1,F->rank);
if(!rField_is_Ring(currRing))
{
ideal r;
BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
BOOLEAN delete_w=(w==NULL);
kStrategy strat=new skStrategy;
strat->sbaOrder = sbaOrder;
if (arri!=0)
{
strat->rewCrit1 = arriRewDummy;
strat->rewCrit2 = arriRewCriterion;
strat->rewCrit3 = arriRewCriterionPre;
}
else
{
strat->rewCrit1 = faugereRewCriterion;
strat->rewCrit2 = faugereRewCriterion;
strat->rewCrit3 = faugereRewCriterion;
}
if(!TEST_OPT_RETURN_SB)
strat->syzComp = syzComp;
if (TEST_OPT_SB_1)
//if(!rField_is_Ring(currRing)) // always true here
strat->newIdeal = newIdeal;
if (rField_has_simple_inverse(currRing))
strat->LazyPass=20;
else
strat->LazyPass=2;
strat->LazyDegree = 1;
strat->enterOnePair=enterOnePairNormal;
strat->chainCrit=chainCritNormal;
if (TEST_OPT_SB_1) strat->chainCrit=chainCritOpt_1;
strat->ak = 0;
if (id_IsModule(F,currRing)) strat->ak = id_RankFreeModule(F,currRing);
strat->kModW=kModW=NULL;
strat->kHomW=kHomW=NULL;
if (vw != NULL)
{
currRing->pLexOrder=FALSE;
strat->kHomW=kHomW=vw;
strat->pOrigFDeg = currRing->pFDeg;
strat->pOrigLDeg = currRing->pLDeg;
pSetDegProcs(currRing,kHomModDeg);
toReset = TRUE;
}
if (h==testHomog)
{
if (strat->ak == 0)
{
h = (tHomog)idHomIdeal(F,Q);
w=NULL;
}
else if (!TEST_OPT_DEGBOUND)
{
if (w!=NULL)
h = (tHomog)idHomModule(F,Q,w);
else
h = (tHomog)idHomIdeal(F,Q);
}
}
currRing->pLexOrder=b;
if (h==isHomog)
{
if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
{
strat->kModW = kModW = *w;
if (vw == NULL)
{
strat->pOrigFDeg = currRing->pFDeg;
strat->pOrigLDeg = currRing->pLDeg;
pSetDegProcs(currRing,kModDeg);
toReset = TRUE;
}
}
currRing->pLexOrder = TRUE;
if (hilb==NULL) strat->LazyPass*=2;
}
strat->homog=h;
#ifdef KDEBUG
idTest(F);
if(Q != NULL)
idTest(Q);
#endif
#ifdef HAVE_PLURAL
if (rIsPluralRing(currRing))
{
const BOOLEAN bIsSCA = rIsSCA(currRing) && strat->z2homog; // for Z_2 prod-crit
strat->no_prod_crit = ! bIsSCA;
if (w!=NULL)
r = nc_GB(F, Q, *w, hilb, strat, currRing);
else
r = nc_GB(F, Q, NULL, hilb, strat, currRing);
}
else
#endif
{
if (rHasLocalOrMixedOrdering(currRing))
{
if (w!=NULL)
r=mora(F,Q,*w,hilb,strat);
else
r=mora(F,Q,NULL,hilb,strat);
}
else
{
strat->sigdrop = FALSE;
if (w!=NULL)
r=sba(F,Q,*w,hilb,strat);
else
r=sba(F,Q,NULL,hilb,strat);
}
}
#ifdef KDEBUG
idTest(r);
#endif
if (toReset)
{
kModW = NULL;
pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
}
currRing->pLexOrder = b;
//Print("%d reductions canceled \n",strat->cel);
//delete(strat);
if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
return r;
}
else
{
//--------------------------RING CASE-------------------------
assume(sbaOrder == 1);
assume(arri == 0);
ideal r;
r = idCopy(F);
int sbaEnterS = -1;
bool sigdrop = TRUE;
//This is how we set the SBA algorithm;
int totalsbaruns = 1,blockedreductions = 20,blockred = 0,loops = 0;
while(sigdrop && (loops < totalsbaruns || totalsbaruns == -1)
&& (blockred <= blockedreductions))
{
loops++;
if(loops == 1)
sigdrop = FALSE;
BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
BOOLEAN delete_w=(w==NULL);
kStrategy strat=new skStrategy;
strat->sbaEnterS = sbaEnterS;
strat->sigdrop = sigdrop;
#if 0
strat->blockred = blockred;
#else
strat->blockred = 0;
#endif
strat->blockredmax = blockedreductions;
//printf("\nsbaEnterS beginning = %i\n",strat->sbaEnterS);
//printf("\nsigdrop beginning = %i\n",strat->sigdrop);
strat->sbaOrder = sbaOrder;
if (arri!=0)
{
strat->rewCrit1 = arriRewDummy;
strat->rewCrit2 = arriRewCriterion;
strat->rewCrit3 = arriRewCriterionPre;
}
else
{
strat->rewCrit1 = faugereRewCriterion;
strat->rewCrit2 = faugereRewCriterion;
strat->rewCrit3 = faugereRewCriterion;
}
if(!TEST_OPT_RETURN_SB)
strat->syzComp = syzComp;
if (TEST_OPT_SB_1)
if(!rField_is_Ring(currRing))
strat->newIdeal = newIdeal;
if (rField_has_simple_inverse(currRing))
strat->LazyPass=20;
else
strat->LazyPass=2;
strat->LazyDegree = 1;
strat->enterOnePair=enterOnePairNormal;
strat->chainCrit=chainCritNormal;
if (TEST_OPT_SB_1) strat->chainCrit=chainCritOpt_1;
strat->ak = 0;
if (id_IsModule(F,currRing)) strat->ak = id_RankFreeModule(F,currRing);
strat->kModW=kModW=NULL;
strat->kHomW=kHomW=NULL;
if (vw != NULL)
{
currRing->pLexOrder=FALSE;
strat->kHomW=kHomW=vw;
strat->pOrigFDeg = currRing->pFDeg;
strat->pOrigLDeg = currRing->pLDeg;
pSetDegProcs(currRing,kHomModDeg);
toReset = TRUE;
}
if (h==testHomog)
{
if (strat->ak == 0)
{
h = (tHomog)idHomIdeal(F,Q);
w=NULL;
}
else if (!TEST_OPT_DEGBOUND)
{
if (w!=NULL)
h = (tHomog)idHomModule(F,Q,w);
else
h = (tHomog)idHomIdeal(F,Q);
}
}
currRing->pLexOrder=b;
if (h==isHomog)
{
if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
{
strat->kModW = kModW = *w;
if (vw == NULL)
{
strat->pOrigFDeg = currRing->pFDeg;
strat->pOrigLDeg = currRing->pLDeg;
pSetDegProcs(currRing,kModDeg);
toReset = TRUE;
}
}
currRing->pLexOrder = TRUE;
if (hilb==NULL) strat->LazyPass*=2;
}
strat->homog=h;
#ifdef KDEBUG
idTest(F);
if(Q != NULL)
idTest(Q);
#endif
#ifdef HAVE_PLURAL
if (rIsPluralRing(currRing))
{
const BOOLEAN bIsSCA = rIsSCA(currRing) && strat->z2homog; // for Z_2 prod-crit
strat->no_prod_crit = ! bIsSCA;
if (w!=NULL)
r = nc_GB(F, Q, *w, hilb, strat, currRing);
else
r = nc_GB(F, Q, NULL, hilb, strat, currRing);
}
else
#endif
{
if (rHasLocalOrMixedOrdering(currRing))
{
if (w!=NULL)
r=mora(F,Q,*w,hilb,strat);
else
r=mora(F,Q,NULL,hilb,strat);
}
else
{
if (w!=NULL)
r=sba(r,Q,*w,hilb,strat);
else
{
r=sba(r,Q,NULL,hilb,strat);
}
}
}
#ifdef KDEBUG
idTest(r);
#endif
if (toReset)
{
kModW = NULL;
pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
}
currRing->pLexOrder = b;
//Print("%d reductions canceled \n",strat->cel);
sigdrop = strat->sigdrop;
sbaEnterS = strat->sbaEnterS;
blockred = strat->blockred;
delete(strat);
if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
}
// Go to std
if(sigdrop || blockred > blockedreductions)
{
r = kStd2(r, Q, h, w, hilb, syzComp, newIdeal, vw);
}
return r;
}
}
skStrategy::sigdrop
bool sigdrop
Definition kutil.h:357
skStrategy::chainCrit
void(* chainCrit)(poly p, int ecart, kStrategy strat)
Definition kutil.h:290
skStrategy::rewCrit1
BOOLEAN(* rewCrit1)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.h:292
skStrategy::rewCrit3
BOOLEAN(* rewCrit3)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.h:294
skStrategy::blockred
int blockred
Definition kutil.h:362
skStrategy::sbaOrder
unsigned sbaOrder
Definition kutil.h:315
skStrategy::blockredmax
int blockredmax
Definition kutil.h:363
skStrategy::newIdeal
int newIdeal
Definition kutil.h:355
skStrategy::z2homog
char z2homog
Definition kutil.h:371
skStrategy::no_prod_crit
char no_prod_crit
Definition kutil.h:391
skStrategy::enterOnePair
void(* enterOnePair)(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
Definition kutil.h:289
skStrategy::rewCrit2
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.h:293
skStrategy::sbaEnterS
int sbaEnterS
Definition kutil.h:360
arriRewDummy
KINLINE BOOLEAN arriRewDummy(poly, unsigned long, poly, kStrategy, int)
Definition kInline.h:1258
nc_GB
static ideal nc_GB(const ideal F, const ideal Q, const intvec *w, const bigintmat *hilb, kStrategy strat, const ring r)
Definition nc.h:27
kHomModDeg
long kHomModDeg(poly p, const ring r)
Definition kstd1.cc:2421
mora
ideal mora(ideal F, ideal Q, intvec *w, bigintmat *hilb, kStrategy strat)
Definition kstd1.cc:1887
sba
ideal sba(ideal F0, ideal Q, intvec *w, bigintmat *hilb, kStrategy strat)
Definition kstd2.cc:2971
arriRewCriterionPre
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int)
Definition kutil.cc:6646
arriRewCriterion
BOOLEAN arriRewCriterion(poly, unsigned long, poly, kStrategy strat, int start=0)
Definition kutil.cc:6621
enterOnePairNormal
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
Definition kutil.cc:1939
faugereRewCriterion
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly, kStrategy strat, int start=0)
Definition kutil.cc:6562
chainCritOpt_1
void chainCritOpt_1(poly, int, kStrategy strat)
Definition kutil.cc:3445
chainCritNormal
void chainCritNormal(poly p, int ecart, kStrategy strat)
Definition kutil.cc:3204
TEST_OPT_SB_1
#define TEST_OPT_SB_1
Definition options.h:121

## kStd()

ideal kStd | ( | ideal | F,
|  | ideal | Q,
|  | tHomog | h,
|  | intvec ** | mw,
|  | intvec * | hilb = NULL,
|  | int | syzComp = 0,
|  | int | newIdeal = 0,
|  | intvec * | vw = NULL,
|  | s_poly_proc_t | sp = NULL )

generic interface to GB/SB computations

Definition at line 2659 of file kstd1.cc.

{
bigintmat *hh=iv2biv(hilb,coeffs_BIGINT);
ideal res=kStd2(F,Q,h,w,hh,syzComp,newIdeal,vw,sp);
if (hh!=NULL) delete hh;
return res;
}

## kStd2()

ideal kStd2 | ( | ideal | F,
|  | ideal | Q,
|  | tHomog | h,
|  | intvec ** | mw,
|  | bigintmat * | hilb = NULL,
|  | int | syzComp = 0,
|  | int | newIdeal = 0,
|  | intvec * | vw = NULL,
|  | s_poly_proc_t | sp = NULL )

generic interface to GB/SB computations, large hilbert vectors

rIsLPRing already tested above

Definition at line 2607 of file kstd1.cc.

{
if(idIs0(F))
return idInit(1,F->rank);
if(idIs0(Q)) Q=NULL;
#ifdef HAVE_SHIFTBBA
if(rIsLPRing(currRing)) return kStdShift(F, Q, h, w, hilb, syzComp, newIdeal, vw, FALSE);
#endif
if ((hilb==NULL)
&& (vw==NULL)
&& (newIdeal==0)
&& (sp==NULL)
&& (IDELEMS(F)>1)
&& (!TEST_OPT_SB_1)
&& (currRing->ppNoether==NULL)
&& !rIsPluralRing(currRing) /*!rIsLPRing already tested above*/
&& (!id_IsModule(F,currRing)))
{
/* test HC precomputation*/
if( rField_is_Q(currRing)
&& (!rHasGlobalOrdering(currRing))
&& (rOrd_is_ds(currRing)||rOrd_is_Ds(currRing))
&& (!idIsMonomial(F)))
{
currRing->ppNoether=kTryHC(F,Q);
ideal res=kStd_internal(F,Q,h,w,hilb,syzComp,newIdeal,vw,sp);
if (currRing->ppNoether!=NULL) pLmDelete(currRing->ppNoether);
currRing->ppNoether=NULL;
return res;
}
/* test hilbstd */
if ( rHasGlobalOrdering(currRing)
&& (!TEST_OPT_RETURN_SB)
&& (!TEST_OPT_DEGBOUND)
&& (currRing->LexOrder
|| rHasBlockOrder(currRing))
&& (!idIsMonomial(F)))
{
ideal result=kTryHilbstd(F,Q);
//ideal result=kTryHilbstd_par(F,Q,h,w);
if (result!=NULL)
{
return result;
}
}
}
return kStd_internal(F,Q,h,w,hilb,syzComp,newIdeal,vw,sp);
}
kStd_internal
ideal kStd_internal(ideal F, ideal Q, tHomog h, intvec **w, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
pure GB/SB computations
Definition kstd1.cc:2434
kStdShift
ideal kStdShift(ideal F, ideal Q, tHomog h, intvec **w, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw, BOOLEAN rightGB)
Definition kstd1.cc:2964
kTryHC
poly kTryHC(ideal F, ideal Q)
Definition kstdhelper.cc:38
kTryHilbstd
ideal kTryHilbstd(ideal F, ideal Q)
Definition kstdhelper.cc:323
rHasBlockOrder
BOOLEAN rHasBlockOrder(const ring r)
Definition ring.cc:1924
rOrd_is_Ds
BOOLEAN rOrd_is_Ds(const ring r)
Definition ring.cc:2076
rOrd_is_ds
BOOLEAN rOrd_is_ds(const ring r)
Definition ring.cc:2066
rHasGlobalOrdering
static BOOLEAN rHasGlobalOrdering(const ring r)
Definition ring.h:768
rIsLPRing
static BOOLEAN rIsLPRing(const ring r)
Definition ring.h:417
rField_is_Q
static BOOLEAN rField_is_Q(const ring r)
Definition ring.h:512
idIsMonomial
BOOLEAN idIsMonomial(ideal h)
returns true if h is generated by monomials
Definition simpleideals.cc:972

## kStd_internal()

ideal kStd_internal | ( | ideal | F,
|  | ideal | Q,
|  | tHomog | h,
|  | intvec ** | w,
|  | bigintmat * | hilb = NULL,
|  | int | syzComp = 0,
|  | int | newIdeal = 0,
|  | intvec * | vw = NULL,
|  | s_poly_proc_t | sp = NULL )

pure GB/SB computations

Definition at line 2434 of file kstd1.cc.

{
assume(!idIs0(F));
assume((Q==NULL)||(!idIs0(Q)));
kStrategy strat=new skStrategy;
ideal r;
BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
BOOLEAN delete_w=(w==NULL);
strat->s_poly=sp;
if(!TEST_OPT_RETURN_SB)
strat->syzComp = syzComp;
if (TEST_OPT_SB_1
&&(!rField_is_Ring(currRing))
)
strat->newIdeal = newIdeal;
if (rField_has_simple_inverse(currRing))
strat->LazyPass=20;
else
strat->LazyPass=2;
strat->LazyDegree = 1;
strat->ak = 0;
if (id_IsModule(F,currRing)) strat->ak = id_RankFreeModule(F,currRing);
strat->kModW=kModW=NULL;
strat->kHomW=kHomW=NULL;
if (vw != NULL)
{
currRing->pLexOrder=FALSE;
strat->kHomW=kHomW=vw;
strat->pOrigFDeg = currRing->pFDeg;
strat->pOrigLDeg = currRing->pLDeg;
pSetDegProcs(currRing,kHomModDeg);
toReset = TRUE;
}
if (h==testHomog)
{
if (strat->ak == 0)
{
h = (tHomog)idHomIdeal(F,Q);
w=NULL;
}
else if (!TEST_OPT_DEGBOUND)
{
if (w!=NULL)
h = (tHomog)idHomModule(F,Q,w);
else
h = (tHomog)idHomIdeal(F,Q);
}
}
currRing->pLexOrder=b;
if (h==isHomog)
{
if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
{
strat->kModW = kModW = *w;
if (vw == NULL)
{
strat->pOrigFDeg = currRing->pFDeg;
strat->pOrigLDeg = currRing->pLDeg;
pSetDegProcs(currRing,kModDeg);
toReset = TRUE;
}
}
currRing->pLexOrder = TRUE;
if (hilb==NULL) strat->LazyPass*=2;
}
strat->homog=h;
#ifdef KDEBUG
idTest(F);
if (Q!=NULL) idTest(Q);
#endif
#ifdef HAVE_PLURAL
if (rIsPluralRing(currRing))
{
const BOOLEAN bIsSCA = rIsSCA(currRing) && strat->z2homog; // for Z_2 prod-crit
strat->no_prod_crit = ! bIsSCA;
if (w!=NULL)
r = nc_GB(F, Q, *w, hilb, strat, currRing);
else
r = nc_GB(F, Q, NULL, hilb, strat, currRing);
}
else
#endif
{
#if PRE_INTEGER_CHECK
//the preinteger check strategy is not for modules
if(nCoeff_is_Z(currRing->cf) && strat->ak <= 0)
{
ideal FCopy = idCopy(F);
poly pFmon = preIntegerCheck(FCopy, Q);
if(pFmon != NULL)
{
idInsertPoly(FCopy, pFmon);
strat->kModW=kModW=NULL;
if (h==testHomog)
{
h = (tHomog)idHomIdeal(FCopy,Q);
w=NULL;
}
currRing->pLexOrder=b;
if (h==isHomog)
{
if ((w!=NULL) && (*w!=NULL))
{
strat->kModW = kModW = *w;
if (vw == NULL)
{
strat->pOrigFDeg = currRing->pFDeg;
strat->pOrigLDeg = currRing->pLDeg;
pSetDegProcs(currRing,kModDeg);
toReset = TRUE;
}
}
currRing->pLexOrder = TRUE;
if (hilb==NULL) strat->LazyPass*=2;
}
strat->homog=h;
}
omTestMemory(1);
if(w == NULL)
{
if(rHasLocalOrMixedOrdering(currRing))
r=mora(FCopy,Q,NULL,hilb,strat);
else
r=bba(FCopy,Q,NULL,hilb,strat);
}
else
{
if(rHasLocalOrMixedOrdering(currRing))
r=mora(FCopy,Q,*w,hilb,strat);
else
r=bba(FCopy,Q,*w,hilb,strat);
}
idDelete(&FCopy);
}
else
#endif
{
if(w==NULL)
{
if(rHasLocalOrMixedOrdering(currRing))
r=mora(F,Q,NULL,hilb,strat);
else
r=bba(F,Q,NULL,hilb,strat);
}
else
{
if(rHasLocalOrMixedOrdering(currRing))
r=mora(F,Q,*w,hilb,strat);
else
r=bba(F,Q,*w,hilb,strat);
}
}
}
if(errorreported) return NULL;
#ifdef KDEBUG
idTest(r);
#endif
if (toReset)
{
kModW = NULL;
pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
}
currRing->pLexOrder = b;
//Print("%d reductions canceled \n",strat->cel);
delete(strat);
if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
return r;
}
skStrategy::s_poly
s_poly_proc_t s_poly
Definition kutil.h:299
nCoeff_is_Z
static FORCE_INLINE BOOLEAN nCoeff_is_Z(const coeffs r)
Definition coeffs.h:811
errorreported
VAR short errorreported
Definition feFopen.cc:23
idInsertPoly
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted
Definition simpleideals.cc:832
preIntegerCheck
poly preIntegerCheck(const ideal Forig, const ideal Q)
used for GB over ZZ: look for constant and monomial elements in the ideal background: any known const...
Definition kutil.cc:10518
omTestMemory
omError_t omTestMemory(int check_level)
Definition omDebug.c:94

## kStdShift()

ideal kStdShift | ( | ideal | F,
|  | ideal | Q,
|  | tHomog | h,
|  | intvec ** | mw,
|  | bigintmat * | hilb = NULL,
|  | int | syzComp = 0,
|  | int | newIdeal = 0,
|  | intvec * | vw = NULL,
|  | BOOLEAN | rightGB = FALSE )

Definition at line 2964 of file kstd1.cc.

{
assume(rIsLPRing(currRing));
assume(idIsInV(F));
if (rHasLocalOrMixedOrdering(currRing))
{
/* error: no local ord yet with shifts */
WerrorS("No local ordering possible for shift algebra");
return(NULL);
}
ideal r;
BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
BOOLEAN delete_w=(w==NULL);
kStrategy strat=new skStrategy;
strat->rightGB = rightGB;
if(!TEST_OPT_RETURN_SB)
strat->syzComp = syzComp;
if (TEST_OPT_SB_1)
if(!rField_is_Ring(currRing))
strat->newIdeal = newIdeal;
if (rField_has_simple_inverse(currRing))
strat->LazyPass=20;
else
strat->LazyPass=2;
strat->LazyDegree = 1;
strat->ak = 0;
if (id_IsModule(F,currRing)) strat->ak = id_RankFreeModule(F,currRing);
strat->kModW=kModW=NULL;
strat->kHomW=kHomW=NULL;
if (vw != NULL)
{
currRing->pLexOrder=FALSE;
strat->kHomW=kHomW=vw;
strat->pOrigFDeg = currRing->pFDeg;
strat->pOrigLDeg = currRing->pLDeg;
pSetDegProcs(currRing,kHomModDeg);
toReset = TRUE;
}
if (h==testHomog)
{
if (strat->ak == 0)
{
h = (tHomog)idHomIdeal(F,Q);
w=NULL;
}
else if (!TEST_OPT_DEGBOUND)
{
if (w!=NULL)
h = (tHomog)idHomModule(F,Q,w);
else
h = (tHomog)idHomIdeal(F,Q);
}
}
currRing->pLexOrder=b;
if (h==isHomog)
{
if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
{
strat->kModW = kModW = *w;
if (vw == NULL)
{
strat->pOrigFDeg = currRing->pFDeg;
strat->pOrigLDeg = currRing->pLDeg;
pSetDegProcs(currRing,kModDeg);
toReset = TRUE;
}
}
currRing->pLexOrder = TRUE;
if (hilb==NULL) strat->LazyPass*=2;
}
strat->homog=h;
#ifdef KDEBUG
idTest(F);
#endif
/* global ordering */
if (w!=NULL)
r=bbaShift(F,Q,*w,hilb,strat);
else
r=bbaShift(F,Q,NULL,hilb,strat);
#ifdef KDEBUG
idTest(r);
#endif
if (toReset)
{
kModW = NULL;
pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
}
currRing->pLexOrder = b;
//Print("%d reductions canceled \n",strat->cel);
delete(strat);
if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
assume(idIsInV(r));
return r;
}
skStrategy::rightGB
char rightGB
Definition kutil.h:366
bbaShift
ideal bbaShift(ideal F, ideal Q, intvec *w, bigintmat *hilb, kStrategy strat)
Definition kstd2.cc:4577
idIsInV
#define idIsInV(I)
Definition shiftop.h:49

## kTryHC()

poly kTryHC | ( | ideal | F,
|  | ideal | Q )

Definition at line 38 of file kstdhelper.cc.

{
if (Q!=NULL)
return NULL;
int prim=kFindLuckyPrime(F,Q);
if (TEST_OPT_PROT) Print("try HC in ring over ZZ/%d\n",prim);
// create Zp_ring
ring save_ring=currRing;
ring Zp_ring=rCopy0(save_ring);
nKillChar(Zp_ring->cf);
Zp_ring->cf=nInitChar(n_Zp, (void*)(long)prim);
rComplete(Zp_ring);
// map data
rChangeCurrRing(Zp_ring);
nMapFunc nMap=n_SetMap(save_ring->cf,Zp_ring->cf);
if (nMap==NULL) return NULL;
ideal FF=id_PermIdeal(F,1,IDELEMS(F),NULL,save_ring,Zp_ring,nMap,NULL,0,0);
ideal QQ=NULL;
if (Q!=NULL) QQ=id_PermIdeal(Q,1,IDELEMS(Q),NULL,save_ring,Zp_ring,nMap,NULL,0,0);
// call std
kStrategy strat=new skStrategy;
strat->LazyPass=20;
strat->LazyDegree = 1;
strat->kModW=kModW=NULL;
strat->kHomW=kHomW=NULL;
strat->homog = (tHomog)idHomIdeal(F,Q);
ideal res=mora(FF,QQ,NULL,NULL,strat);
// clean
idDelete(&FF);
poly HC=NULL;
if (strat->kNoether!=NULL) scComputeHC(res,QQ,0,HC);
delete strat;
if (QQ!=NULL) idDelete(&QQ);
idDelete(&res);
// map back
rChangeCurrRing(save_ring);
if (HC!=NULL)
{
//p_IncrExp(HC,Zp_ring->N,Zp_ring);
for (int i=rVar(Zp_ring)-1; i>0; i--)
{
int e;
if ((e=pGetExp(HC, i)) > 0) pSetExp(HC,i,e-1);
}
p_Setm(HC,Zp_ring);
if (TEST_OPT_PROT) Print("HC(%ld) found\n",pTotaldegree(HC));
pSetCoeff0(HC,nInit(1));
}
else
{
if (TEST_OPT_PROT) PrintS("HC not found\n");
}
rDelete(Zp_ring);
return HC;
}
n_Zp
@ n_Zp
\F{p < 2^31}
Definition coeffs.h:29
n_SetMap
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition coeffs.h:703
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
nMapFunc
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition coeffs.h:80
nKillChar
void nKillChar(coeffs r)
undo all initialisations
Definition numbers.cc:563
scComputeHC
void scComputeHC(ideal S, ideal Q, int ak, poly &hEdge)
Definition hdegree.cc:1074
kFindLuckyPrime
static int kFindLuckyPrime(ideal F, ideal Q)
Definition kstdhelper.cc:31
pSetCoeff0
#define pSetCoeff0(p, n)
Definition monomials.h:59
nInit
#define nInit(i)
Definition numbers.h:24
pTotaldegree
static long pTotaldegree(poly p)
Definition polys.h:283
pGetExp
#define pGetExp(p, i)
Exponent.
Definition polys.h:42
rComplete
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...
Definition ring.cc:3527
rCopy0
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition ring.cc:1427
rVar
static short rVar(const ring r)
define rVar(r) (r->N)
Definition ring.h:598
id_PermIdeal
ideal id_PermIdeal(ideal I, int R, int C, const int *perm, const ring src, const ring dst, nMapFunc nMap, const int *par_perm, int P, BOOLEAN use_mult)
mapping ideals/matrices to other rings
Definition simpleideals.cc:2219

## kTryHilbstd()

ideal kTryHilbstd | ( | ideal | F,
|  | ideal | Q )

Definition at line 323 of file kstdhelper.cc.

{
if (rField_is_Ring(currRing)) return NULL;
if(!TEST_V_PURE_GB)
{
tHomog h = (tHomog)id_HomIdealDP(F,Q,currRing);
if (h==(tHomog)TRUE) return kTryHilbstd_homog(F,Q);
if((!rField_is_Q(currRing))
&&(!rField_is_Zp(currRing))
) return NULL;
if (h==(tHomog)FALSE) return kTryHilbstd_nonhomog(F,Q);
}
return NULL;
}
kTryHilbstd_nonhomog
static ideal kTryHilbstd_nonhomog(ideal F, ideal Q)
Definition kstdhelper.cc:175
kTryHilbstd_homog
static ideal kTryHilbstd_homog(ideal F, ideal Q)
Definition kstdhelper.cc:113
TEST_V_PURE_GB
#define TEST_V_PURE_GB
Definition options.h:137
rField_is_Zp
static BOOLEAN rField_is_Zp(const ring r)
Definition ring.h:506
id_HomIdealDP
BOOLEAN id_HomIdealDP(ideal id, ideal Q, const ring r)
Definition simpleideals.cc:1059

## kTryHilbstd_par()

ideal kTryHilbstd_par | ( | ideal | F,
|  | ideal | Q,
|  | tHomog | h,
|  | intvec ** | mw )

Definition at line 338 of file kstdhelper.cc.

{
int cpus = (long) feOptValue(FE_OPT_CPUS);
if (cpus<1)
{
//WerrorS("no sub-processes allowed");
return NULL;
}
#if 0
if(!TEST_V_PURE_GB)
{
int cp_std[2];
int cp_hstd[2];
int err1=pipe(cp_std);// [0] is read , [1] is write
int err2=pipe(cp_hstd);
if (err1||err2)
{
Werror("pipe failed with %d\n",errno);
si_close(cp_std[0]);
si_close(cp_std[1]);
si_close(cp_hstd[0]);
si_close(cp_hstd[1]);
return NULL;
}
pid_t pid_std=fork();
if (pid_std==0) /*child std*/
{
si_set_signal(SIGTERM,sig_term_hdl_child);
si_close(cp_std[0]);
si_close(cp_hstd[0]);
si_close(cp_hstd[1]);
ssiInfo d;
memset(&d,0,sizeof(d));
d.f_write=fdopen(cp_std[1],"w");
d.fd_write=cp_std[1];
d.r=currRing;
si_opt_2|=Sy_bit(V_PURE_GB);
ideal res=kStd_internal(F,Q,h,mw);
ssiWriteIdeal(&d,IDEAL_CMD,res);
fclose(d.f_write);
_exit(0);
}
pid_t pid_hstd=fork();
if (pid_hstd==0) /*child hstd*/
{
si_set_signal(SIGTERM,sig_term_hdl_child);
si_close(cp_hstd[0]);
si_close(cp_std[0]);
si_close(cp_std[1]);
ssiInfo d;
memset(&d,0,sizeof(d));
d.f_write=fdopen(cp_hstd[1],"w");
d.fd_write=cp_hstd[1];
d.r=currRing;
si_opt_2|=Sy_bit(V_PURE_GB);
ideal res=kTryHilbstd(F,Q);
if (res!=NULL)
{
ssiWriteIdeal(&d,IDEAL_CMD,res);
}
fclose(d.f_write);
_exit(0);
}
/*parent*/
si_close(cp_std[1]);
si_close(cp_hstd[1]);
#ifdef HAVE_POLL
pollfd pfd[2];
pfd[0].fd=cp_std[0];
pfd[0].events=POLLIN;
pfd[1].fd=cp_hstd[0];
pfd[1].events=POLLIN;
int s=si_poll(pfd,2,-1); // wait infinite
ideal res;
ssiInfo d;
memset(&d,0,sizeof(d));
d.r=currRing;
if (s==1) //std
{
d.f_read=s_open(cp_std[0]);
d.fd_read=cp_std[0];
res=ssiReadIdeal(&d);
si_close(cp_hstd[0]);
s_close(d.f_read);
si_close(cp_std[0]);
kill(pid_hstd,SIGTERM);
si_waitpid(pid_std,NULL,0);
si_waitpid(pid_hstd,NULL,0);
}
else if(s==2)
{
d.f_read=s_open(cp_hstd[0]);
d.fd_read=cp_hstd[0];
res=ssiReadIdeal(&d);
si_close(cp_std[0]);
s_close(d.f_read);
si_close(cp_hstd[0]);
kill(pid_std,SIGTERM);
si_waitpid(pid_hstd,NULL,0);
si_waitpid(pid_std,NULL,0);
}
return res;
#endif
}
#endif
return NULL;
}
si_set_signal
si_hdl_typ si_set_signal(int sig, si_hdl_typ signal_handler)
meta function for binding a signal to an handler
Definition cntrlc.cc:121
sig_term_hdl_child
void sig_term_hdl_child(int)
Definition cntrlc.cc:86
s
const CanonicalForm int s
Definition facAbsFact.cc:51
feOptValue
static void * feOptValue(feOptIndex opt)
Definition feOpt.h:40
IDEAL_CMD
@ IDEAL_CMD
Definition grammar.cc:285
kTryHilbstd
ideal kTryHilbstd(ideal F, ideal Q)
Definition kstdhelper.cc:323
si_opt_2
VAR unsigned si_opt_2
Definition options.c:6
V_PURE_GB
#define V_PURE_GB
Definition options.h:71
s_open
s_buff s_open(int fd)
Definition s_buff.cc:32
s_close
int s_close(s_buff &F)
Definition s_buff.cc:46
ssiInfo::fd_write
int fd_write
Definition s_buff.h:26
ssiInfo::f_read
s_buff f_read
Definition s_buff.h:22
ssiInfo::f_write
FILE * f_write
Definition s_buff.h:23
ssiInfo::r
ring r
Definition s_buff.h:24
ssiInfo::fd_read
int fd_read
Definition s_buff.h:26
ssiInfo
Definition s_buff.h:21
ssiReadIdeal
ideal ssiReadIdeal(ssiInfo *d)
Definition ssiLink.cc:1319
ssiWriteIdeal
void ssiWriteIdeal(const ssiInfo *d, int typ, const ideal I)
Definition ssiLink.cc:612

## kVerify()

BOOLEAN kVerify | ( | ideal | F,
|  | ideal | Q )

Definition at line 367 of file kverify.cc.

{
#ifdef HAVE_VSPACE
int cpus = (long) feOptValue(FE_OPT_CPUS);
if (cpus>1)
return kVerify2(F,currRing->qideal);
else
#endif
return kVerify1(F,currRing->qideal);
}
kVerify2
BOOLEAN kVerify2(ideal F, ideal Q)
Definition kverify.cc:141
kVerify1
BOOLEAN kVerify1(ideal F, ideal Q)
Definition kverify.cc:24

## mora()

ideal mora | ( | ideal | F,
|  | ideal | Q,
|  | intvec * | w,
|  | bigintmat * | hilb,
|  | kStrategy | strat )

Definition at line 1887 of file kstd1.cc.

{
int olddeg = 0;
int reduc = 0;
int red_result = 1;
int hilbeledeg=1,hilbcount=0;
BITSET save1;
SI_SAVE_OPT1(save1);
if (rHasMixedOrdering(currRing))
{
si_opt_1 &= ~Sy_bit(OPT_REDSB);
si_opt_1 &= ~Sy_bit(OPT_REDTAIL);
}
strat->update = TRUE;
/*- setting global variables ------------------- -*/
initBuchMoraCrit(strat);
initHilbCrit(F,Q,&hilb,strat);
initMora(F,strat);
if(rField_is_Ring(currRing))
initBuchMoraPosRing(strat);
else
initBuchMoraPos(strat);
/*Shdl=*/initBuchMora(F,Q,strat);
if (TEST_OPT_FASTHC) missingAxis(&strat->lastAxis,strat);
/*updateS in initBuchMora has Hecketest
* and could have put strat->kHEdgdeFound FALSE*/
if (TEST_OPT_FASTHC && (strat->lastAxis) && strat->posInLOldFlag)
{
strat->posInLOld = strat->posInL;
strat->posInLOldFlag = FALSE;
strat->posInL = posInL10;
updateL(FALSE,strat);
reorderL(strat);
}
kTest_TS(strat);
strat->use_buckets = kMoraUseBucket(strat);
#ifdef HAVE_TAIL_RING
if (strat->homog && strat->red == redFirst)
if(!idIs0(F) &&(!rField_is_Ring(currRing)))
kStratInitChangeTailRing(strat);
#endif
if (BVERBOSE(23)) kDebugPrint(strat);
/*- compute-------------------------------------------*/
while (strat->Ll >= 0)
{
#ifdef KDEBUG
if (TEST_OPT_DEBUG) messageSets(strat);
#endif
if (siCntrlc)
{
while (strat->Ll >= 0)
deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
strat->noClearS=TRUE;
}
if (TEST_OPT_DEGBOUND
&& (strat->L[strat->Ll].ecart+strat->L[strat->Ll].GetpFDeg()> Kstd1_deg))
{
/*
* stops computation if
* - 24 (degBound)
* && upper degree is bigger than Kstd1_deg
*/
while ((strat->Ll >= 0)
&& (strat->L[strat->Ll].p1!=NULL) && (strat->L[strat->Ll].p2!=NULL)
&& (strat->L[strat->Ll].ecart+strat->L[strat->Ll].GetpFDeg()> Kstd1_deg)
)
{
deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
//if (TEST_OPT_PROT)
//{
// PrintS("D"); mflush();
//}
}
if (strat->Ll<0) break;
else strat->noClearS=TRUE;
}
strat->P = strat->L[strat->Ll];/*- picks the last element from the lazyset L -*/
if (strat->Ll==0) strat->interpt=TRUE;
strat->Ll--;
// create the real Spoly
if (pNext(strat->P.p) == strat->tail)
{
/*- deletes the short spoly and computes -*/
if (rField_is_Ring(currRing))
pLmDelete(strat->P.p);
else
pLmFree(strat->P.p);
strat->P.p = NULL;
poly m1 = NULL, m2 = NULL;
// check that spoly creation is ok
while (strat->tailRing != currRing &&
!kCheckSpolyCreation(&(strat->P), strat, m1, m2))
{
assume(m1 == NULL && m2 == NULL);
// if not, change to a ring where exponents are large enough
kStratChangeTailRing(strat);
}
/* create the real one */
ksCreateSpoly(&(strat->P), strat->kNoetherTail(), strat->use_buckets,
strat->tailRing, m1, m2, strat->R);
if (!strat->use_buckets)
strat->P.SetLength(strat->length_pLength);
strat->P.PrepareRed(strat->use_buckets);
}
else if (strat->P.p1 == NULL)
{
// for input polys, prepare reduction (buckets !)
strat->P.SetLength(strat->length_pLength);
strat->P.PrepareRed(strat->use_buckets);
}
// the s-poly
if (!strat->P.IsNull())
{
// might be NULL from noether !!!
if (TEST_OPT_PROT)
message(strat->P.ecart+strat->P.GetpFDeg(),&olddeg,&reduc,strat, red_result);
// reduce
red_result = strat->red(&strat->P,strat);
}
// the reduced s-poly
if (! strat->P.IsNull())
{
strat->P.GetP();
// statistics
if (TEST_OPT_PROT) PrintS("s");
// normalization
if (TEST_OPT_INTSTRATEGY)
strat->P.pCleardenom();
else
strat->P.pNorm();
// tailreduction
strat->P.p = redtail(&(strat->P),strat->sl,strat);
if (strat->P.p==NULL)
{
WerrorS("exponent overflow - wrong ordering");
return(idInit(1,1));
}
// set ecart -- might have changed because of tail reductions
if ((!strat->noTailReduction) && (!strat->honey))
strat->initEcart(&strat->P);
// cancel unit
cancelunit(&strat->P);
// for char 0, clear denominators
if ((strat->P.p->next==NULL) /* i.e. cancelunit did something*/
&& TEST_OPT_INTSTRATEGY)
strat->P.pCleardenom();
strat->P.SetShortExpVector();
enterT(&strat->P,strat);
// build new pairs
if (rField_is_Ring(currRing))
superenterpairs(strat->P.p,strat->sl,strat->P.ecart,0,strat, strat->tl);
else
enterpairs(strat->P.p,strat->sl,strat->P.ecart,0,strat, strat->tl);
// put in S
strat->enterS(&strat->P,
posInS(strat,strat->sl,strat->P.p, strat->P.ecart),
strat, strat->tl);
// apply hilbert criterion
if (hilb!=NULL)
{
if (strat->homog==isHomog)
khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
else
khCheckLocInhom(Q,w,hilb,hilbcount,strat);
}
// clear strat->P
kDeleteLcm(&strat->P);
#ifdef KDEBUG
// make sure kTest_TS does not complain about strat->P
strat->P.Clear();
#endif
}
if (strat->kAllAxis)
{
if ((TEST_OPT_FINDET)
|| ((TEST_OPT_MULTBOUND) && (scMult0Int(strat->Shdl,NULL) < Kstd1_mu)))
{
// obachman: is this still used ???
/*
* stops computation if strat->kAllAxis and
* - 27 (finiteDeterminacyTest)
* or
* - 23
* (multBound)
* && multiplicity of the ideal is smaller then a predefined number mu
*/
while (strat->Ll >= 0) deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
}
}
kTest_TS(strat);
}
/*- complete reduction of the standard basis------------------------ -*/
if (TEST_OPT_REDSB) completeReduce(strat);
else if (TEST_OPT_PROT) PrintLn();
/*- release temp data------------------------------- -*/
exitBuchMora(strat);
/*- polynomials used for HECKE: HC, noether -*/
if (TEST_OPT_FINDET)
{
if (strat->kNoether!=NULL)
Kstd1_mu=currRing->pFDeg(strat->kNoether,currRing);
else
Kstd1_mu=-1;
}
omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
if ((TEST_OPT_PROT)||(TEST_OPT_DEBUG)) messageStat(hilbcount,strat);
// if (TEST_OPT_WEIGHTM)
// {
// pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
// if (ecartWeights)
// {
// omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
// ecartWeights=NULL;
// }
// }
if(nCoeff_is_Z(currRing->cf))
finalReduceByMon(strat);
if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
SI_RESTORE_OPT1(save1);
idTest(strat->Shdl);
return (strat->Shdl);
}
skStrategy::kNoetherTail
KINLINE poly kNoetherTail()
Definition kInline.h:66
skStrategy::lastAxis
int lastAxis
Definition kutil.h:354
skStrategy::tail
poly tail
Definition kutil.h:333
skStrategy::noClearS
char noClearS
Definition kutil.h:399
skStrategy::length_pLength
char length_pLength
Definition kutil.h:384
skStrategy::update
char update
Definition kutil.h:378
scMult0Int
long scMult0Int(ideal S, ideal Q)
Definition hdegree.cc:924
khCheck
void khCheck(ideal Q, intvec *w, bigintmat *hilb, int &eledeg, int &count, kStrategy strat)
Definition khstd.cc:28
khCheckLocInhom
void khCheckLocInhom(ideal Q, intvec *w, bigintmat *hilb, int &count, kStrategy strat)
Definition khstd.cc:248
ksCreateSpoly
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
Definition kspoly.cc:1203
updateL
static void updateL(BOOLEAN searchPP, kStrategy strat)
Definition kstd1.cc:1394
missingAxis
static void missingAxis(int *last, kStrategy strat)
Definition kstd1.cc:1279
posInL10
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
Definition kstd1.cc:1360
kMoraUseBucket
static BOOLEAN kMoraUseBucket(kStrategy strat)
Definition kstd1.cc:3878
reorderL
static void reorderL(kStrategy strat)
Definition kstd1.cc:1222
Kstd1_mu
EXTERN_VAR int Kstd1_mu
Definition kstd1.h:70
enterpairs
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
Definition kutil.cc:4487
kStratChangeTailRing
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject *T, unsigned long expbound)
Definition kutil.cc:10939
kCheckSpolyCreation
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
Definition kutil.cc:10459
superenterpairs
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
Definition kutil.cc:4457
deleteInL
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition kutil.cc:1208
messageStat
void messageStat(int hilbcount, kStrategy strat)
Definition kutil.cc:7504
finalReduceByMon
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
Definition kutil.cc:10847
cancelunit
void cancelunit(LObject *L, BOOLEAN inNF)
Definition kutil.cc:365
initHilbCrit
void initHilbCrit(ideal, ideal, bigintmat **hilb, kStrategy strat)
Definition kutil.cc:9417
siCntrlc
VAR BOOLEAN siCntrlc
Definition options.c:14
TEST_OPT_FINDET
#define TEST_OPT_FINDET
Definition options.h:113
OPT_REDSB
#define OPT_REDSB
Definition options.h:77
TEST_OPT_MULTBOUND
#define TEST_OPT_MULTBOUND
Definition options.h:116
TEST_OPT_FASTHC
#define TEST_OPT_FASTHC
Definition options.h:111
rHasMixedOrdering
static BOOLEAN rHasMixedOrdering(const ring r)
Definition ring.h:770

## rightgb()

ideal rightgb | ( | ideal | F,
|  | const ideal | Q )

Definition at line 4935 of file kstd2.cc.

{
assume(rIsLPRing(currRing));
assume(idIsInV(F));
ideal RS = kStdShift(F, Q, testHomog, NULL, NULL, 0, 0, NULL, TRUE);
idSkipZeroes(RS); // is this even necessary?
assume(idIsInV(RS));
return(RS);
}

## stdred()

ideal stdred | ( | ideal | F,
|  | ideal | Q,
|  | tHomog | h,
|  | intvec ** | w )

## Variable Documentation

## kHomW

EXTERN_VAR intvec* kHomW

Definition at line 95 of file kstd1.h.

## kModW

EXTERN_VAR intvec* kModW

Definition at line 94 of file kstd1.h.

## kOptions

EXTERN_VAR BITSET kOptions

Definition at line 72 of file kstd1.h.

## Kstd1_deg

EXTERN_VAR int Kstd1_deg

Definition at line 70 of file kstd1.h.

## Kstd1_mu

EXTERN_VAR int Kstd1_mu

Definition at line 70 of file kstd1.h.

## validOpts

EXTERN_VAR BITSET validOpts

Definition at line 74 of file kstd1.h.