Macros | Typedefs | Functions | Variables
kstd1.h File Reference
#include <kernel/structs.h>
#include <polys/monomials/ring.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
 

Typedefs

typedef BOOLEAN(* s_poly_proc_t) (kStrategy strat)
 

Functions

ideal mora (ideal F, ideal Q, intvec *w, intvec *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 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. More...
 
ideal kSba (ideal F, ideal Q, tHomog h, intvec **mw, int incremental=0, int arri=0, intvec *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)
 
ideal kStdShift (ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, int uptodeg, int lVblock)
 
void initMora (ideal F, kStrategy strat)
 
ideal kInterRed (ideal F, ideal Q=NULL)
 
ideal kInterRedOld (ideal F, ideal Q=NULL)
 
long kModDeg (poly p, ring r=currRing)
 
long kHomModDeg (poly p, ring r=currRing)
 
ideal stdred (ideal F, ideal Q, tHomog h, intvec **w)
 
ideal kMin_std (ideal F, ideal Q, tHomog h, intvec **w, ideal &M, intvec *hilb=NULL, int syzComp=0, int reduced=0)
 

Variables

int LazyPass
 
int LazyDegree
 
int Kstd1_mu
 
int Kstd1_deg
 
BITSET kOptions
 
BITSET validOpts
 
intveckModW
 
intveckHomW
 

Macro Definition Documentation

#define KSTD_NF_ECART   2

Definition at line 19 of file kstd1.h.

#define KSTD_NF_LAZY   1

Definition at line 17 of file kstd1.h.

#define KSTD_NF_NONORM   4

Definition at line 21 of file kstd1.h.

Typedef Documentation

typedef BOOLEAN(* s_poly_proc_t) (kStrategy strat)

Definition at line 14 of file kstd1.h.

Function Documentation

void initMora ( ideal  F,
kStrategy  strat 
)

Definition at line 1512 of file kstd1.cc.

1513 {
1514  int i,j;
1515 
1516  strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN));
1517  for (j=(currRing->N); j>0; j--) strat->NotUsedAxis[j] = TRUE;
1518  strat->enterS = enterSMora;
1519  strat->initEcartPair = initEcartPairMora; /*- ecart approximation -*/
1520  strat->posInLOld = strat->posInL;
1521  strat->posInLOldFlag = TRUE;
1522  strat->initEcart = initEcartNormal;
1523  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
1524  if ( strat->kHEdgeFound )
1525  strat->kNoether = pCopy((currRing->ppNoether));
1526  else if (strat->kHEdgeFound || strat->homog)
1527  strat->red = redFirst; /*take the first possible in T*/
1528  else
1529  strat->red = redEcart;/*take the first possible in under ecart-restriction*/
1530  if (strat->kHEdgeFound)
1531  {
1532  strat->HCord = currRing->pFDeg((currRing->ppNoether),currRing)+1;
1533  strat->posInT = posInT2;
1534  }
1535  else
1536  {
1537  strat->HCord = 32000;/*- very large -*/
1538  }
1539 
1540 #ifdef HAVE_RINGS
1541  if (rField_is_Ring(currRing))
1542  strat->red = redRiloc;
1543 #endif
1544 
1545  /*reads the ecartWeights used for Graebes method from the
1546  *intvec ecart and set ecartWeights
1547  */
1548  if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
1549  {
1550  //interred machen Aenderung
1551  strat->pOrigFDeg=currRing->pFDeg;
1552  strat->pOrigLDeg=currRing->pLDeg;
1553  ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
1554  /*uses automatic computation of the ecartWeights to set them*/
1556 
1558  if (TEST_OPT_PROT)
1559  {
1560  for(i=1; i<=(currRing->N); i++)
1561  Print(" %d",ecartWeights[i]);
1562  PrintLn();
1563  mflush();
1564  }
1565  }
1566  kOptimizeLDeg(currRing->pLDeg, strat);
1567 }
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.h:280
void PrintLn()
Definition: reporter.cc:327
int posInT2(const TSet set, const int length, LObject &p)
Definition: kutil.cc:4341
#define Print
Definition: emacs.cc:83
int redEcart(LObject *h, kStrategy strat)
Definition: kstd1.cc:179
#define TEST_OPT_PROT
Definition: options.h:98
void kEcartWeights(poly *s, int sl, short *eweight, const ring R)
Definition: weight.cc:190
long totaldegreeWecart(poly p, ring r)
Definition: weight.cc:225
short * ecartWeights
Definition: weight0.c:32
int redFirst(LObject *h, kStrategy strat)
Definition: kstd1.cc:613
BOOLEAN * NotUsedAxis
Definition: kutil.h:330
poly kNoether
Definition: kutil.h:326
#define TRUE
Definition: auxiliary.h:144
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
Definition: kutil.h:283
int(* red)(LObject *L, kStrategy strat)
Definition: kutil.h:274
#define omAlloc(size)
Definition: omAllocDecl.h:210
int(* posInT)(const TSet T, const int tl, LObject &h)
Definition: kutil.h:277
int HCord
Definition: kutil.h:353
#define mflush()
Definition: reporter.h:55
pFDegProc pOrigFDeg
Definition: kutil.h:292
int redRiloc(LObject *h, kStrategy strat)
Definition: kstd1.cc:355
void(* initEcart)(TObject *L)
Definition: kutil.h:276
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
pLDegProc pOrigLDeg
Definition: kutil.h:293
BOOLEAN homog
Definition: kutil.h:362
void initEcartPairMora(LObject *Lp, poly, poly, int ecartF, int ecartG)
Definition: kutil.cc:1157
int j
Definition: myNF.cc:70
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition: p_polys.cc:3481
void enterSMora(LObject &p, int atS, kStrategy strat, int atR=-1)
Definition: kstd1.cc:1324
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
Definition: kutil.h:282
int i
Definition: cfEzgcd.cc:123
static void kOptimizeLDeg(pLDegProc ldeg, kStrategy strat)
Definition: kstd1.cc:110
int(* posInLOld)(const LSet Ls, const int Ll, LObject *Lo, const kStrategy strat)
Definition: kutil.h:284
#define IDELEMS(i)
Definition: simpleideals.h:24
BOOLEAN kHEdgeFound
Definition: kutil.h:366
#define TEST_OPT_WEIGHTM
Definition: options.h:115
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
BOOLEAN posInLOldFlag
Definition: kutil.h:372
long maxdegreeWecart(poly p, int *l, ring r)
Definition: weight.cc:255
void initEcartNormal(TObject *h)
Definition: kutil.cc:1135
int BOOLEAN
Definition: auxiliary.h:131
#define pCopy(p)
return a copy of the poly
Definition: polys.h:156
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 2915 of file kstd1.cc.

2916 {
2917  const ring save = currRing;
2918  if( currRing != _currRing ) rChangeCurrRing(_currRing);
2919  poly ret = kNF(F, Q, p, syzComp, lazyReduce);
2920  if( currRing != save ) rChangeCurrRing(save);
2921  return ret;
2922 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2815
return P p
Definition: myNF.cc:203
#define Q
Definition: sirandom.c:25
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int syzComp
Definition: myNF.cc:291
void rChangeCurrRing(ring r)
Definition: polys.cc:14
polyrec * poly
Definition: hilb.h:10
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int int lazyReduce
Definition: myNF.cc:292
long kHomModDeg ( poly  p,
ring  r = currRing 
)

Definition at line 2208 of file kstd1.cc.

2209 {
2210  int i;
2211  long j=0;
2212 
2213  for (i=r->N;i>0;i--)
2214  j+=p_GetExp(p,i,r)*(*kHomW)[i-1];
2215  if (kModW == NULL) return j;
2216  i = p_GetComp(p,r);
2217  if (i==0) return j;
2218  return j+(*kModW)[i-1];
2219 }
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
const ring r
Definition: syzextra.cc:208
intvec * kModW
Definition: kstd1.cc:2196
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
Definition: p_polys.h:465
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
ideal kInterRed ( ideal  F,
ideal  Q = NULL 
)

Definition at line 3277 of file kstd1.cc.

3278 {
3279 #ifdef HAVE_PLURAL
3280  if(rIsPluralRing(currRing)) return kInterRedOld(F,Q);
3281 #endif
3283  #ifdef HAVE_RINGS
3285  #endif
3286  )
3287  return kInterRedOld(F,Q);
3288 
3289  //return kInterRedOld(F,Q);
3290 
3291  BITSET save1;
3292  SI_SAVE_OPT1(save1);
3293  //si_opt_1|=Sy_bit(OPT_NOT_SUGAR);
3295  //si_opt_1&= ~Sy_bit(OPT_REDTAIL);
3296  //si_opt_1&= ~Sy_bit(OPT_REDSB);
3297  //extern char * showOption() ;
3298  //Print("%s\n",showOption());
3299 
3300  int need_retry;
3301  int counter=3;
3302  ideal res, res1;
3303  int elems;
3304  ideal null=NULL;
3305  if ((Q==NULL) || (!TEST_OPT_REDSB))
3306  {
3307  elems=idElem(F);
3308  res=kInterRedBba(F,Q,need_retry);
3309  }
3310  else
3311  {
3312  ideal FF=idSimpleAdd(F,Q);
3313  res=kInterRedBba(FF,NULL,need_retry);
3314  idDelete(&FF);
3315  null=idInit(1,1);
3316  if (need_retry)
3317  res1=kNF(null,Q,res,0,KSTD_NF_LAZY);
3318  else
3319  res1=kNF(null,Q,res);
3320  idDelete(&res);
3321  res=res1;
3322  need_retry=1;
3323  }
3324  if (idElem(res)<=1) need_retry=0;
3325  while (need_retry && (counter>0))
3326  {
3327  #ifdef KDEBUG
3328  if (TEST_OPT_DEBUG) { Print("retry counter %d\n",counter); }
3329  #endif
3330  res1=kInterRedBba(res,Q,need_retry);
3331  int new_elems=idElem(res1);
3332  counter -= (new_elems >= elems);
3333  elems = new_elems;
3334  idDelete(&res);
3335  if (idElem(res1)<=1) need_retry=0;
3336  if ((Q!=NULL) && (TEST_OPT_REDSB))
3337  {
3338  if (need_retry)
3339  res=kNF(null,Q,res1,0,KSTD_NF_LAZY);
3340  else
3341  res=kNF(null,Q,res1);
3342  idDelete(&res1);
3343  }
3344  else
3345  res = res1;
3346  if (idElem(res)<=1) need_retry=0;
3347  }
3348  if (null!=NULL) idDelete(&null);
3349  SI_RESTORE_OPT1(save1);
3350  idSkipZeroes(res);
3351  return res;
3352 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:753
unsigned si_opt_1
Definition: options.c:5
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2815
#define Print
Definition: emacs.cc:83
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define idSimpleAdd(A, B)
Definition: ideals.h:55
#define TEST_OPT_REDSB
Definition: options.h:99
#define SI_SAVE_OPT1(A)
Definition: options.h:20
#define TEST_OPT_DEBUG
Definition: options.h:103
#define Q
Definition: sirandom.c:25
#define BITSET
Definition: structs.h:17
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
#define Sy_bit(x)
Definition: options.h:30
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
ideal kInterRedBba(ideal F, ideal Q, int &need_retry)
Definition: kstd1.cc:3019
#define KSTD_NF_LAZY
Definition: kstd1.h:17
ideal kInterRedOld(ideal F, ideal Q)
Definition: kstd1.cc:2928
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
#define OPT_REDTHROUGH
Definition: options.h:77
int idElem(const ideal F)
count non-zero elements
#define SI_RESTORE_OPT1(A)
Definition: options.h:23
static BOOLEAN rField_is_numeric(const ring r)
Definition: ring.h:464
ideal kInterRedOld ( ideal  F,
ideal  Q = NULL 
)

Definition at line 2928 of file kstd1.cc.

2929 {
2930  int j;
2931  kStrategy strat = new skStrategy;
2932 
2933  ideal tempF = F;
2934  ideal tempQ = Q;
2935 
2936 #ifdef HAVE_PLURAL
2937  if(rIsSCA(currRing))
2938  {
2939  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
2940  const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
2941  tempF = id_KillSquares(F, m_iFirstAltVar, m_iLastAltVar, currRing);
2942 
2943  // this should be done on the upper level!!! :
2944  // tempQ = SCAQuotient(currRing);
2945 
2946  if(Q == currRing->qideal)
2947  tempQ = SCAQuotient(currRing);
2948  }
2949 #endif
2950 
2951 // if (TEST_OPT_PROT)
2952 // {
2953 // writeTime("start InterRed:");
2954 // mflush();
2955 // }
2956  //strat->syzComp = 0;
2957  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
2958  strat->kNoether=pCopy((currRing->ppNoether));
2959  strat->ak = id_RankFreeModule(tempF,currRing);
2960  initBuchMoraCrit(strat);
2961  strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN));
2962  for (j=(currRing->N); j>0; j--) strat->NotUsedAxis[j] = TRUE;
2963  strat->enterS = enterSBba;
2964  strat->posInT = posInT17;
2965  strat->initEcart = initEcartNormal;
2966  strat->sl = -1;
2967  strat->tl = -1;
2968  strat->tmax = setmaxT;
2969  strat->T = initT();
2970  strat->R = initR();
2971  strat->sevT = initsevT();
2973  initS(tempF, tempQ, strat);
2974  if (TEST_OPT_REDSB)
2975  strat->noTailReduction=FALSE;
2976  updateS(TRUE,strat);
2978  completeReduce(strat);
2979  //else if (TEST_OPT_PROT) PrintLn();
2980  pDelete(&strat->kHEdge);
2981  omFreeSize((ADDRESS)strat->T,strat->tmax*sizeof(TObject));
2982  omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
2983  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
2984  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
2985  omfree(strat->sevT);
2986  omfree(strat->S_2_R);
2987  omfree(strat->R);
2988 
2989  if (strat->fromQ)
2990  {
2991  for (j=IDELEMS(strat->Shdl)-1;j>=0;j--)
2992  {
2993  if(strat->fromQ[j]) pDelete(&strat->Shdl->m[j]);
2994  }
2995  omFreeSize((ADDRESS)strat->fromQ,IDELEMS(strat->Shdl)*sizeof(int));
2996  }
2997 // if (TEST_OPT_PROT)
2998 // {
2999 // writeTime("end Interred:");
3000 // mflush();
3001 // }
3002  ideal shdl=strat->Shdl;
3003  idSkipZeroes(shdl);
3004  if (strat->fromQ)
3005  {
3006  strat->fromQ=NULL;
3007  ideal res=kInterRed(shdl,NULL);
3008  idDelete(&shdl);
3009  shdl=res;
3010  }
3011  delete(strat);
3012 #ifdef HAVE_PLURAL
3013  if( tempF != F )
3014  id_Delete( &tempF, currRing);
3015 #endif
3016  return shdl;
3017 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:753
ideal SCAQuotient(const ring r)
Definition: sca.h:10
KINLINE TObject ** initR()
Definition: kInline.h:92
BOOLEAN honey
Definition: kutil.h:367
KINLINE unsigned long * initsevT()
Definition: kInline.h:97
poly kHEdge
Definition: kutil.h:325
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
KINLINE TSet initT()
Definition: kInline.h:81
#define FALSE
Definition: auxiliary.h:140
BOOLEAN noTailReduction
Definition: kutil.h:368
int * S_2_R
Definition: kutil.h:340
BOOLEAN * NotUsedAxis
Definition: kutil.h:330
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
poly kNoether
Definition: kutil.h:326
int tl
Definition: kutil.h:348
#define TRUE
Definition: auxiliary.h:144
#define TEST_OPT_REDSB
Definition: options.h:99
unsigned long * sevT
Definition: kutil.h:321
void * ADDRESS
Definition: auxiliary.h:161
int ak
Definition: kutil.h:351
#define Q
Definition: sirandom.c:25
#define omAlloc(size)
Definition: omAllocDecl.h:210
int(* posInT)(const TSet T, const int tl, LObject &h)
Definition: kutil.h:277
poly res
Definition: myNF.cc:322
void(* initEcart)(TObject *L)
Definition: kutil.h:276
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void initS(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:6379
#define TEST_OPT_INTSTRATEGY
Definition: options.h:105
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define setmaxT
Definition: kutil.h:32
int j
Definition: myNF.cc:70
intset fromQ
Definition: kutil.h:317
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
Definition: kutil.h:282
#define omfree(addr)
Definition: omAllocDecl.h:237
ideal kInterRed(ideal F, ideal Q)
Definition: kstd1.cc:3277
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:8088
int posInT17(const TSet set, const int length, LObject &p)
Definition: kutil.cc:4676
TObject ** R
Definition: kutil.h:338
#define IDELEMS(i)
Definition: simpleideals.h:24
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static short scaFirstAltVar(ring r)
Definition: sca.h:18
int tmax
Definition: kutil.h:348
int int kStrategy strat
Definition: myNF.cc:68
BOOLEAN kHEdgeFound
Definition: kutil.h:366
intset ecartS
Definition: kutil.h:305
#define NULL
Definition: omList.c:10
ideal id_KillSquares(const ideal id, const short iFirstAltVar, const short iLastAltVar, const ring r, const bool bSkipZeroes)
Definition: sca.cc:1534
#define pDelete(p_ptr)
Definition: polys.h:157
static short scaLastAltVar(ring r)
Definition: sca.h:25
void updateS(BOOLEAN toT, kStrategy strat)
Definition: kutil.cc:7341
unsigned long * sevS
Definition: kutil.h:318
static bool rIsSCA(const ring r)
Definition: nc.h:206
void completeReduce(kStrategy strat, BOOLEAN withT)
Definition: kutil.cc:8797
int sl
Definition: kutil.h:346
TSet T
Definition: kutil.h:322
void initEcartNormal(TObject *h)
Definition: kutil.cc:1135
ideal Shdl
Definition: kutil.h:299
int BOOLEAN
Definition: auxiliary.h:131
class sTObject TObject
Definition: kutil.h:59
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
Definition: kutil.cc:7573
#define pCopy(p)
return a copy of the poly
Definition: polys.h:156
ideal kMin_std ( ideal  F,
ideal  Q,
tHomog  h,
intvec **  w,
ideal &  M,
intvec hilb = NULL,
int  syzComp = 0,
int  reduced = 0 
)

Definition at line 2664 of file kstd1.cc.

2666 {
2667  if(idIs0(F))
2668  {
2669  M=idInit(1,F->rank);
2670  return idInit(1,F->rank);
2671  }
2672  #ifdef HAVE_RINGS
2674  {
2675  ideal sb;
2676  sb = kStd(F, Q, h, w, hilb);
2677  idSkipZeroes(sb);
2678  if(IDELEMS(sb) <= IDELEMS(F))
2679  {
2680  M = idCopy(sb);
2681  idSkipZeroes(M);
2682  return(sb);
2683  }
2684  else
2685  {
2686  M = idCopy(F);
2687  idSkipZeroes(M);
2688  return(sb);
2689  }
2690  }
2691  #endif
2692  ideal r=NULL;
2693  int Kstd1_OldDeg = Kstd1_deg,i;
2694  intvec* temp_w=NULL;
2695  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
2696  BOOLEAN delete_w=(w==NULL);
2697  BOOLEAN oldDegBound=TEST_OPT_DEGBOUND;
2699 
2700  if(!TEST_OPT_RETURN_SB)
2701  strat->syzComp = syzComp;
2703  strat->LazyPass=20;
2704  else
2705  strat->LazyPass=2;
2706  strat->LazyDegree = 1;
2707  strat->minim=(reduced % 2)+1;
2708  strat->ak = id_RankFreeModule(F,currRing);
2709  if (delete_w)
2710  {
2711  temp_w=new intvec((strat->ak)+1);
2712  w = &temp_w;
2713  }
2714  if (h==testHomog)
2715  {
2716  if (strat->ak == 0)
2717  {
2718  h = (tHomog)idHomIdeal(F,Q);
2719  w=NULL;
2720  }
2721  else
2722  {
2723  h = (tHomog)idHomModule(F,Q,w);
2724  }
2725  }
2726  if (h==isHomog)
2727  {
2728  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2729  {
2730  kModW = *w;
2731  strat->kModW = *w;
2732  assume(currRing->pFDeg != NULL && currRing->pLDeg != NULL);
2733  strat->pOrigFDeg = currRing->pFDeg;
2734  strat->pOrigLDeg = currRing->pLDeg;
2736 
2737  toReset = TRUE;
2738  if (reduced>1)
2739  {
2740  Kstd1_OldDeg=Kstd1_deg;
2741  Kstd1_deg = -1;
2742  for (i=IDELEMS(F)-1;i>=0;i--)
2743  {
2744  if ((F->m[i]!=NULL) && (currRing->pFDeg(F->m[i],currRing)>=Kstd1_deg))
2745  Kstd1_deg = currRing->pFDeg(F->m[i],currRing)+1;
2746  }
2747  }
2748  }
2749  currRing->pLexOrder = TRUE;
2750  strat->LazyPass*=2;
2751  }
2752  strat->homog=h;
2754  {
2755  if (w!=NULL)
2756  r=mora(F,Q,*w,hilb,strat);
2757  else
2758  r=mora(F,Q,NULL,hilb,strat);
2759  }
2760  else
2761  {
2762  if (w!=NULL)
2763  r=bba(F,Q,*w,hilb,strat);
2764  else
2765  r=bba(F,Q,NULL,hilb,strat);
2766  }
2767 #ifdef KDEBUG
2768  {
2769  int i;
2770  for (i=IDELEMS(r)-1; i>=0; i--) pTest(r->m[i]);
2771  }
2772 #endif
2773  idSkipZeroes(r);
2774  if (toReset)
2775  {
2776  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2777  kModW = NULL;
2778  }
2779  currRing->pLexOrder = b;
2780  HCord=strat->HCord;
2781  if ((delete_w)&&(temp_w!=NULL)) delete temp_w;
2782  if ((IDELEMS(r)==1) && (r->m[0]!=NULL) && pIsConstant(r->m[0]) && (strat->ak==0))
2783  {
2784  M=idInit(1,F->rank);
2785  M->m[0]=pOne();
2786  //if (strat->ak!=0) { pSetComp(M->m[0],strat->ak); pSetmComp(M->m[0]); }
2787  if (strat->M!=NULL) idDelete(&strat->M);
2788  }
2789  else if (strat->M==NULL)
2790  {
2791  M=idInit(1,F->rank);
2792  Warn("no minimal generating set computed");
2793  }
2794  else
2795  {
2796  idSkipZeroes(strat->M);
2797  M=strat->M;
2798  }
2799  delete(strat);
2800  if (reduced>2)
2801  {
2802  Kstd1_deg=Kstd1_OldDeg;
2803  if (!oldDegBound)
2805  }
2806  else
2807  {
2808  if (IDELEMS(M)>IDELEMS(r)) {
2809  idDelete(&M);
2810  M=idCopy(r); }
2811  }
2812  return r;
2813 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:753
unsigned si_opt_1
Definition: options.c:5
int HCord
Definition: kutil.cc:227
int syzComp
Definition: kutil.h:352
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:140
#define pTest(p)
Definition: polys.h:387
#define TRUE
Definition: auxiliary.h:144
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
Definition: kstd1.cc:2221
int ak
Definition: kutil.h:351
#define Q
Definition: sirandom.c:25
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:1467
#define Sy_bit(x)
Definition: options.h:30
int minim
Definition: kutil.h:356
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:497
int HCord
Definition: kutil.h:353
pFDegProc pOrigFDeg
Definition: kutil.h:292
#define M
Definition: sirandom.c:24
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
pLDegProc pOrigLDeg
Definition: kutil.h:293
intvec * kModW
Definition: kstd1.cc:2196
BOOLEAN homog
Definition: kutil.h:362
Definition: intvec.h:16
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
tHomog
Definition: structs.h:37
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int syzComp
Definition: myNF.cc:291
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition: p_polys.cc:3481
#define assume(x)
Definition: mod2.h:405
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:209
ideal M
Definition: kutil.h:301
int i
Definition: cfEzgcd.cc:123
#define pOne()
Definition: polys.h:286
#define IDELEMS(i)
Definition: simpleideals.h:24
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
ideal idCopy(ideal A)
Definition: ideals.h:73
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3493
int int kStrategy strat
Definition: myNF.cc:68
#define TEST_OPT_RETURN_SB
Definition: options.h:107
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition: ideals.h:103
const CanonicalForm & w
Definition: facAbsFact.cc:55
intvec * kModW
Definition: kutil.h:333
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2198
#define OPT_DEGBOUND
Definition: options.h:85
int LazyPass
Definition: kutil.h:351
int Kstd1_deg
Definition: kutil.cc:228
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
const poly b
Definition: syzextra.cc:213
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:108
int LazyDegree
Definition: kutil.h:351
ideal mora(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd1.cc:1571
#define Warn
Definition: emacs.cc:80
long kModDeg ( poly  p,
ring  r = currRing 
)

Definition at line 2198 of file kstd1.cc.

2199 {
2200  long o=p_WDegree(p, r);
2201  long i=p_GetComp(p, r);
2202  if (i==0) return o;
2203  //assume((i>0) && (i<=kModW->length()));
2204  if (i<=kModW->length())
2205  return o+(*kModW)[i-1];
2206  return o;
2207 }
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
long p_WDegree(poly p, const ring r)
Definition: p_polys.cc:713
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
poly kNF ( ideal  F,
ideal  Q,
poly  p,
int  syzComp = 0,
int  lazyReduce = 0 
)

Definition at line 2815 of file kstd1.cc.

2816 {
2817  if (p==NULL)
2818  return NULL;
2819 
2820  poly pp = p;
2821 
2822 #ifdef HAVE_PLURAL
2823  if(rIsSCA(currRing))
2824  {
2825  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
2826  const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
2827  pp = p_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing);
2828 
2829  if(Q == currRing->qideal)
2830  Q = SCAQuotient(currRing);
2831  }
2832 #endif
2833 
2834  if ((idIs0(F))&&(Q==NULL))
2835  {
2836 #ifdef HAVE_PLURAL
2837  if(p != pp)
2838  return pp;
2839 #endif
2840  return pCopy(p); /*F+Q=0*/
2841  }
2842 
2844  strat->syzComp = syzComp;
2845  strat->ak = si_max(id_RankFreeModule(F,currRing),pMaxComp(p));
2846  poly res;
2847 
2849  res=kNF1(F,Q,pp,strat,lazyReduce);
2850  else
2851  res=kNF2(F,Q,pp,strat,lazyReduce);
2852  delete(strat);
2853 
2854 #ifdef HAVE_PLURAL
2855  if(pp != p)
2856  p_Delete(&pp, currRing);
2857 #endif
2858  return res;
2859 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:753
ideal SCAQuotient(const ring r)
Definition: sca.h:10
int syzComp
Definition: kutil.h:352
#define pMaxComp(p)
Definition: polys.h:270
return P p
Definition: myNF.cc:203
int ak
Definition: kutil.h:351
#define Q
Definition: sirandom.c:25
poly p_KillSquares(const poly p, const short iFirstAltVar, const short iLastAltVar, const ring r)
Definition: sca.cc:1479
poly pp
Definition: myNF.cc:296
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
poly kNF2(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
Definition: kstd2.cc:2599
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int syzComp
Definition: myNF.cc:291
poly kNF1(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
Definition: kstd1.cc:1915
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
static short scaFirstAltVar(ring r)
Definition: sca.h:18
int int kStrategy strat
Definition: myNF.cc:68
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
#define NULL
Definition: omList.c:10
static short scaLastAltVar(ring r)
Definition: sca.h:25
static bool rIsSCA(const ring r)
Definition: nc.h:206
polyrec * poly
Definition: hilb.h:10
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int int lazyReduce
Definition: myNF.cc:292
#define pCopy(p)
return a copy of the poly
Definition: polys.h:156
ideal kNF ( ideal  F,
ideal  Q,
ideal  p,
int  syzComp = 0,
int  lazyReduce = 0 
)

Definition at line 2861 of file kstd1.cc.

2862 {
2863  ideal res;
2864  if (TEST_OPT_PROT)
2865  {
2866  Print("(S:%d)",IDELEMS(p));mflush();
2867  }
2868  if (idIs0(p))
2869  return idInit(IDELEMS(p),si_max(p->rank,F->rank));
2870 
2871  ideal pp = p;
2872 #ifdef HAVE_PLURAL
2873  if(rIsSCA(currRing))
2874  {
2875  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
2876  const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
2877  pp = id_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing, false);
2878 
2879  if(Q == currRing->qideal)
2880  Q = SCAQuotient(currRing);
2881  }
2882 #endif
2883 
2884  if ((idIs0(F))&&(Q==NULL))
2885  {
2886 #ifdef HAVE_PLURAL
2887  if(p != pp)
2888  return pp;
2889 #endif
2890  return idCopy(p); /*F+Q=0*/
2891  }
2892 
2894  strat->syzComp = syzComp;
2896  if (strat->ak>0) // only for module case, see Tst/Short/bug_reduce.tst
2897  {
2898  strat->ak = si_max(strat->ak,(int)F->rank);
2899  }
2900 
2902  res=kNF1(F,Q,pp,strat,lazyReduce);
2903  else
2904  res=kNF2(F,Q,pp,strat,lazyReduce);
2905  delete(strat);
2906 
2907 #ifdef HAVE_PLURAL
2908  if(pp != p)
2909  id_Delete(&pp, currRing);
2910 #endif
2911 
2912  return res;
2913 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:753
ideal SCAQuotient(const ring r)
Definition: sca.h:10
#define Print
Definition: emacs.cc:83
int syzComp
Definition: kutil.h:352
#define TEST_OPT_PROT
Definition: options.h:98
return P p
Definition: myNF.cc:203
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
int ak
Definition: kutil.h:351
#define Q
Definition: sirandom.c:25
poly pp
Definition: myNF.cc:296
#define mflush()
Definition: reporter.h:55
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
poly kNF2(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
Definition: kstd2.cc:2599
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int syzComp
Definition: myNF.cc:291
poly kNF1(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
Definition: kstd1.cc:1915
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
#define IDELEMS(i)
Definition: simpleideals.h:24
static short scaFirstAltVar(ring r)
Definition: sca.h:18
ideal idCopy(ideal A)
Definition: ideals.h:73
int int kStrategy strat
Definition: myNF.cc:68
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
ideal id_KillSquares(const ideal id, const short iFirstAltVar, const short iLastAltVar, const ring r, const bool bSkipZeroes)
Definition: sca.cc:1534
static short scaLastAltVar(ring r)
Definition: sca.h:25
static bool rIsSCA(const ring r)
Definition: nc.h:206
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int int lazyReduce
Definition: myNF.cc:292
poly kNF1 ( ideal  F,
ideal  Q,
poly  q,
kStrategy  strat,
int  lazyReduce 
)

Definition at line 1915 of file kstd1.cc.

1916 {
1917  assume(q!=NULL);
1918  assume(!(idIs0(F)&&(Q==NULL)));
1919 
1920 // lazy_reduce flags: can be combined by |
1921 //#define KSTD_NF_LAZY 1
1922  // do only a reduction of the leading term
1923 //#define KSTD_NF_ECART 2
1924  // only local: recude even with bad ecart
1925  poly p;
1926  int i;
1927  int j;
1928  int o;
1929  LObject h;
1930  BITSET save1;
1931  SI_SAVE_OPT1(save1);
1932 
1933  //if ((idIs0(F))&&(Q==NULL))
1934  // return pCopy(q); /*F=0*/
1935  //strat->ak = si_max(idRankFreeModule(F),pMaxComp(q));
1936  /*- creating temp data structures------------------- -*/
1937  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
1938  strat->kNoether = pCopy((currRing->ppNoether));
1942  && (! TEST_V_DEG_STOP)
1943  && (0<Kstd1_deg)
1944  && ((!strat->kHEdgeFound)
1946  {
1947  pDelete(&strat->kNoether);
1948  strat->kNoether=pOne();
1949  pSetExp(strat->kNoether,1, Kstd1_deg+1);
1950  pSetm(strat->kNoether);
1951  strat->kHEdgeFound=TRUE;
1952  }
1953  initBuchMoraCrit(strat);
1954  initBuchMoraPos(strat);
1955  initMora(F,strat);
1956  strat->enterS = enterSMoraNF;
1957  /*- set T -*/
1958  strat->tl = -1;
1959  strat->tmax = setmaxT;
1960  strat->T = initT();
1961  strat->R = initR();
1962  strat->sevT = initsevT();
1963  /*- set S -*/
1964  strat->sl = -1;
1965  /*- init local data struct.-------------------------- -*/
1966  /*Shdl=*/initS(F,Q,strat);
1967  if ((strat->ak!=0)
1968  && (strat->kHEdgeFound))
1969  {
1970  if (strat->ak!=1)
1971  {
1972  pSetComp(strat->kNoether,1);
1973  pSetmComp(strat->kNoether);
1974  poly p=pHead(strat->kNoether);
1975  pSetComp(p,strat->ak);
1976  pSetmComp(p);
1977  p=pAdd(strat->kNoether,p);
1978  strat->kNoether=pNext(p);
1979  p_LmFree(p,currRing);
1980  }
1981  }
1982  if ((lazyReduce & KSTD_NF_LAZY)==0)
1983  {
1984  for (i=strat->sl; i>=0; i--)
1985  pNorm(strat->S[i]);
1986  }
1987  /*- puts the elements of S also to T -*/
1988  for (i=0; i<=strat->sl; i++)
1989  {
1990  h.p = strat->S[i];
1991  h.ecart = strat->ecartS[i];
1992  if (strat->sevS[i] == 0) strat->sevS[i] = pGetShortExpVector(h.p);
1993  else assume(strat->sevS[i] == pGetShortExpVector(h.p));
1994  h.length = pLength(h.p);
1995  h.sev = strat->sevS[i];
1996  h.SetpFDeg();
1997  enterT(h,strat);
1998  }
1999 #ifdef KDEBUG
2000 // kDebugPrint(strat);
2001 #endif
2002  /*- compute------------------------------------------- -*/
2003  p = pCopy(q);
2004  deleteHC(&p,&o,&j,strat);
2005  kTest(strat);
2006  if (TEST_OPT_PROT) { PrintS("r"); mflush(); }
2007  if (BVERBOSE(23)) kDebugPrint(strat);
2008  if (p!=NULL) p = redMoraNF(p,strat, lazyReduce & KSTD_NF_ECART);
2009  if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
2010  {
2011  if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
2012  p = redtail(p,strat->sl,strat);
2013  }
2014  /*- release temp data------------------------------- -*/
2015  cleanT(strat);
2016  assume(strat->L==NULL); /*strat->L unsed */
2017  assume(strat->B==NULL); /*strat->B unused */
2018  omFreeSize((ADDRESS)strat->T,strat->tmax*sizeof(TObject));
2019  omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
2020  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
2021  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
2022  omFree(strat->sevT);
2023  omFree(strat->S_2_R);
2024  omFree(strat->R);
2025 
2026  if ((Q!=NULL)&&(strat->fromQ!=NULL))
2027  {
2028  i=((IDELEMS(Q)+IDELEMS(F)+15)/16)*16;
2029  omFreeSize((ADDRESS)strat->fromQ,i*sizeof(int));
2030  strat->fromQ=NULL;
2031  }
2032  pDelete(&strat->kHEdge);
2033  pDelete(&strat->kNoether);
2034 // if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
2035 // {
2036 // pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2037 // if (ecartWeights)
2038 // {
2039 // omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
2040 // ecartWeights=NULL;
2041 // }
2042 // }
2043  idDelete(&strat->Shdl);
2044  SI_RESTORE_OPT1(save1);
2045  if (TEST_OPT_PROT) PrintLn();
2046  return p;
2047 }
#define pSetmComp(p)
TODO:
Definition: polys.h:243
KINLINE TObject ** initR()
Definition: kInline.h:92
unsigned si_opt_1
Definition: options.c:5
poly redtail(LObject *L, int pos, kStrategy strat)
Definition: kutil.cc:5971
#define pSetm(p)
Definition: polys.h:241
void PrintLn()
Definition: reporter.cc:327
KINLINE unsigned long * initsevT()
Definition: kInline.h:97
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define pAdd(p, q)
Definition: polys.h:174
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:8240
poly kHEdge
Definition: kutil.h:325
void initMora(ideal F, kStrategy strat)
Definition: kstd1.cc:1512
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
class sLObject LObject
Definition: kutil.h:60
KINLINE TSet initT()
Definition: kInline.h:81
#define TEST_OPT_PROT
Definition: options.h:98
#define pSetExp(p, i, v)
Definition: polys.h:42
int * S_2_R
Definition: kutil.h:340
return P p
Definition: myNF.cc:203
BOOLEAN * NotUsedAxis
Definition: kutil.h:330
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
poly kNoether
Definition: kutil.h:326
int tl
Definition: kutil.h:348
#define TRUE
Definition: auxiliary.h:144
#define kTest(A)
Definition: kutil.h:619
unsigned long * sevT
Definition: kutil.h:321
void * ADDRESS
Definition: auxiliary.h:161
#define SI_SAVE_OPT1(A)
Definition: options.h:20
int ak
Definition: kutil.h:351
#define Q
Definition: sirandom.c:25
#define BITSET
Definition: structs.h:17
#define Sy_bit(x)
Definition: options.h:30
static void p_LmFree(poly p, ring)
Definition: p_polys.h:679
static int pLength(poly a)
Definition: p_polys.h:189
void enterT(LObject &p, kStrategy strat, int atT)
Definition: kutil.cc:7807
#define mflush()
Definition: reporter.h:55
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void initS(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:6379
#define KSTD_NF_LAZY
Definition: kstd1.h:17
#define setmaxT
Definition: kutil.h:32
#define OPT_REDTAIL
Definition: options.h:86
#define TEST_V_DEG_STOP
Definition: options.h:130
int j
Definition: myNF.cc:70
#define TEST_OPT_STAIRCASEBOUND
Definition: options.h:110
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:405
intset fromQ
Definition: kutil.h:317
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
Definition: polys.h:140
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
Definition: kutil.h:282
#define KSTD_NF_ECART
Definition: kstd1.h:19
#define pSetComp(p, v)
Definition: polys.h:38
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:8088
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
void deleteHC(LObject *L, kStrategy strat, BOOLEAN fromNext)
Definition: kutil.cc:235
#define pOne()
Definition: polys.h:286
TObject ** R
Definition: kutil.h:338
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
polyset S
Definition: kutil.h:302
#define IDELEMS(i)
Definition: simpleideals.h:24
int tmax
Definition: kutil.h:348
#define OPT_INTSTRATEGY
Definition: options.h:87
#define BVERBOSE(a)
Definition: options.h:33
BOOLEAN kHEdgeFound
Definition: kutil.h:366
intset ecartS
Definition: kutil.h:305
LSet L
Definition: kutil.h:323
#define NULL
Definition: omList.c:10
void cleanT(kStrategy strat)
Definition: kutil.cc:505
LSet B
Definition: kutil.h:324
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:334
#define pWTotaldegree(p)
Definition: polys.h:254
#define pDelete(p_ptr)
Definition: polys.h:157
unsigned long * sevS
Definition: kutil.h:318
#define pNext(p)
Definition: monomials.h:43
static poly redMoraNF(poly h, kStrategy strat, int flag)
Definition: kstd1.cc:747
int sl
Definition: kutil.h:346
TSet T
Definition: kutil.h:322
void enterSMoraNF(LObject &p, int atS, kStrategy strat, int atR=-1)
Definition: kstd1.cc:1378
polyrec * poly
Definition: hilb.h:10
int Kstd1_deg
Definition: kutil.cc:228
ideal Shdl
Definition: kutil.h:299
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define SI_RESTORE_OPT1(A)
Definition: options.h:23
void kDebugPrint(kStrategy strat)
Definition: kutil.cc:9903
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int int lazyReduce
Definition: myNF.cc:292
class sTObject TObject
Definition: kutil.h:59
#define pCopy(p)
return a copy of the poly
Definition: polys.h:156
ideal kNF1 ( ideal  F,
ideal  Q,
ideal  q,
kStrategy  strat,
int  lazyReduce 
)

Definition at line 2049 of file kstd1.cc.

2050 {
2051  assume(!idIs0(q));
2052  assume(!(idIs0(F)&&(Q==NULL)));
2053 
2054 // lazy_reduce flags: can be combined by |
2055 //#define KSTD_NF_LAZY 1
2056  // do only a reduction of the leading term
2057 //#define KSTD_NF_ECART 2
2058  // only local: recude even with bad ecart
2059  poly p;
2060  int i;
2061  int j;
2062  int o;
2063  LObject h;
2064  ideal res;
2065  BITSET save1;
2066  SI_SAVE_OPT1(save1);
2067 
2068  //if (idIs0(q)) return idInit(IDELEMS(q),si_max(q->rank,F->rank));
2069  //if ((idIs0(F))&&(Q==NULL))
2070  // return idCopy(q); /*F=0*/
2071  //strat->ak = si_max(idRankFreeModule(F),idRankFreeModule(q));
2072  /*- creating temp data structures------------------- -*/
2073  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
2074  strat->kNoether=pCopy((currRing->ppNoether));
2077  && (0<Kstd1_deg)
2078  && ((!strat->kHEdgeFound)
2080  {
2081  pDelete(&strat->kNoether);
2082  strat->kNoether=pOne();
2083  pSetExp(strat->kNoether,1, Kstd1_deg+1);
2084  pSetm(strat->kNoether);
2085  strat->kHEdgeFound=TRUE;
2086  }
2087  initBuchMoraCrit(strat);
2088  initBuchMoraPos(strat);
2089  initMora(F,strat);
2090  strat->enterS = enterSMoraNF;
2091  /*- set T -*/
2092  strat->tl = -1;
2093  strat->tmax = setmaxT;
2094  strat->T = initT();
2095  strat->R = initR();
2096  strat->sevT = initsevT();
2097  /*- set S -*/
2098  strat->sl = -1;
2099  /*- init local data struct.-------------------------- -*/
2100  /*Shdl=*/initS(F,Q,strat);
2101  if ((strat->ak!=0)
2102  && (strat->kHEdgeFound))
2103  {
2104  if (strat->ak!=1)
2105  {
2106  pSetComp(strat->kNoether,1);
2107  pSetmComp(strat->kNoether);
2108  poly p=pHead(strat->kNoether);
2109  pSetComp(p,strat->ak);
2110  pSetmComp(p);
2111  p=pAdd(strat->kNoether,p);
2112  strat->kNoether=pNext(p);
2113  p_LmFree(p,currRing);
2114  }
2115  }
2117  {
2118  for (i=strat->sl; i>=0; i--)
2119  pNorm(strat->S[i]);
2120  }
2121  /*- compute------------------------------------------- -*/
2122  res=idInit(IDELEMS(q),strat->ak);
2123  for (i=0; i<IDELEMS(q); i++)
2124  {
2125  if (q->m[i]!=NULL)
2126  {
2127  p = pCopy(q->m[i]);
2128  deleteHC(&p,&o,&j,strat);
2129  if (p!=NULL)
2130  {
2131  /*- puts the elements of S also to T -*/
2132  for (j=0; j<=strat->sl; j++)
2133  {
2134  h.p = strat->S[j];
2135  h.ecart = strat->ecartS[j];
2136  h.pLength = h.length = pLength(h.p);
2137  if (strat->sevS[j] == 0) strat->sevS[j] = pGetShortExpVector(h.p);
2138  else assume(strat->sevS[j] == pGetShortExpVector(h.p));
2139  h.sev = strat->sevS[j];
2140  h.SetpFDeg();
2141  #ifdef HAVE_RINGS
2143  enterT_strong(h,strat);
2144  else
2145  #endif
2146  enterT(h,strat);
2147  }
2148  if (TEST_OPT_PROT) { PrintS("r"); mflush(); }
2149  p = redMoraNF(p,strat, lazyReduce & KSTD_NF_ECART);
2150  if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
2151  {
2152  if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
2153  p = redtail(p,strat->sl,strat);
2154  }
2155  cleanT(strat);
2156  }
2157  res->m[i]=p;
2158  }
2159  //else
2160  // res->m[i]=NULL;
2161  }
2162  /*- release temp data------------------------------- -*/
2163  assume(strat->L==NULL); /*strat->L unsed */
2164  assume(strat->B==NULL); /*strat->B unused */
2165  omFreeSize((ADDRESS)strat->T,strat->tmax*sizeof(TObject));
2166  omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
2167  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
2168  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
2169  omFree(strat->sevT);
2170  omFree(strat->S_2_R);
2171  omFree(strat->R);
2172  if ((Q!=NULL)&&(strat->fromQ!=NULL))
2173  {
2174  i=((IDELEMS(Q)+IDELEMS(F)+15)/16)*16;
2175  omFreeSize((ADDRESS)strat->fromQ,i*sizeof(int));
2176  strat->fromQ=NULL;
2177  }
2178  pDelete(&strat->kHEdge);
2179  pDelete(&strat->kNoether);
2180 // if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
2181 // {
2182 // pFDeg=strat->pOrigFDeg;
2183 // pLDeg=strat->pOrigLDeg;
2184 // if (ecartWeights)
2185 // {
2186 // omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
2187 // ecartWeights=NULL;
2188 // }
2189 // }
2190  idDelete(&strat->Shdl);
2191  SI_RESTORE_OPT1(save1);
2192  if (TEST_OPT_PROT) PrintLn();
2193  return res;
2194 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:753
#define pSetmComp(p)
TODO:
Definition: polys.h:243
KINLINE TObject ** initR()
Definition: kInline.h:92
unsigned si_opt_1
Definition: options.c:5
poly redtail(LObject *L, int pos, kStrategy strat)
Definition: kutil.cc:5971
#define pSetm(p)
Definition: polys.h:241
void PrintLn()
Definition: reporter.cc:327
KINLINE unsigned long * initsevT()
Definition: kInline.h:97
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define pAdd(p, q)
Definition: polys.h:174
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:8240
poly kHEdge
Definition: kutil.h:325
void initMora(ideal F, kStrategy strat)
Definition: kstd1.cc:1512
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
class sLObject LObject
Definition: kutil.h:60
KINLINE TSet initT()
Definition: kInline.h:81
#define TEST_OPT_PROT
Definition: options.h:98
#define pSetExp(p, i, v)
Definition: polys.h:42
int * S_2_R
Definition: kutil.h:340
return P p
Definition: myNF.cc:203
BOOLEAN * NotUsedAxis
Definition: kutil.h:330
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
poly kNoether
Definition: kutil.h:326
int tl
Definition: kutil.h:348
#define TRUE
Definition: auxiliary.h:144
unsigned long * sevT
Definition: kutil.h:321
void * ADDRESS
Definition: auxiliary.h:161
#define SI_SAVE_OPT1(A)
Definition: options.h:20
int ak
Definition: kutil.h:351
#define Q
Definition: sirandom.c:25
#define BITSET
Definition: structs.h:17
#define Sy_bit(x)
Definition: options.h:30
static void p_LmFree(poly p, ring)
Definition: p_polys.h:679
static int pLength(poly a)
Definition: p_polys.h:189
void enterT(LObject &p, kStrategy strat, int atT)
Definition: kutil.cc:7807
#define mflush()
Definition: reporter.h:55
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void initS(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:6379
#define KSTD_NF_LAZY
Definition: kstd1.h:17
#define TEST_OPT_INTSTRATEGY
Definition: options.h:105
#define setmaxT
Definition: kutil.h:32
#define OPT_REDTAIL
Definition: options.h:86
int j
Definition: myNF.cc:70
#define TEST_OPT_STAIRCASEBOUND
Definition: options.h:110
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:405
intset fromQ
Definition: kutil.h:317
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
Definition: polys.h:140
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
Definition: kutil.h:282
#define KSTD_NF_ECART
Definition: kstd1.h:19
#define pSetComp(p, v)
Definition: polys.h:38
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:8088
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
void deleteHC(LObject *L, kStrategy strat, BOOLEAN fromNext)
Definition: kutil.cc:235
#define pOne()
Definition: polys.h:286
TObject ** R
Definition: kutil.h:338
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
polyset S
Definition: kutil.h:302
#define IDELEMS(i)
Definition: simpleideals.h:24
int tmax
Definition: kutil.h:348
void enterT_strong(LObject &p, kStrategy strat, int atT)
Definition: kutil.cc:7891
BOOLEAN kHEdgeFound
Definition: kutil.h:366
intset ecartS
Definition: kutil.h:305
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
LSet L
Definition: kutil.h:323
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
void cleanT(kStrategy strat)
Definition: kutil.cc:505
LSet B
Definition: kutil.h:324
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:334
#define pWTotaldegree(p)
Definition: polys.h:254
#define pDelete(p_ptr)
Definition: polys.h:157
unsigned long * sevS
Definition: kutil.h:318
#define pNext(p)
Definition: monomials.h:43
static poly redMoraNF(poly h, kStrategy strat, int flag)
Definition: kstd1.cc:747
int sl
Definition: kutil.h:346
TSet T
Definition: kutil.h:322
void enterSMoraNF(LObject &p, int atS, kStrategy strat, int atR=-1)
Definition: kstd1.cc:1378
polyrec * poly
Definition: hilb.h:10
int Kstd1_deg
Definition: kutil.cc:228
ideal Shdl
Definition: kutil.h:299
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define SI_RESTORE_OPT1(A)
Definition: options.h:23
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int int lazyReduce
Definition: myNF.cc:292
class sTObject TObject
Definition: kutil.h:59
#define pCopy(p)
return a copy of the poly
Definition: polys.h:156
ideal kSba ( ideal  F,
ideal  Q,
tHomog  h,
intvec **  mw,
int  incremental = 0,
int  arri = 0,
intvec hilb = NULL,
int  syzComp = 0,
int  newIdeal = 0,
intvec vw = NULL 
)

Definition at line 2418 of file kstd1.cc.

2420 {
2421  if(idIs0(F))
2422  return idInit(1,F->rank);
2423 
2424  ideal r;
2425  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
2426  BOOLEAN delete_w=(w==NULL);
2428  strat->sbaOrder = sbaOrder;
2429  if (arri!=0)
2430  {
2431  strat->rewCrit1 = arriRewDummy;
2432  strat->rewCrit2 = arriRewCriterion;
2433  strat->rewCrit3 = arriRewCriterionPre;
2434  }
2435  else
2436  {
2437  strat->rewCrit1 = faugereRewCriterion;
2438  strat->rewCrit2 = faugereRewCriterion;
2439  strat->rewCrit3 = faugereRewCriterion;
2440  }
2441 
2442  if(!TEST_OPT_RETURN_SB)
2443  strat->syzComp = syzComp;
2444  if (TEST_OPT_SB_1)
2445  #ifdef HAVE_RINGS
2446  if(!rField_is_Ring(currRing))
2447  #endif
2448  strat->newIdeal = newIdeal;
2450  strat->LazyPass=20;
2451  else
2452  strat->LazyPass=2;
2453  strat->LazyDegree = 1;
2455  strat->chainCrit=chainCritNormal;
2457  strat->ak = id_RankFreeModule(F,currRing);
2458  strat->kModW=kModW=NULL;
2459  strat->kHomW=kHomW=NULL;
2460  if (vw != NULL)
2461  {
2462  currRing->pLexOrder=FALSE;
2463  strat->kHomW=kHomW=vw;
2464  strat->pOrigFDeg = currRing->pFDeg;
2465  strat->pOrigLDeg = currRing->pLDeg;
2467  toReset = TRUE;
2468  }
2469  if (h==testHomog)
2470  {
2471  if (strat->ak == 0)
2472  {
2473  h = (tHomog)idHomIdeal(F,Q);
2474  w=NULL;
2475  }
2476  else if (!TEST_OPT_DEGBOUND)
2477  {
2478  h = (tHomog)idHomModule(F,Q,w);
2479  }
2480  }
2481  currRing->pLexOrder=b;
2482  if (h==isHomog)
2483  {
2484  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2485  {
2486  strat->kModW = kModW = *w;
2487  if (vw == NULL)
2488  {
2489  strat->pOrigFDeg = currRing->pFDeg;
2490  strat->pOrigLDeg = currRing->pLDeg;
2492  toReset = TRUE;
2493  }
2494  }
2495  currRing->pLexOrder = TRUE;
2496  if (hilb==NULL) strat->LazyPass*=2;
2497  }
2498  strat->homog=h;
2499 #ifdef KDEBUG
2500  idTest(F);
2501  idTest(Q);
2502 
2503 #if MYTEST
2504  if (TEST_OPT_DEBUG)
2505  {
2506  PrintS("// kSTD: currRing: ");
2507  rWrite(currRing);
2508  }
2509 #endif
2510 
2511 #endif
2512 #ifdef HAVE_PLURAL
2513  if (rIsPluralRing(currRing))
2514  {
2515  const BOOLEAN bIsSCA = rIsSCA(currRing) && strat->z2homog; // for Z_2 prod-crit
2516  strat->no_prod_crit = ! bIsSCA;
2517  if (w!=NULL)
2518  r = nc_GB(F, Q, *w, hilb, strat, currRing);
2519  else
2520  r = nc_GB(F, Q, NULL, hilb, strat, currRing);
2521  }
2522  else
2523 #endif
2524 #ifdef HAVE_RINGS
2525  if (rField_is_Ring(currRing))
2526  r=bba(F,Q,NULL,hilb,strat);
2527  else
2528 #endif
2529  {
2531  {
2532  if (w!=NULL)
2533  r=mora(F,Q,*w,hilb,strat);
2534  else
2535  r=mora(F,Q,NULL,hilb,strat);
2536  }
2537  else
2538  {
2539  if (w!=NULL)
2540  r=sba(F,Q,*w,hilb,strat);
2541  else
2542  r=sba(F,Q,NULL,hilb,strat);
2543  }
2544  }
2545 #ifdef KDEBUG
2546  idTest(r);
2547 #endif
2548  if (toReset)
2549  {
2550  kModW = NULL;
2551  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2552  }
2553  currRing->pLexOrder = b;
2554 //Print("%d reductions canceled \n",strat->cel);
2555  HCord=strat->HCord;
2556  delete(strat);
2557  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
2558  return r;
2559 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:753
int HCord
Definition: kutil.cc:227
int syzComp
Definition: kutil.h:352
#define TEST_OPT_DEGBOUND
Definition: options.h:108
BOOLEAN(* rewCrit1)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.h:289
if(0 > strat->sl)
Definition: myNF.cc:73
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly, kStrategy strat, int start=0)
Definition: kutil.cc:5746
#define FALSE
Definition: auxiliary.h:140
void chainCritNormal(poly p, int ecart, kStrategy strat)
Definition: kutil.cc:2447
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.h:290
BOOLEAN z2homog
Definition: kutil.h:364
#define TRUE
Definition: auxiliary.h:144
BOOLEAN(* rewCrit3)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.h:291
int ak
Definition: kutil.h:351
#define TEST_OPT_DEBUG
Definition: options.h:103
#define Q
Definition: sirandom.c:25
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:1467
ideal sba(ideal F0, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:1879
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
Definition: kutil.cc:1532
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:497
int HCord
Definition: kutil.h:353
pFDegProc pOrigFDeg
Definition: kutil.h:292
intvec * kHomW
Definition: kstd1.cc:2196
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void(* enterOnePair)(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
Definition: kutil.h:286
const ring r
Definition: syzextra.cc:208
pLDegProc pOrigLDeg
Definition: kutil.h:293
intvec * kModW
Definition: kstd1.cc:2196
BOOLEAN homog
Definition: kutil.h:362
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
tHomog
Definition: structs.h:37
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int syzComp
Definition: myNF.cc:291
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition: p_polys.cc:3481
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2208
unsigned sbaOrder
Definition: kutil.h:312
void PrintS(const char *s)
Definition: reporter.cc:294
void rWrite(ring r, BOOLEAN details)
Definition: ring.cc:236
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3493
BOOLEAN arriRewCriterion(poly, unsigned long, poly, kStrategy strat, int start=0)
Definition: kutil.cc:5802
int int kStrategy strat
Definition: myNF.cc:68
#define TEST_OPT_RETURN_SB
Definition: options.h:107
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int)
Definition: kutil.cc:5825
void(* chainCrit)(poly p, int ecart, kStrategy strat)
Definition: kutil.h:287
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition: ideals.h:103
intvec * kHomW
Definition: kutil.h:334
#define TEST_OPT_SB_1
Definition: options.h:113
const CanonicalForm & w
Definition: facAbsFact.cc:55
intvec * kModW
Definition: kutil.h:333
BOOLEAN no_prod_crit
Definition: kutil.h:384
static bool rIsSCA(const ring r)
Definition: nc.h:206
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2198
void chainCritOpt_1(poly, int, kStrategy strat)
Definition: kutil.cc:2662
int LazyPass
Definition: kutil.h:351
int newIdeal
Definition: kutil.h:355
static ideal nc_GB(const ideal F, const ideal Q, const intvec *w, const intvec *hilb, kStrategy strat, const ring r)
Definition: nc.h:28
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
const poly b
Definition: syzextra.cc:213
KINLINE BOOLEAN arriRewDummy(poly, unsigned long, poly, kStrategy, int)
Definition: kInline.h:1172
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:108
int LazyDegree
Definition: kutil.h:351
ideal mora(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd1.cc:1571
#define idTest(id)
Definition: ideals.h:60
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 
)

Definition at line 2221 of file kstd1.cc.

2223 {
2224  if(idIs0(F))
2225  return idInit(1,F->rank);
2226 
2227  ideal r;
2228  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
2229  BOOLEAN delete_w=(w==NULL);
2231 
2232  strat->s_poly=sp;
2233  if(!TEST_OPT_RETURN_SB)
2234  strat->syzComp = syzComp;
2235  if (TEST_OPT_SB_1
2236  #ifdef HAVE_RINGS
2237  &&(!rField_is_Ring(currRing))
2238  #endif
2239  )
2240  strat->newIdeal = newIdeal;
2242  strat->LazyPass=20;
2243  else
2244  strat->LazyPass=2;
2245  strat->LazyDegree = 1;
2246  strat->ak = id_RankFreeModule(F,currRing);
2247  strat->kModW=kModW=NULL;
2248  strat->kHomW=kHomW=NULL;
2249  if (vw != NULL)
2250  {
2251  currRing->pLexOrder=FALSE;
2252  strat->kHomW=kHomW=vw;
2253  strat->pOrigFDeg = currRing->pFDeg;
2254  strat->pOrigLDeg = currRing->pLDeg;
2256  toReset = TRUE;
2257  }
2258  if (h==testHomog)
2259  {
2260  if (strat->ak == 0)
2261  {
2262  h = (tHomog)idHomIdeal(F,Q);
2263  w=NULL;
2264  }
2265  else if (!TEST_OPT_DEGBOUND)
2266  {
2267  h = (tHomog)idHomModule(F,Q,w);
2268  }
2269  }
2270  currRing->pLexOrder=b;
2271  if (h==isHomog)
2272  {
2273  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2274  {
2275  strat->kModW = kModW = *w;
2276  if (vw == NULL)
2277  {
2278  strat->pOrigFDeg = currRing->pFDeg;
2279  strat->pOrigLDeg = currRing->pLDeg;
2281  toReset = TRUE;
2282  }
2283  }
2284  currRing->pLexOrder = TRUE;
2285  if (hilb==NULL) strat->LazyPass*=2;
2286  }
2287  strat->homog=h;
2288 #ifdef KDEBUG
2289  idTest(F);
2290  if (Q!=NULL) idTest(Q);
2291 
2292 #if MYTEST
2293  if (TEST_OPT_DEBUG)
2294  {
2295  PrintS("// kSTD: currRing: ");
2296  rWrite(currRing);
2297  }
2298 #endif
2299 
2300 #endif
2301 #ifdef HAVE_PLURAL
2302  if (rIsPluralRing(currRing))
2303  {
2304  const BOOLEAN bIsSCA = rIsSCA(currRing) && strat->z2homog; // for Z_2 prod-crit
2305  strat->no_prod_crit = ! bIsSCA;
2306  if (w!=NULL)
2307  r = nc_GB(F, Q, *w, hilb, strat, currRing);
2308  else
2309  r = nc_GB(F, Q, NULL, hilb, strat, currRing);
2310  }
2311  else
2312 #endif
2313 #ifdef HAVE_RINGS
2314  if (rField_is_Ring(currRing))
2315  {
2316  if(nCoeff_is_Ring_Z(currRing->cf))
2317  {
2318  #if 0
2319  if(nCoeff_is_Ring_Z(currRing->cf))
2320  {
2321  ideal FCopy = idCopy(F);
2322  poly pFmon = preIntegerCheck(FCopy, Q);
2323  if(pFmon != NULL)
2324  {
2325  idInsertPoly(FCopy, pFmon);
2326  #if ADIDEBUG
2327  printf("\nPreintegerCheck found this constant:\n");pWrite(pFmon);
2328  #endif
2329  }
2330  strat->kModW=kModW=NULL;
2331  if (h==testHomog)
2332  {
2333  if (strat->ak == 0)
2334  {
2335  h = (tHomog)idHomIdeal(FCopy,Q);
2336  w=NULL;
2337  }
2338  else if (!TEST_OPT_DEGBOUND)
2339  {
2340  h = (tHomog)idHomModule(FCopy,Q,w);
2341  }
2342  }
2343  currRing->pLexOrder=b;
2344  if (h==isHomog)
2345  {
2346  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2347  {
2348  strat->kModW = kModW = *w;
2349  if (vw == NULL)
2350  {
2351  strat->pOrigFDeg = currRing->pFDeg;
2352  strat->pOrigLDeg = currRing->pLDeg;
2354  toReset = TRUE;
2355  }
2356  }
2357  currRing->pLexOrder = TRUE;
2358  if (hilb==NULL) strat->LazyPass*=2;
2359  }
2360  strat->homog=h;
2361  omTestMemory(1);
2363  r=mora(FCopy,Q,NULL,hilb,strat);
2364  else
2365  r=bba(FCopy,Q,NULL,hilb,strat);
2366  }
2367  else
2368  #endif
2369  {
2371  r=mora(F,Q,NULL,hilb,strat);
2372  else
2373  r=bba(F,Q,NULL,hilb,strat);
2374  }
2375  }
2376  else
2377  {
2379  r=mora(F,Q,NULL,hilb,strat);
2380  else
2381  r=bba(F,Q,NULL,hilb,strat);
2382  }
2383  }
2384  else
2385 #endif
2386  {
2388  {
2389  if (w!=NULL)
2390  r=mora(F,Q,*w,hilb,strat);
2391  else
2392  r=mora(F,Q,NULL,hilb,strat);
2393  }
2394  else
2395  {
2396  if (w!=NULL)
2397  r=bba(F,Q,*w,hilb,strat);
2398  else
2399  r=bba(F,Q,NULL,hilb,strat);
2400  }
2401  }
2402 #ifdef KDEBUG
2403  idTest(r);
2404 #endif
2405  if (toReset)
2406  {
2407  kModW = NULL;
2408  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2409  }
2410  currRing->pLexOrder = b;
2411 //Print("%d reductions canceled \n",strat->cel);
2412  HCord=strat->HCord;
2413  delete(strat);
2414  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
2415  return r;
2416 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:753
int HCord
Definition: kutil.cc:227
int syzComp
Definition: kutil.h:352
#define TEST_OPT_DEGBOUND
Definition: options.h:108
poly preIntegerCheck(ideal FOrig, ideal Q)
used for GB over ZZ: look for constant and monomial elements in the ideal background: any known const...
Definition: kutil.cc:9048
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:140
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
Definition: coeffs.h:750
BOOLEAN z2homog
Definition: kutil.h:364
#define TRUE
Definition: auxiliary.h:144
void pWrite(poly p)
Definition: polys.h:279
int ak
Definition: kutil.h:351
#define TEST_OPT_DEBUG
Definition: options.h:103
#define Q
Definition: sirandom.c:25
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:1467
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:497
int HCord
Definition: kutil.h:353
pFDegProc pOrigFDeg
Definition: kutil.h:292
intvec * kHomW
Definition: kstd1.cc:2196
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
omError_t omTestMemory(int check_level)
Definition: omDebug.c:94
const ring r
Definition: syzextra.cc:208
pLDegProc pOrigLDeg
Definition: kutil.h:293
intvec * kModW
Definition: kstd1.cc:2196
BOOLEAN homog
Definition: kutil.h:362
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
tHomog
Definition: structs.h:37
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int syzComp
Definition: myNF.cc:291
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition: p_polys.cc:3481
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2208
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted ...
void PrintS(const char *s)
Definition: reporter.cc:294
void rWrite(ring r, BOOLEAN details)
Definition: ring.cc:236
ideal idCopy(ideal A)
Definition: ideals.h:73
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3493
int int kStrategy strat
Definition: myNF.cc:68
#define TEST_OPT_RETURN_SB
Definition: options.h:107
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
s_poly_proc_t s_poly
Definition: kutil.h:296
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition: ideals.h:103
intvec * kHomW
Definition: kutil.h:334
#define TEST_OPT_SB_1
Definition: options.h:113
const CanonicalForm & w
Definition: facAbsFact.cc:55
intvec * kModW
Definition: kutil.h:333
BOOLEAN no_prod_crit
Definition: kutil.h:384
static bool rIsSCA(const ring r)
Definition: nc.h:206
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2198
int LazyPass
Definition: kutil.h:351
polyrec * poly
Definition: hilb.h:10
int newIdeal
Definition: kutil.h:355
static ideal nc_GB(const ideal F, const ideal Q, const intvec *w, const intvec *hilb, kStrategy strat, const ring r)
Definition: nc.h:28
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
const poly b
Definition: syzextra.cc:213
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:108
int LazyDegree
Definition: kutil.h:351
ideal mora(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd1.cc:1571
#define idTest(id)
Definition: ideals.h:60
ideal kStdShift ( ideal  F,
ideal  Q,
tHomog  h,
intvec **  w,
intvec hilb,
int  syzComp,
int  newIdeal,
intvec vw,
int  uptodeg,
int  lVblock 
)

Definition at line 2562 of file kstd1.cc.

2564 {
2565  ideal r;
2566  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
2567  BOOLEAN delete_w=(w==NULL);
2569 
2570  if(!TEST_OPT_RETURN_SB)
2571  strat->syzComp = syzComp;
2572  if (TEST_OPT_SB_1)
2573  #ifdef HAVE_RINGS
2574  if(!rField_is_Ring(currRing))
2575  #endif
2576  strat->newIdeal = newIdeal;
2578  strat->LazyPass=20;
2579  else
2580  strat->LazyPass=2;
2581  strat->LazyDegree = 1;
2582  strat->ak = id_RankFreeModule(F,currRing);
2583  strat->kModW=kModW=NULL;
2584  strat->kHomW=kHomW=NULL;
2585  if (vw != NULL)
2586  {
2587  currRing->pLexOrder=FALSE;
2588  strat->kHomW=kHomW=vw;
2589  strat->pOrigFDeg = currRing->pFDeg;
2590  strat->pOrigLDeg = currRing->pLDeg;
2592  toReset = TRUE;
2593  }
2594  if (h==testHomog)
2595  {
2596  if (strat->ak == 0)
2597  {
2598  h = (tHomog)idHomIdeal(F,Q);
2599  w=NULL;
2600  }
2601  else if (!TEST_OPT_DEGBOUND)
2602  {
2603  h = (tHomog)idHomModule(F,Q,w);
2604  }
2605  }
2606  currRing->pLexOrder=b;
2607  if (h==isHomog)
2608  {
2609  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2610  {
2611  strat->kModW = kModW = *w;
2612  if (vw == NULL)
2613  {
2614  strat->pOrigFDeg = currRing->pFDeg;
2615  strat->pOrigLDeg = currRing->pLDeg;
2617  toReset = TRUE;
2618  }
2619  }
2620  currRing->pLexOrder = TRUE;
2621  if (hilb==NULL) strat->LazyPass*=2;
2622  }
2623  strat->homog=h;
2624 #ifdef KDEBUG
2625  idTest(F);
2626 #endif
2628  {
2629  /* error: no local ord yet with shifts */
2630  Print("No local ordering possible for shifts");
2631  return(NULL);
2632  }
2633  else
2634  {
2635  /* global ordering */
2636  if (w!=NULL)
2637  r=bbaShift(F,Q,*w,hilb,strat,uptodeg,lV);
2638  else
2639  r=bbaShift(F,Q,NULL,hilb,strat,uptodeg,lV);
2640  }
2641 #ifdef KDEBUG
2642  idTest(r);
2643 #endif
2644  if (toReset)
2645  {
2646  kModW = NULL;
2647  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2648  }
2649  currRing->pLexOrder = b;
2650 //Print("%d reductions canceled \n",strat->cel);
2651  HCord=strat->HCord;
2652  delete(strat);
2653  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
2654  return r;
2655 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:753
int HCord
Definition: kutil.cc:227
#define Print
Definition: emacs.cc:83
int syzComp
Definition: kutil.h:352
#define TEST_OPT_DEGBOUND
Definition: options.h:108
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
int ak
Definition: kutil.h:351
#define Q
Definition: sirandom.c:25
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:497
int HCord
Definition: kutil.h:353
pFDegProc pOrigFDeg
Definition: kutil.h:292
intvec * kHomW
Definition: kstd1.cc:2196
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
pLDegProc pOrigLDeg
Definition: kutil.h:293
intvec * kModW
Definition: kstd1.cc:2196
BOOLEAN homog
Definition: kutil.h:362
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
tHomog
Definition: structs.h:37
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int syzComp
Definition: myNF.cc:291
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition: p_polys.cc:3481
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2208
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3493
int int kStrategy strat
Definition: myNF.cc:68
#define TEST_OPT_RETURN_SB
Definition: options.h:107
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition: ideals.h:103
intvec * kHomW
Definition: kutil.h:334
#define TEST_OPT_SB_1
Definition: options.h:113
const CanonicalForm & w
Definition: facAbsFact.cc:55
intvec * kModW
Definition: kutil.h:333
ideal bbaShift(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat, int uptodeg, int lV)
Definition: kstd2.cc:3072
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2198
int LazyPass
Definition: kutil.h:351
int newIdeal
Definition: kutil.h:355
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
const poly b
Definition: syzextra.cc:213
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:108
int LazyDegree
Definition: kutil.h:351
#define idTest(id)
Definition: ideals.h:60
ideal mora ( ideal  F,
ideal  Q,
intvec w,
intvec hilb,
kStrategy  strat 
)

Definition at line 1571 of file kstd1.cc.

1572 {
1573 #ifdef HAVE_RINGS
1574 #if ADIDEBUG
1575 int loop_count;
1576 loop_count = 1;
1577 #endif
1578 #endif
1579  int olddeg = 0;
1580  int reduc = 0;
1581  int red_result = 1;
1582  int hilbeledeg=1,hilbcount=0;
1583  BITSET save1;
1584  SI_SAVE_OPT1(save1);
1585  if (currRing->MixedOrder)
1586  {
1587  si_opt_1 &= ~Sy_bit(OPT_REDSB);
1589  }
1590 
1591  strat->update = TRUE;
1592  /*- setting global variables ------------------- -*/
1593  initBuchMoraCrit(strat);
1594  initHilbCrit(F,Q,&hilb,strat);
1595  initMora(F,strat);
1596  initBuchMoraPos(strat);
1597  /*Shdl=*/initBuchMora(F,Q,strat);
1598  if (TEST_OPT_FASTHC) missingAxis(&strat->lastAxis,strat);
1599  /*updateS in initBuchMora has Hecketest
1600  * and could have put strat->kHEdgdeFound FALSE*/
1601  if ((currRing->ppNoether)!=NULL)
1602  {
1603  strat->kHEdgeFound = TRUE;
1604  }
1605  if (strat->kHEdgeFound && strat->update)
1606  {
1607  firstUpdate(strat);
1608  updateLHC(strat);
1609  reorderL(strat);
1610  }
1611  if (TEST_OPT_FASTHC && (strat->lastAxis) && strat->posInLOldFlag)
1612  {
1613  strat->posInLOld = strat->posInL;
1614  strat->posInLOldFlag = FALSE;
1615  strat->posInL = posInL10;
1616  updateL(strat);
1617  reorderL(strat);
1618  }
1619  kTest_TS(strat);
1620  strat->use_buckets = kMoraUseBucket(strat);
1621  /*- compute-------------------------------------------*/
1622 
1623 #ifdef HAVE_TAIL_RING
1624  if (strat->homog && strat->red == redFirst)
1625  if(!idIs0(F) &&(!rField_is_Ring(currRing)))
1626  kStratInitChangeTailRing(strat);
1627 #endif
1628 
1629  if (BVERBOSE(23))
1630  {
1631  kDebugPrint(strat);
1632  }
1633 
1634  while (strat->Ll >= 0)
1635  {
1636  #if ADIDEBUG
1637  printf("\n ------------------------NEW LOOP\n");
1638  printf("\nShdl = \n");
1639  for(int iii = 0; iii<= strat->sl; iii++)
1640  {
1641  printf("S[%i]:",iii);
1642  p_Write(strat->S[iii], strat->tailRing);
1643  }
1644  printf("\n list L has %i\n", strat->Ll);
1645  int iii;
1646  #if ADIDEBUG
1647  for(iii = 0; iii<= strat->Ll; iii++)
1648  {
1649  printf("L[%i]:",iii);
1650  #if 0
1651  p_Write(strat->L[iii].p, strat->tailRing);
1652  p_Write(strat->L[iii].p1, strat->tailRing);
1653  p_Write(strat->L[iii].p2, strat->tailRing);
1654  #else
1655  pWrite(strat->L[iii].p);
1656  pWrite(strat->L[iii].p1);
1657  pWrite(strat->L[iii].p2);
1658  pWrite(strat->L[iii].lcm);
1659  #endif
1660  }
1661  #endif
1662  getchar();
1663  #endif
1664  #ifdef KDEBUG
1665  if (TEST_OPT_DEBUG) messageSets(strat);
1666  #endif
1667  if (TEST_OPT_DEGBOUND
1668  && (strat->L[strat->Ll].ecart+strat->L[strat->Ll].GetpFDeg()> Kstd1_deg))
1669  {
1670  /*
1671  * stops computation if
1672  * - 24 (degBound)
1673  * && upper degree is bigger than Kstd1_deg
1674  */
1675  while ((strat->Ll >= 0)
1676  && (strat->L[strat->Ll].p1!=NULL) && (strat->L[strat->Ll].p2!=NULL)
1677  && (strat->L[strat->Ll].ecart+strat->L[strat->Ll].GetpFDeg()> Kstd1_deg)
1678  )
1679  {
1680  deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
1681  //if (TEST_OPT_PROT)
1682  //{
1683  // PrintS("D"); mflush();
1684  //}
1685  }
1686  if (strat->Ll<0) break;
1687  else strat->noClearS=TRUE;
1688  }
1689  strat->P = strat->L[strat->Ll];/*- picks the last element from the lazyset L -*/
1690  if (strat->Ll==0) strat->interpt=TRUE;
1691  strat->Ll--;
1692  //printf("\nThis is P:\n");p_Write(strat->P.p,strat->tailRing);p_Write(strat->P.p1,strat->tailRing);p_Write(strat->P.p2,strat->tailRing);
1693  // create the real Spoly
1694  if (pNext(strat->P.p) == strat->tail)
1695  {
1696  /*- deletes the short spoly and computes -*/
1697 #ifdef HAVE_RINGS
1698  if (rField_is_Ring(currRing))
1699  pLmDelete(strat->P.p);
1700  else
1701 #endif
1702  pLmFree(strat->P.p);
1703  strat->P.p = NULL;
1704  poly m1 = NULL, m2 = NULL;
1705  // check that spoly creation is ok
1706  while (strat->tailRing != currRing &&
1707  !kCheckSpolyCreation(&(strat->P), strat, m1, m2))
1708  {
1709  assume(m1 == NULL && m2 == NULL);
1710  // if not, change to a ring where exponents are large enough
1711  kStratChangeTailRing(strat);
1712  }
1713  /* create the real one */
1714  ksCreateSpoly(&(strat->P), strat->kNoetherTail(), strat->use_buckets,
1715  strat->tailRing, m1, m2, strat->R);
1716  if (!strat->use_buckets)
1717  strat->P.SetLength(strat->length_pLength);
1718  }
1719  else if (strat->P.p1 == NULL)
1720  {
1721  // for input polys, prepare reduction (buckets !)
1722  strat->P.SetLength(strat->length_pLength);
1723  strat->P.PrepareRed(strat->use_buckets);
1724  }
1725 
1726  if (!strat->P.IsNull())
1727  {
1728  // might be NULL from noether !!!
1729  if (TEST_OPT_PROT)
1730  message(strat->P.ecart+strat->P.GetpFDeg(),&olddeg,&reduc,strat, red_result);
1731  // reduce
1732  #if ADIDEBUG
1733  printf("\nThis is P vor red:\n");p_Write(strat->P.p,strat->tailRing);p_Write(strat->P.p1,strat->tailRing);p_Write(strat->P.p2,strat->tailRing);
1734  printf("\nBefore Ll = %i\n", strat->Ll);
1735  #endif
1736  #ifdef HAVE_RINGS
1737  if(rField_is_Ring(strat->tailRing) && rHasLocalOrMixedOrdering(currRing))
1738  {
1739  //int inittl = strat->tl;
1740  red_result = strat->red(&strat->P,strat);
1741  //strat->tl = inittl;
1742  }
1743  else
1744  #endif
1745  red_result = strat->red(&strat->P,strat);
1746  #if ADIDEBUG
1747  printf("\nThis is P nach red:\n");p_Write(strat->P.p,strat->tailRing);p_Write(strat->P.p1,strat->tailRing);p_Write(strat->P.p2,strat->tailRing);
1748  printf("\nAfter Ll = %i\n", strat->Ll);
1749  #endif
1750  }
1751 
1752  if (! strat->P.IsNull())
1753  {
1754  strat->P.GetP();
1755  // statistics
1756  if (TEST_OPT_PROT) PrintS("s");
1757  // normalization
1758  if (!TEST_OPT_INTSTRATEGY)
1759  strat->P.pNorm();
1760  // tailreduction
1761  strat->P.p = redtail(&(strat->P),strat->sl,strat);
1762  if (strat->P.p==NULL)
1763  {
1764  WerrorS("expoent overflow - wrong ordering");
1765  return(idInit(1,1));
1766  }
1767  // set ecart -- might have changed because of tail reductions
1768  if ((!strat->noTailReduction) && (!strat->honey))
1769  strat->initEcart(&strat->P);
1770  // cancel unit
1771  cancelunit(&strat->P);
1772  // for char 0, clear denominators
1774  strat->P.pCleardenom();
1775 
1776  // put in T
1777  //if(red_result!=3)
1778  {
1779  #ifdef HAVE_RINGS
1780  if(rField_is_Ring(strat->tailRing) && rHasLocalOrMixedOrdering(currRing))
1781  {
1782  //int inittl = strat->tl;
1783  enterT(strat->P,strat);
1784  //enterT_strong(strat->P,strat);
1785  //strat->tl = inittl+1;
1786  }
1787  else
1788  #endif
1789  enterT(strat->P,strat);
1790  //enterT_strong(strat->P,strat);
1791  }
1792  // build new pairs
1793 #ifdef HAVE_RINGS
1794  if (rField_is_Ring(currRing))
1795  {
1796  superenterpairs(strat->P.p,strat->sl,strat->P.ecart,0,strat, strat->tl);
1797  }
1798  else
1799 #endif
1800  enterpairs(strat->P.p,strat->sl,strat->P.ecart,0,strat, strat->tl);
1801  // put in S
1802 
1803  #if ADIDEBUG
1804  Print("\n The new pair list L -- after superenterpairs in loop %d -- is:\n",loop_count);
1805  for(int iii=0;iii<=strat->Ll;iii++)
1806  {
1807  printf("\n L[%d]:\n",iii);
1808  PrintS(" ");p_Write(strat->L[iii].p,strat->tailRing);
1809  PrintS(" ");p_Write(strat->L[iii].p1,strat->tailRing);
1810  PrintS(" ");p_Write(strat->L[iii].p2,strat->tailRing);
1811  }
1812  #endif
1813  //if(red_result!=3)
1814  strat->enterS(strat->P,
1815  posInS(strat,strat->sl,strat->P.p, strat->P.ecart),
1816  strat, strat->tl);
1817  #if ADIDEBUG
1818  printf("\nThis pair has been added to S:\n");
1819  pWrite(strat->P.p);
1820  pWrite(strat->P.p1);
1821  pWrite(strat->P.p2);
1822  #endif
1823 
1824  // apply hilbert criterion
1825  if (hilb!=NULL)
1826  {
1827  if (strat->homog==isHomog)
1828  khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
1829  else
1830  khCheckLocInhom(Q,w,hilb,hilbcount,strat);
1831  }
1832 
1833  // clear strat->P
1834  if (strat->P.lcm!=NULL)
1835 #if defined(HAVE_RINGS)
1836  pLmDelete(strat->P.lcm);
1837 #else
1838  pLmFree(strat->P.lcm);
1839 #endif
1840  strat->P.lcm=NULL;
1841 #ifdef KDEBUG
1842  // make sure kTest_TS does not complain about strat->P
1843  memset(&strat->P,0,sizeof(strat->P));
1844 #endif
1845  }
1846  if (strat->kHEdgeFound)
1847  {
1848  if ((TEST_OPT_FINDET)
1849  || ((TEST_OPT_MULTBOUND) && (scMult0Int(strat->Shdl,NULL,strat->tailRing) < Kstd1_mu)))
1850  {
1851  // obachman: is this still used ???
1852  /*
1853  * stops computation if strat->kHEdgeFound and
1854  * - 27 (finiteDeterminacyTest)
1855  * or
1856  * - 23
1857  * (multBound)
1858  * && multiplicity of the ideal is smaller then a predefined number mu
1859  */
1860  while (strat->Ll >= 0) deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
1861  }
1862  }
1863  kTest_TS(strat);
1864 
1865 #if ADIDEBUG
1866  Print("\n The new reducer list T -- at the end of loop %d -- is\n",loop_count);
1867  for(int iii=0;iii<=strat->tl;iii++)
1868  {
1869  printf("\n T[%d]:",iii);
1870  p_Write(strat->T[iii].p,strat->tailRing);
1871  }
1872  PrintLn();
1873 
1874  loop_count++;
1875 #endif /* ADIDEBUG */
1876  }
1877  /*- complete reduction of the standard basis------------------------ -*/
1878  if (TEST_OPT_REDSB) completeReduce(strat);
1879  else if (TEST_OPT_PROT) PrintLn();
1880  /*- release temp data------------------------------- -*/
1881  exitBuchMora(strat);
1882  /*- polynomials used for HECKE: HC, noether -*/
1883  if (TEST_OPT_FINDET)
1884  {
1885  if (strat->kHEdge!=NULL)
1886  Kstd1_mu=currRing->pFDeg(strat->kHEdge,currRing);
1887  else
1888  Kstd1_mu=-1;
1889  }
1890  pDelete(&strat->kHEdge);
1891  strat->update = TRUE; //???
1892  strat->lastAxis = 0; //???
1893  pDelete(&strat->kNoether);
1894  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
1895  if ((TEST_OPT_PROT)||(TEST_OPT_DEBUG)) messageStat(hilbcount,strat);
1896 // if (TEST_OPT_WEIGHTM)
1897 // {
1898 // pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
1899 // if (ecartWeights)
1900 // {
1901 // omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
1902 // ecartWeights=NULL;
1903 // }
1904 // }
1905 #ifdef HAVE_RINGS
1906  if(nCoeff_is_Ring_Z(currRing->cf))
1907  finalReduceByMon(strat);
1908 #endif
1909  if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
1910  SI_RESTORE_OPT1(save1);
1911  idTest(strat->Shdl);
1912  return (strat->Shdl);
1913 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:753
#define OPT_REDSB
Definition: options.h:71
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.h:280
unsigned si_opt_1
Definition: options.c:5
poly redtail(LObject *L, int pos, kStrategy strat)
Definition: kutil.cc:5971
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
#define TEST_OPT_DEGBOUND
Definition: options.h:108
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:8240
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
Definition: kutil.cc:6274
void initMora(ideal F, kStrategy strat)
Definition: kstd1.cc:1512
BOOLEAN length_pLength
Definition: kutil.h:377
void messageStat(int hilbcount, kStrategy strat)
Definition: kutil.cc:6315
#define TEST_OPT_PROT
Definition: options.h:98
int Ll
Definition: kutil.h:349
#define FALSE
Definition: auxiliary.h:140
void initBuchMora(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:8334
int redFirst(LObject *h, kStrategy strat)
Definition: kstd1.cc:613
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
Definition: coeffs.h:750
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
Definition: kutil.cc:3984
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:76
#define TEST_OPT_MULTBOUND
Definition: options.h:109
char noClearS
Definition: kutil.h:392
#define TRUE
Definition: auxiliary.h:144
#define TEST_OPT_REDSB
Definition: options.h:99
void * ADDRESS
Definition: auxiliary.h:161
#define SI_SAVE_OPT1(A)
Definition: options.h:20
void pWrite(poly p)
Definition: polys.h:279
void cancelunit(LObject *L, BOOLEAN inNF)
Definition: kutil.cc:324
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define TEST_OPT_DEBUG
Definition: options.h:103
#define Q
Definition: sirandom.c:25
#define BITSET
Definition: structs.h:17
int(* red)(LObject *L, kStrategy strat)
Definition: kutil.h:274
#define Sy_bit(x)
Definition: options.h:30
void updateL(kStrategy strat)
Definition: kstd1.cc:1079
int lastAxis
Definition: kutil.h:354
void kStratInitChangeTailRing(kStrategy strat)
Definition: kutil.cc:9460
int Kstd1_mu
Definition: kutil.cc:229
#define TEST_OPT_FINDET
Definition: options.h:106
void enterT(LObject &p, kStrategy strat, int atT)
Definition: kutil.cc:7807
void missingAxis(int *last, kStrategy strat)
Definition: kstd1.cc:965
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition: kutil.cc:1049
BOOLEAN interpt
Definition: kutil.h:361
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
BOOLEAN homog
Definition: kutil.h:362
#define TEST_OPT_INTSTRATEGY
Definition: options.h:105
#define kTest_TS(A)
Definition: kutil.h:620
#define OPT_REDTAIL
Definition: options.h:86
void initHilbCrit(ideal, ideal, intvec **hilb, kStrategy strat)
Definition: kutil.cc:8068
int scMult0Int(ideal S, ideal Q, const ring tailRing)
Definition: hdegree.cc:919
#define assume(x)
Definition: mod2.h:405
#define messageSets(s)
Definition: kutil.h:508
void updateLHC(kStrategy strat)
Definition: kstd1.cc:1153
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
Definition: kspoly.cc:379
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject *T, unsigned long expbound)
Definition: kutil.cc:9357
LObject P
Definition: kutil.h:298
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:8088
void reorderL(kStrategy strat)
Definition: kstd1.cc:907
BOOLEAN update
Definition: kutil.h:371
void PrintS(const char *s)
Definition: reporter.cc:294
poly tail
Definition: kutil.h:332
int(* posInLOld)(const LSet Ls, const int Ll, LObject *Lo, const kStrategy strat)
Definition: kutil.h:284
TObject ** R
Definition: kutil.h:338
polyset S
Definition: kutil.h:302
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
Definition: kutil.cc:8990
#define BVERBOSE(a)
Definition: options.h:33
int int kStrategy strat
Definition: myNF.cc:68
void khCheck(ideal Q, intvec *w, intvec *hilb, int &eledeg, int &count, kStrategy strat)
Definition: khstd.cc:35
BOOLEAN kHEdgeFound
Definition: kutil.h:366
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
LSet L
Definition: kutil.h:323
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#define NULL
Definition: omList.c:10
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
Definition: kutil.cc:3900
void firstUpdate(kStrategy strat)
Definition: kstd1.cc:1247
ring tailRing
Definition: kutil.h:341
void khCheckLocInhom(ideal Q, intvec *w, intvec *hilb, int &count, kStrategy strat)
Definition: khstd.cc:140
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
Definition: kutil.cc:4197
#define pDelete(p_ptr)
Definition: polys.h:157
BOOLEAN posInLOldFlag
Definition: kutil.h:372
void completeReduce(kStrategy strat, BOOLEAN withT)
Definition: kutil.cc:8797
#define pNext(p)
Definition: monomials.h:43
void updateResult(ideal r, ideal Q, kStrategy strat)
Definition: kutil.cc:8644
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:70
int sl
Definition: kutil.h:346
static BOOLEAN kMoraUseBucket(kStrategy strat)
Definition: kstd1.cc:3355
BOOLEAN use_buckets
Definition: kutil.h:373
void p_Write(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:206
#define TEST_OPT_FASTHC
Definition: options.h:104
polyrec * poly
Definition: hilb.h:10
int Kstd1_deg
Definition: kutil.cc:228
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
Definition: kutil.cc:9290
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
KINLINE poly kNoetherTail()
Definition: kInline.h:63
#define SI_RESTORE_OPT1(A)
Definition: options.h:23
void exitBuchMora(kStrategy strat)
Definition: kutil.cc:8415
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
Definition: kstd1.cc:1046
void kDebugPrint(kStrategy strat)
Definition: kutil.cc:9903
#define idTest(id)
Definition: ideals.h:60
ideal stdred ( ideal  F,
ideal  Q,
tHomog  h,
intvec **  w 
)

Variable Documentation

intvec* kHomW

Definition at line 2196 of file kstd1.cc.

intvec* kModW

Definition at line 2196 of file kstd1.cc.

BITSET kOptions

Definition at line 55 of file kstd1.cc.

int Kstd1_deg

Definition at line 228 of file kutil.cc.

int Kstd1_mu

Definition at line 229 of file kutil.cc.

int LazyDegree
int LazyPass
BITSET validOpts

Definition at line 70 of file kstd1.cc.