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 1509 of file kstd1.cc.

1510 {
1511  int i,j;
1512 
1513  strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN));
1514  for (j=(currRing->N); j>0; j--) strat->NotUsedAxis[j] = TRUE;
1515  strat->enterS = enterSMora;
1516  strat->initEcartPair = initEcartPairMora; /*- ecart approximation -*/
1517  strat->posInLOld = strat->posInL;
1518  strat->posInLOldFlag = TRUE;
1519  strat->initEcart = initEcartNormal;
1520  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
1521  if ( strat->kHEdgeFound )
1522  strat->kNoether = pCopy((currRing->ppNoether));
1523  else if (strat->kHEdgeFound || strat->homog)
1524  strat->red = redFirst; /*take the first possible in T*/
1525  else
1526  strat->red = redEcart;/*take the first possible in under ecart-restriction*/
1527  if (strat->kHEdgeFound)
1528  {
1529  strat->HCord = currRing->pFDeg((currRing->ppNoether),currRing)+1;
1530  strat->posInT = posInT2;
1531  }
1532  else
1533  {
1534  strat->HCord = 32000;/*- very large -*/
1535  }
1536 
1537 #ifdef HAVE_RINGS
1538  if (rField_is_Ring(currRing))
1539  strat->red = redRiloc;
1540 #endif
1541 
1542  /*reads the ecartWeights used for Graebes method from the
1543  *intvec ecart and set ecartWeights
1544  */
1545  if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
1546  {
1547  //interred machen Aenderung
1548  strat->pOrigFDeg=currRing->pFDeg;
1549  strat->pOrigLDeg=currRing->pLDeg;
1550  ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
1551  /*uses automatic computation of the ecartWeights to set them*/
1553 
1555  if (TEST_OPT_PROT)
1556  {
1557  for(i=1; i<=(currRing->N); i++)
1558  Print(" %d",ecartWeights[i]);
1559  PrintLn();
1560  mflush();
1561  }
1562  }
1563  kOptimizeLDeg(currRing->pLDeg, strat);
1564 }
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:3492
void enterSMora(LObject &p, int atS, kStrategy strat, int atR=-1)
Definition: kstd1.cc:1321
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:434
#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 2919 of file kstd1.cc.

2920 {
2921  const ring save = currRing;
2922  if( currRing != _currRing ) rChangeCurrRing(_currRing);
2923  poly ret = kNF(F, Q, p, syzComp, lazyReduce);
2924  if( currRing != save ) rChangeCurrRing(save);
2925  return ret;
2926 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2819
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 2212 of file kstd1.cc.

2213 {
2214  int i;
2215  long j=0;
2216 
2217  for (i=r->N;i>0;i--)
2218  j+=p_GetExp(p,i,r)*(*kHomW)[i-1];
2219  if (kModW == NULL) return j;
2220  i = p_GetComp(p,r);
2221  if (i==0) return j;
2222  return j+(*kModW)[i-1];
2223 }
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:2200
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:464
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 3281 of file kstd1.cc.

3282 {
3283 #ifdef HAVE_PLURAL
3284  if(rIsPluralRing(currRing)) return kInterRedOld(F,Q);
3285 #endif
3287  #ifdef HAVE_RINGS
3289  #endif
3290  )
3291  return kInterRedOld(F,Q);
3292 
3293  //return kInterRedOld(F,Q);
3294 
3295  BITSET save1;
3296  SI_SAVE_OPT1(save1);
3297  //si_opt_1|=Sy_bit(OPT_NOT_SUGAR);
3299  //si_opt_1&= ~Sy_bit(OPT_REDTAIL);
3300  //si_opt_1&= ~Sy_bit(OPT_REDSB);
3301  //extern char * showOption() ;
3302  //Print("%s\n",showOption());
3303 
3304  int need_retry;
3305  int counter=3;
3306  ideal res, res1;
3307  int elems;
3308  ideal null=NULL;
3309  if ((Q==NULL) || (!TEST_OPT_REDSB))
3310  {
3311  elems=idElem(F);
3312  res=kInterRedBba(F,Q,need_retry);
3313  }
3314  else
3315  {
3316  ideal FF=idSimpleAdd(F,Q);
3317  res=kInterRedBba(FF,NULL,need_retry);
3318  idDelete(&FF);
3319  null=idInit(1,1);
3320  if (need_retry)
3321  res1=kNF(null,Q,res,0,KSTD_NF_LAZY);
3322  else
3323  res1=kNF(null,Q,res);
3324  idDelete(&res);
3325  res=res1;
3326  need_retry=1;
3327  }
3328  if (idElem(res)<=1) need_retry=0;
3329  while (need_retry && (counter>0))
3330  {
3331  #ifdef KDEBUG
3332  if (TEST_OPT_DEBUG) { Print("retry counter %d\n",counter); }
3333  #endif
3334  res1=kInterRedBba(res,Q,need_retry);
3335  int new_elems=idElem(res1);
3336  counter -= (new_elems >= elems);
3337  elems = new_elems;
3338  idDelete(&res);
3339  if (idElem(res1)<=1) need_retry=0;
3340  if ((Q!=NULL) && (TEST_OPT_REDSB))
3341  {
3342  if (need_retry)
3343  res=kNF(null,Q,res1,0,KSTD_NF_LAZY);
3344  else
3345  res=kNF(null,Q,res1);
3346  idDelete(&res1);
3347  }
3348  else
3349  res = res1;
3350  if (idElem(res)<=1) need_retry=0;
3351  }
3352  if (null!=NULL) idDelete(&null);
3353  SI_RESTORE_OPT1(save1);
3354  idSkipZeroes(res);
3355  return res;
3356 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
unsigned si_opt_1
Definition: options.c:5
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2819
#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
#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:3023
#define KSTD_NF_LAZY
Definition: kstd1.h:17
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
ideal kInterRedOld(ideal F, ideal Q)
Definition: kstd1.cc:2932
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:434
#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:461
ideal kInterRedOld ( ideal  F,
ideal  Q = NULL 
)

Definition at line 2932 of file kstd1.cc.

2933 {
2934  int j;
2935  kStrategy strat = new skStrategy;
2936 
2937  ideal tempF = F;
2938  ideal tempQ = Q;
2939 
2940 #ifdef HAVE_PLURAL
2941  if(rIsSCA(currRing))
2942  {
2943  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
2944  const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
2945  tempF = id_KillSquares(F, m_iFirstAltVar, m_iLastAltVar, currRing);
2946 
2947  // this should be done on the upper level!!! :
2948  // tempQ = SCAQuotient(currRing);
2949 
2950  if(Q == currRing->qideal)
2951  tempQ = SCAQuotient(currRing);
2952  }
2953 #endif
2954 
2955 // if (TEST_OPT_PROT)
2956 // {
2957 // writeTime("start InterRed:");
2958 // mflush();
2959 // }
2960  //strat->syzComp = 0;
2961  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
2962  strat->kNoether=pCopy((currRing->ppNoether));
2963  strat->ak = id_RankFreeModule(tempF,currRing);
2964  initBuchMoraCrit(strat);
2965  strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN));
2966  for (j=(currRing->N); j>0; j--) strat->NotUsedAxis[j] = TRUE;
2967  strat->enterS = enterSBba;
2968  strat->posInT = posInT17;
2969  strat->initEcart = initEcartNormal;
2970  strat->sl = -1;
2971  strat->tl = -1;
2972  strat->tmax = setmaxT;
2973  strat->T = initT();
2974  strat->R = initR();
2975  strat->sevT = initsevT();
2977  initS(tempF, tempQ, strat);
2978  if (TEST_OPT_REDSB)
2979  strat->noTailReduction=FALSE;
2980  updateS(TRUE,strat);
2982  completeReduce(strat);
2983  //else if (TEST_OPT_PROT) PrintLn();
2984  pDelete(&strat->kHEdge);
2985  omFreeSize((ADDRESS)strat->T,strat->tmax*sizeof(TObject));
2986  omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
2987  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
2988  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
2989  omfree(strat->sevT);
2990  omfree(strat->S_2_R);
2991  omfree(strat->R);
2992 
2993  if (strat->fromQ)
2994  {
2995  for (j=IDELEMS(strat->Shdl)-1;j>=0;j--)
2996  {
2997  if(strat->fromQ[j]) pDelete(&strat->Shdl->m[j]);
2998  }
2999  omFreeSize((ADDRESS)strat->fromQ,IDELEMS(strat->Shdl)*sizeof(int));
3000  }
3001 // if (TEST_OPT_PROT)
3002 // {
3003 // writeTime("end Interred:");
3004 // mflush();
3005 // }
3006  ideal shdl=strat->Shdl;
3007  idSkipZeroes(shdl);
3008  if (strat->fromQ)
3009  {
3010  strat->fromQ=NULL;
3011  ideal res=kInterRed(shdl,NULL);
3012  idDelete(&shdl);
3013  shdl=res;
3014  }
3015  delete(strat);
3016 #ifdef HAVE_PLURAL
3017  if( tempF != F )
3018  id_Delete( &tempF, currRing);
3019 #endif
3020  return shdl;
3021 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
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:3281
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 2668 of file kstd1.cc.

2670 {
2671  if(idIs0(F))
2672  {
2673  M=idInit(1,F->rank);
2674  return idInit(1,F->rank);
2675  }
2676  #ifdef HAVE_RINGS
2678  {
2679  ideal sb;
2680  sb = kStd(F, Q, h, w, hilb);
2681  idSkipZeroes(sb);
2682  if(IDELEMS(sb) <= IDELEMS(F))
2683  {
2684  M = idCopy(sb);
2685  idSkipZeroes(M);
2686  return(sb);
2687  }
2688  else
2689  {
2690  M = idCopy(F);
2691  idSkipZeroes(M);
2692  return(sb);
2693  }
2694  }
2695  #endif
2696  ideal r=NULL;
2697  int Kstd1_OldDeg = Kstd1_deg,i;
2698  intvec* temp_w=NULL;
2699  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
2700  BOOLEAN delete_w=(w==NULL);
2701  BOOLEAN oldDegBound=TEST_OPT_DEGBOUND;
2703 
2704  if(!TEST_OPT_RETURN_SB)
2705  strat->syzComp = syzComp;
2707  strat->LazyPass=20;
2708  else
2709  strat->LazyPass=2;
2710  strat->LazyDegree = 1;
2711  strat->minim=(reduced % 2)+1;
2712  strat->ak = id_RankFreeModule(F,currRing);
2713  if (delete_w)
2714  {
2715  temp_w=new intvec((strat->ak)+1);
2716  w = &temp_w;
2717  }
2718  if (h==testHomog)
2719  {
2720  if (strat->ak == 0)
2721  {
2722  h = (tHomog)idHomIdeal(F,Q);
2723  w=NULL;
2724  }
2725  else
2726  {
2727  h = (tHomog)idHomModule(F,Q,w);
2728  }
2729  }
2730  if (h==isHomog)
2731  {
2732  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2733  {
2734  kModW = *w;
2735  strat->kModW = *w;
2736  assume(currRing->pFDeg != NULL && currRing->pLDeg != NULL);
2737  strat->pOrigFDeg = currRing->pFDeg;
2738  strat->pOrigLDeg = currRing->pLDeg;
2740 
2741  toReset = TRUE;
2742  if (reduced>1)
2743  {
2744  Kstd1_OldDeg=Kstd1_deg;
2745  Kstd1_deg = -1;
2746  for (i=IDELEMS(F)-1;i>=0;i--)
2747  {
2748  if ((F->m[i]!=NULL) && (currRing->pFDeg(F->m[i],currRing)>=Kstd1_deg))
2749  Kstd1_deg = currRing->pFDeg(F->m[i],currRing)+1;
2750  }
2751  }
2752  }
2753  currRing->pLexOrder = TRUE;
2754  strat->LazyPass*=2;
2755  }
2756  strat->homog=h;
2758  {
2759  if (w!=NULL)
2760  r=mora(F,Q,*w,hilb,strat);
2761  else
2762  r=mora(F,Q,NULL,hilb,strat);
2763  }
2764  else
2765  {
2766  if (w!=NULL)
2767  r=bba(F,Q,*w,hilb,strat);
2768  else
2769  r=bba(F,Q,NULL,hilb,strat);
2770  }
2771 #ifdef KDEBUG
2772  {
2773  int i;
2774  for (i=IDELEMS(r)-1; i>=0; i--) pTest(r->m[i]);
2775  }
2776 #endif
2777  idSkipZeroes(r);
2778  if (toReset)
2779  {
2780  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2781  kModW = NULL;
2782  }
2783  currRing->pLexOrder = b;
2784  HCord=strat->HCord;
2785  if ((delete_w)&&(temp_w!=NULL)) delete temp_w;
2786  if ((IDELEMS(r)==1) && (r->m[0]!=NULL) && pIsConstant(r->m[0]) && (strat->ak==0))
2787  {
2788  M=idInit(1,F->rank);
2789  M->m[0]=pOne();
2790  //if (strat->ak!=0) { pSetComp(M->m[0],strat->ak); pSetmComp(M->m[0]); }
2791  if (strat->M!=NULL) idDelete(&strat->M);
2792  }
2793  else if (strat->M==NULL)
2794  {
2795  M=idInit(1,F->rank);
2796  Warn("no minimal generating set computed");
2797  }
2798  else
2799  {
2800  idSkipZeroes(strat->M);
2801  M=strat->M;
2802  }
2803  delete(strat);
2804  if (reduced>2)
2805  {
2806  Kstd1_deg=Kstd1_OldDeg;
2807  if (!oldDegBound)
2809  }
2810  else
2811  {
2812  if (IDELEMS(M)>IDELEMS(r)) {
2813  idDelete(&M);
2814  M=idCopy(r); }
2815  }
2816  return r;
2817 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
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:2225
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:494
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:2200
BOOLEAN homog
Definition: kutil.h:362
Definition: intvec.h:14
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:3492
#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:3504
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:434
#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:2202
#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:1568
#define Warn
Definition: emacs.cc:80
long kModDeg ( poly  p,
ring  r = currRing 
)

Definition at line 2202 of file kstd1.cc.

2203 {
2204  long o=p_WDegree(p, r);
2205  long i=p_GetComp(p, r);
2206  if (i==0) return o;
2207  //assume((i>0) && (i<=kModW->length()));
2208  if (i<=kModW->length())
2209  return o+(*kModW)[i-1];
2210  return o;
2211 }
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 2819 of file kstd1.cc.

2820 {
2821  if (p==NULL)
2822  return NULL;
2823 
2824  poly pp = p;
2825 
2826 #ifdef HAVE_PLURAL
2827  if(rIsSCA(currRing))
2828  {
2829  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
2830  const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
2831  pp = p_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing);
2832 
2833  if(Q == currRing->qideal)
2834  Q = SCAQuotient(currRing);
2835  }
2836 #endif
2837 
2838  if ((idIs0(F))&&(Q==NULL))
2839  {
2840 #ifdef HAVE_PLURAL
2841  if(p != pp)
2842  return pp;
2843 #endif
2844  return pCopy(p); /*F+Q=0*/
2845  }
2846 
2848  strat->syzComp = syzComp;
2849  strat->ak = si_max(id_RankFreeModule(F,currRing),pMaxComp(p));
2850  poly res;
2851 
2853  res=kNF1(F,Q,pp,strat,lazyReduce);
2854  else
2855  res=kNF2(F,Q,pp,strat,lazyReduce);
2856  delete(strat);
2857 
2858 #ifdef HAVE_PLURAL
2859  if(pp != p)
2860  p_Delete(&pp, currRing);
2861 #endif
2862  return res;
2863 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
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:1919
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:849
#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 2865 of file kstd1.cc.

2866 {
2867  ideal res;
2868  if (TEST_OPT_PROT)
2869  {
2870  Print("(S:%d)",IDELEMS(p));mflush();
2871  }
2872  if (idIs0(p))
2873  return idInit(IDELEMS(p),si_max(p->rank,F->rank));
2874 
2875  ideal pp = p;
2876 #ifdef HAVE_PLURAL
2877  if(rIsSCA(currRing))
2878  {
2879  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
2880  const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
2881  pp = id_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing, false);
2882 
2883  if(Q == currRing->qideal)
2884  Q = SCAQuotient(currRing);
2885  }
2886 #endif
2887 
2888  if ((idIs0(F))&&(Q==NULL))
2889  {
2890 #ifdef HAVE_PLURAL
2891  if(p != pp)
2892  return pp;
2893 #endif
2894  return idCopy(p); /*F+Q=0*/
2895  }
2896 
2898  strat->syzComp = syzComp;
2900  if (strat->ak>0) // only for module case, see Tst/Short/bug_reduce.tst
2901  {
2902  strat->ak = si_max(strat->ak,(int)F->rank);
2903  }
2904 
2906  res=kNF1(F,Q,pp,strat,lazyReduce);
2907  else
2908  res=kNF2(F,Q,pp,strat,lazyReduce);
2909  delete(strat);
2910 
2911 #ifdef HAVE_PLURAL
2912  if(pp != p)
2913  id_Delete(&pp, currRing);
2914 #endif
2915 
2916  return res;
2917 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
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:1919
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 1919 of file kstd1.cc.

1920 {
1921  assume(q!=NULL);
1922  assume(!(idIs0(F)&&(Q==NULL)));
1923 
1924 // lazy_reduce flags: can be combined by |
1925 //#define KSTD_NF_LAZY 1
1926  // do only a reduction of the leading term
1927 //#define KSTD_NF_ECART 2
1928  // only local: recude even with bad ecart
1929  poly p;
1930  int i;
1931  int j;
1932  int o;
1933  LObject h;
1934  BITSET save1;
1935  SI_SAVE_OPT1(save1);
1936 
1937  //if ((idIs0(F))&&(Q==NULL))
1938  // return pCopy(q); /*F=0*/
1939  //strat->ak = si_max(idRankFreeModule(F),pMaxComp(q));
1940  /*- creating temp data structures------------------- -*/
1941  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
1942  strat->kNoether = pCopy((currRing->ppNoether));
1946  && (! TEST_V_DEG_STOP)
1947  && (0<Kstd1_deg)
1948  && ((!strat->kHEdgeFound)
1950  {
1951  pDelete(&strat->kNoether);
1952  strat->kNoether=pOne();
1953  pSetExp(strat->kNoether,1, Kstd1_deg+1);
1954  pSetm(strat->kNoether);
1955  strat->kHEdgeFound=TRUE;
1956  }
1957  initBuchMoraCrit(strat);
1958  initBuchMoraPos(strat);
1959  initMora(F,strat);
1960  strat->enterS = enterSMoraNF;
1961  /*- set T -*/
1962  strat->tl = -1;
1963  strat->tmax = setmaxT;
1964  strat->T = initT();
1965  strat->R = initR();
1966  strat->sevT = initsevT();
1967  /*- set S -*/
1968  strat->sl = -1;
1969  /*- init local data struct.-------------------------- -*/
1970  /*Shdl=*/initS(F,Q,strat);
1971  if ((strat->ak!=0)
1972  && (strat->kHEdgeFound))
1973  {
1974  if (strat->ak!=1)
1975  {
1976  pSetComp(strat->kNoether,1);
1977  pSetmComp(strat->kNoether);
1978  poly p=pHead(strat->kNoether);
1979  pSetComp(p,strat->ak);
1980  pSetmComp(p);
1981  p=pAdd(strat->kNoether,p);
1982  strat->kNoether=pNext(p);
1983  p_LmFree(p,currRing);
1984  }
1985  }
1986  if ((lazyReduce & KSTD_NF_LAZY)==0)
1987  {
1988  for (i=strat->sl; i>=0; i--)
1989  pNorm(strat->S[i]);
1990  }
1991  /*- puts the elements of S also to T -*/
1992  for (i=0; i<=strat->sl; i++)
1993  {
1994  h.p = strat->S[i];
1995  h.ecart = strat->ecartS[i];
1996  if (strat->sevS[i] == 0) strat->sevS[i] = pGetShortExpVector(h.p);
1997  else assume(strat->sevS[i] == pGetShortExpVector(h.p));
1998  h.length = pLength(h.p);
1999  h.sev = strat->sevS[i];
2000  h.SetpFDeg();
2001  enterT(h,strat);
2002  }
2003 #ifdef KDEBUG
2004 // kDebugPrint(strat);
2005 #endif
2006  /*- compute------------------------------------------- -*/
2007  p = pCopy(q);
2008  deleteHC(&p,&o,&j,strat);
2009  kTest(strat);
2010  if (TEST_OPT_PROT) { PrintS("r"); mflush(); }
2011  if (BVERBOSE(23)) kDebugPrint(strat);
2012  if (p!=NULL) p = redMoraNF(p,strat, lazyReduce & KSTD_NF_ECART);
2013  if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
2014  {
2015  if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
2016  p = redtail(p,strat->sl,strat);
2017  }
2018  /*- release temp data------------------------------- -*/
2019  cleanT(strat);
2020  assume(strat->L==NULL); /*strat->L unsed */
2021  assume(strat->B==NULL); /*strat->B unused */
2022  omFreeSize((ADDRESS)strat->T,strat->tmax*sizeof(TObject));
2023  omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
2024  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
2025  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
2026  omFree(strat->sevT);
2027  omFree(strat->S_2_R);
2028  omFree(strat->R);
2029 
2030  if ((Q!=NULL)&&(strat->fromQ!=NULL))
2031  {
2032  i=((IDELEMS(Q)+IDELEMS(F)+15)/16)*16;
2033  omFreeSize((ADDRESS)strat->fromQ,i*sizeof(int));
2034  strat->fromQ=NULL;
2035  }
2036  pDelete(&strat->kHEdge);
2037  pDelete(&strat->kNoether);
2038 // if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
2039 // {
2040 // pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2041 // if (ecartWeights)
2042 // {
2043 // omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
2044 // ecartWeights=NULL;
2045 // }
2046 // }
2047  idDelete(&strat->Shdl);
2048  SI_RESTORE_OPT1(save1);
2049  if (TEST_OPT_PROT) PrintLn();
2050  return p;
2051 }
#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:1509
#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:678
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:1375
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 2053 of file kstd1.cc.

2054 {
2055  assume(!idIs0(q));
2056  assume(!(idIs0(F)&&(Q==NULL)));
2057 
2058 // lazy_reduce flags: can be combined by |
2059 //#define KSTD_NF_LAZY 1
2060  // do only a reduction of the leading term
2061 //#define KSTD_NF_ECART 2
2062  // only local: recude even with bad ecart
2063  poly p;
2064  int i;
2065  int j;
2066  int o;
2067  LObject h;
2068  ideal res;
2069  BITSET save1;
2070  SI_SAVE_OPT1(save1);
2071 
2072  //if (idIs0(q)) return idInit(IDELEMS(q),si_max(q->rank,F->rank));
2073  //if ((idIs0(F))&&(Q==NULL))
2074  // return idCopy(q); /*F=0*/
2075  //strat->ak = si_max(idRankFreeModule(F),idRankFreeModule(q));
2076  /*- creating temp data structures------------------- -*/
2077  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
2078  strat->kNoether=pCopy((currRing->ppNoether));
2081  && (0<Kstd1_deg)
2082  && ((!strat->kHEdgeFound)
2084  {
2085  pDelete(&strat->kNoether);
2086  strat->kNoether=pOne();
2087  pSetExp(strat->kNoether,1, Kstd1_deg+1);
2088  pSetm(strat->kNoether);
2089  strat->kHEdgeFound=TRUE;
2090  }
2091  initBuchMoraCrit(strat);
2092  initBuchMoraPos(strat);
2093  initMora(F,strat);
2094  strat->enterS = enterSMoraNF;
2095  /*- set T -*/
2096  strat->tl = -1;
2097  strat->tmax = setmaxT;
2098  strat->T = initT();
2099  strat->R = initR();
2100  strat->sevT = initsevT();
2101  /*- set S -*/
2102  strat->sl = -1;
2103  /*- init local data struct.-------------------------- -*/
2104  /*Shdl=*/initS(F,Q,strat);
2105  if ((strat->ak!=0)
2106  && (strat->kHEdgeFound))
2107  {
2108  if (strat->ak!=1)
2109  {
2110  pSetComp(strat->kNoether,1);
2111  pSetmComp(strat->kNoether);
2112  poly p=pHead(strat->kNoether);
2113  pSetComp(p,strat->ak);
2114  pSetmComp(p);
2115  p=pAdd(strat->kNoether,p);
2116  strat->kNoether=pNext(p);
2117  p_LmFree(p,currRing);
2118  }
2119  }
2121  {
2122  for (i=strat->sl; i>=0; i--)
2123  pNorm(strat->S[i]);
2124  }
2125  /*- compute------------------------------------------- -*/
2126  res=idInit(IDELEMS(q),strat->ak);
2127  for (i=0; i<IDELEMS(q); i++)
2128  {
2129  if (q->m[i]!=NULL)
2130  {
2131  p = pCopy(q->m[i]);
2132  deleteHC(&p,&o,&j,strat);
2133  if (p!=NULL)
2134  {
2135  /*- puts the elements of S also to T -*/
2136  for (j=0; j<=strat->sl; j++)
2137  {
2138  h.p = strat->S[j];
2139  h.ecart = strat->ecartS[j];
2140  h.pLength = h.length = pLength(h.p);
2141  if (strat->sevS[j] == 0) strat->sevS[j] = pGetShortExpVector(h.p);
2142  else assume(strat->sevS[j] == pGetShortExpVector(h.p));
2143  h.sev = strat->sevS[j];
2144  h.SetpFDeg();
2145  #ifdef HAVE_RINGS
2147  enterT_strong(h,strat);
2148  else
2149  #endif
2150  enterT(h,strat);
2151  }
2152  if (TEST_OPT_PROT) { PrintS("r"); mflush(); }
2153  p = redMoraNF(p,strat, lazyReduce & KSTD_NF_ECART);
2154  if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
2155  {
2156  if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
2157  p = redtail(p,strat->sl,strat);
2158  }
2159  cleanT(strat);
2160  }
2161  res->m[i]=p;
2162  }
2163  //else
2164  // res->m[i]=NULL;
2165  }
2166  /*- release temp data------------------------------- -*/
2167  assume(strat->L==NULL); /*strat->L unsed */
2168  assume(strat->B==NULL); /*strat->B unused */
2169  omFreeSize((ADDRESS)strat->T,strat->tmax*sizeof(TObject));
2170  omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
2171  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
2172  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
2173  omFree(strat->sevT);
2174  omFree(strat->S_2_R);
2175  omFree(strat->R);
2176  if ((Q!=NULL)&&(strat->fromQ!=NULL))
2177  {
2178  i=((IDELEMS(Q)+IDELEMS(F)+15)/16)*16;
2179  omFreeSize((ADDRESS)strat->fromQ,i*sizeof(int));
2180  strat->fromQ=NULL;
2181  }
2182  pDelete(&strat->kHEdge);
2183  pDelete(&strat->kNoether);
2184 // if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
2185 // {
2186 // pFDeg=strat->pOrigFDeg;
2187 // pLDeg=strat->pOrigLDeg;
2188 // if (ecartWeights)
2189 // {
2190 // omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
2191 // ecartWeights=NULL;
2192 // }
2193 // }
2194  idDelete(&strat->Shdl);
2195  SI_RESTORE_OPT1(save1);
2196  if (TEST_OPT_PROT) PrintLn();
2197  return res;
2198 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
#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:1509
#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:678
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:434
#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:1375
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 2422 of file kstd1.cc.

2424 {
2425  if(idIs0(F))
2426  return idInit(1,F->rank);
2427 
2428  ideal r;
2429  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
2430  BOOLEAN delete_w=(w==NULL);
2432  strat->sbaOrder = sbaOrder;
2433  if (arri!=0)
2434  {
2435  strat->rewCrit1 = arriRewDummy;
2436  strat->rewCrit2 = arriRewCriterion;
2437  strat->rewCrit3 = arriRewCriterionPre;
2438  }
2439  else
2440  {
2441  strat->rewCrit1 = faugereRewCriterion;
2442  strat->rewCrit2 = faugereRewCriterion;
2443  strat->rewCrit3 = faugereRewCriterion;
2444  }
2445 
2446  if(!TEST_OPT_RETURN_SB)
2447  strat->syzComp = syzComp;
2448  if (TEST_OPT_SB_1)
2449  #ifdef HAVE_RINGS
2450  if(!rField_is_Ring(currRing))
2451  #endif
2452  strat->newIdeal = newIdeal;
2454  strat->LazyPass=20;
2455  else
2456  strat->LazyPass=2;
2457  strat->LazyDegree = 1;
2459  strat->chainCrit=chainCritNormal;
2461  strat->ak = id_RankFreeModule(F,currRing);
2462  strat->kModW=kModW=NULL;
2463  strat->kHomW=kHomW=NULL;
2464  if (vw != NULL)
2465  {
2466  currRing->pLexOrder=FALSE;
2467  strat->kHomW=kHomW=vw;
2468  strat->pOrigFDeg = currRing->pFDeg;
2469  strat->pOrigLDeg = currRing->pLDeg;
2471  toReset = TRUE;
2472  }
2473  if (h==testHomog)
2474  {
2475  if (strat->ak == 0)
2476  {
2477  h = (tHomog)idHomIdeal(F,Q);
2478  w=NULL;
2479  }
2480  else if (!TEST_OPT_DEGBOUND)
2481  {
2482  h = (tHomog)idHomModule(F,Q,w);
2483  }
2484  }
2485  currRing->pLexOrder=b;
2486  if (h==isHomog)
2487  {
2488  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2489  {
2490  strat->kModW = kModW = *w;
2491  if (vw == NULL)
2492  {
2493  strat->pOrigFDeg = currRing->pFDeg;
2494  strat->pOrigLDeg = currRing->pLDeg;
2496  toReset = TRUE;
2497  }
2498  }
2499  currRing->pLexOrder = TRUE;
2500  if (hilb==NULL) strat->LazyPass*=2;
2501  }
2502  strat->homog=h;
2503 #ifdef KDEBUG
2504  idTest(F);
2505  idTest(Q);
2506 
2507 #if MYTEST
2508  if (TEST_OPT_DEBUG)
2509  {
2510  PrintS("// kSTD: currRing: ");
2511  rWrite(currRing);
2512  }
2513 #endif
2514 
2515 #endif
2516 #ifdef HAVE_PLURAL
2517  if (rIsPluralRing(currRing))
2518  {
2519  const BOOLEAN bIsSCA = rIsSCA(currRing) && strat->z2homog; // for Z_2 prod-crit
2520  strat->no_prod_crit = ! bIsSCA;
2521  if (w!=NULL)
2522  r = nc_GB(F, Q, *w, hilb, strat, currRing);
2523  else
2524  r = nc_GB(F, Q, NULL, hilb, strat, currRing);
2525  }
2526  else
2527 #endif
2528 #ifdef HAVE_RINGS
2529  if (rField_is_Ring(currRing))
2530  r=bba(F,Q,NULL,hilb,strat);
2531  else
2532 #endif
2533  {
2535  {
2536  if (w!=NULL)
2537  r=mora(F,Q,*w,hilb,strat);
2538  else
2539  r=mora(F,Q,NULL,hilb,strat);
2540  }
2541  else
2542  {
2543  if (w!=NULL)
2544  r=sba(F,Q,*w,hilb,strat);
2545  else
2546  r=sba(F,Q,NULL,hilb,strat);
2547  }
2548  }
2549 #ifdef KDEBUG
2550  idTest(r);
2551 #endif
2552  if (toReset)
2553  {
2554  kModW = NULL;
2555  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2556  }
2557  currRing->pLexOrder = b;
2558 //Print("%d reductions canceled \n",strat->cel);
2559  HCord=strat->HCord;
2560  delete(strat);
2561  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
2562  return r;
2563 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
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
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:494
int HCord
Definition: kutil.h:353
pFDegProc pOrigFDeg
Definition: kutil.h:292
intvec * kHomW
Definition: kstd1.cc:2200
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:2200
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:3492
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2212
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:3504
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:434
#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:2202
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:1168
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:1568
#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 2225 of file kstd1.cc.

2227 {
2228  if(idIs0(F))
2229  return idInit(1,F->rank);
2230 
2231  ideal r;
2232  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
2233  BOOLEAN delete_w=(w==NULL);
2235 
2236  strat->s_poly=sp;
2237  if(!TEST_OPT_RETURN_SB)
2238  strat->syzComp = syzComp;
2239  if (TEST_OPT_SB_1
2240  #ifdef HAVE_RINGS
2241  &&(!rField_is_Ring(currRing))
2242  #endif
2243  )
2244  strat->newIdeal = newIdeal;
2246  strat->LazyPass=20;
2247  else
2248  strat->LazyPass=2;
2249  strat->LazyDegree = 1;
2250  strat->ak = id_RankFreeModule(F,currRing);
2251  strat->kModW=kModW=NULL;
2252  strat->kHomW=kHomW=NULL;
2253  if (vw != NULL)
2254  {
2255  currRing->pLexOrder=FALSE;
2256  strat->kHomW=kHomW=vw;
2257  strat->pOrigFDeg = currRing->pFDeg;
2258  strat->pOrigLDeg = currRing->pLDeg;
2260  toReset = TRUE;
2261  }
2262  if (h==testHomog)
2263  {
2264  if (strat->ak == 0)
2265  {
2266  h = (tHomog)idHomIdeal(F,Q);
2267  w=NULL;
2268  }
2269  else if (!TEST_OPT_DEGBOUND)
2270  {
2271  h = (tHomog)idHomModule(F,Q,w);
2272  }
2273  }
2274  currRing->pLexOrder=b;
2275  if (h==isHomog)
2276  {
2277  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2278  {
2279  strat->kModW = kModW = *w;
2280  if (vw == NULL)
2281  {
2282  strat->pOrigFDeg = currRing->pFDeg;
2283  strat->pOrigLDeg = currRing->pLDeg;
2285  toReset = TRUE;
2286  }
2287  }
2288  currRing->pLexOrder = TRUE;
2289  if (hilb==NULL) strat->LazyPass*=2;
2290  }
2291  strat->homog=h;
2292 #ifdef KDEBUG
2293  idTest(F);
2294  if (Q!=NULL) idTest(Q);
2295 
2296 #if MYTEST
2297  if (TEST_OPT_DEBUG)
2298  {
2299  PrintS("// kSTD: currRing: ");
2300  rWrite(currRing);
2301  }
2302 #endif
2303 
2304 #endif
2305 #ifdef HAVE_PLURAL
2306  if (rIsPluralRing(currRing))
2307  {
2308  const BOOLEAN bIsSCA = rIsSCA(currRing) && strat->z2homog; // for Z_2 prod-crit
2309  strat->no_prod_crit = ! bIsSCA;
2310  if (w!=NULL)
2311  r = nc_GB(F, Q, *w, hilb, strat, currRing);
2312  else
2313  r = nc_GB(F, Q, NULL, hilb, strat, currRing);
2314  }
2315  else
2316 #endif
2317 #ifdef HAVE_RINGS
2318  if (rField_is_Ring(currRing))
2319  {
2320  if(nCoeff_is_Ring_Z(currRing->cf))
2321  {
2322  #if 0
2323  if(nCoeff_is_Ring_Z(currRing->cf))
2324  {
2325  ideal FCopy = idCopy(F);
2326  poly pFmon = preIntegerCheck(FCopy, Q);
2327  if(pFmon != NULL)
2328  {
2329  idInsertPoly(FCopy, pFmon);
2330  #if ADIDEBUG
2331  printf("\nPreintegerCheck found this constant:\n");pWrite(pFmon);
2332  #endif
2333  }
2334  strat->kModW=kModW=NULL;
2335  if (h==testHomog)
2336  {
2337  if (strat->ak == 0)
2338  {
2339  h = (tHomog)idHomIdeal(FCopy,Q);
2340  w=NULL;
2341  }
2342  else if (!TEST_OPT_DEGBOUND)
2343  {
2344  h = (tHomog)idHomModule(FCopy,Q,w);
2345  }
2346  }
2347  currRing->pLexOrder=b;
2348  if (h==isHomog)
2349  {
2350  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2351  {
2352  strat->kModW = kModW = *w;
2353  if (vw == NULL)
2354  {
2355  strat->pOrigFDeg = currRing->pFDeg;
2356  strat->pOrigLDeg = currRing->pLDeg;
2358  toReset = TRUE;
2359  }
2360  }
2361  currRing->pLexOrder = TRUE;
2362  if (hilb==NULL) strat->LazyPass*=2;
2363  }
2364  strat->homog=h;
2365  omTestMemory(1);
2367  r=mora(FCopy,Q,NULL,hilb,strat);
2368  else
2369  r=bba(FCopy,Q,NULL,hilb,strat);
2370  }
2371  else
2372  #endif
2373  {
2375  r=mora(F,Q,NULL,hilb,strat);
2376  else
2377  r=bba(F,Q,NULL,hilb,strat);
2378  }
2379  }
2380  else
2381  {
2383  r=mora(F,Q,NULL,hilb,strat);
2384  else
2385  r=bba(F,Q,NULL,hilb,strat);
2386  }
2387  }
2388  else
2389 #endif
2390  {
2392  {
2393  if (w!=NULL)
2394  r=mora(F,Q,*w,hilb,strat);
2395  else
2396  r=mora(F,Q,NULL,hilb,strat);
2397  }
2398  else
2399  {
2400  if (w!=NULL)
2401  r=bba(F,Q,*w,hilb,strat);
2402  else
2403  r=bba(F,Q,NULL,hilb,strat);
2404  }
2405  }
2406 #ifdef KDEBUG
2407  idTest(r);
2408 #endif
2409  if (toReset)
2410  {
2411  kModW = NULL;
2412  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2413  }
2414  currRing->pLexOrder = b;
2415 //Print("%d reductions canceled \n",strat->cel);
2416  HCord=strat->HCord;
2417  delete(strat);
2418  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
2419  return r;
2420 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
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:755
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 BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:494
int HCord
Definition: kutil.h:353
pFDegProc pOrigFDeg
Definition: kutil.h:292
intvec * kHomW
Definition: kstd1.cc:2200
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:2200
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:3492
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2212
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:3504
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:434
#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:2202
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:1568
#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 2566 of file kstd1.cc.

2568 {
2569  ideal r;
2570  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
2571  BOOLEAN delete_w=(w==NULL);
2573 
2574  if(!TEST_OPT_RETURN_SB)
2575  strat->syzComp = syzComp;
2576  if (TEST_OPT_SB_1)
2577  #ifdef HAVE_RINGS
2578  if(!rField_is_Ring(currRing))
2579  #endif
2580  strat->newIdeal = newIdeal;
2582  strat->LazyPass=20;
2583  else
2584  strat->LazyPass=2;
2585  strat->LazyDegree = 1;
2586  strat->ak = id_RankFreeModule(F,currRing);
2587  strat->kModW=kModW=NULL;
2588  strat->kHomW=kHomW=NULL;
2589  if (vw != NULL)
2590  {
2591  currRing->pLexOrder=FALSE;
2592  strat->kHomW=kHomW=vw;
2593  strat->pOrigFDeg = currRing->pFDeg;
2594  strat->pOrigLDeg = currRing->pLDeg;
2596  toReset = TRUE;
2597  }
2598  if (h==testHomog)
2599  {
2600  if (strat->ak == 0)
2601  {
2602  h = (tHomog)idHomIdeal(F,Q);
2603  w=NULL;
2604  }
2605  else if (!TEST_OPT_DEGBOUND)
2606  {
2607  h = (tHomog)idHomModule(F,Q,w);
2608  }
2609  }
2610  currRing->pLexOrder=b;
2611  if (h==isHomog)
2612  {
2613  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2614  {
2615  strat->kModW = kModW = *w;
2616  if (vw == NULL)
2617  {
2618  strat->pOrigFDeg = currRing->pFDeg;
2619  strat->pOrigLDeg = currRing->pLDeg;
2621  toReset = TRUE;
2622  }
2623  }
2624  currRing->pLexOrder = TRUE;
2625  if (hilb==NULL) strat->LazyPass*=2;
2626  }
2627  strat->homog=h;
2628 #ifdef KDEBUG
2629  idTest(F);
2630 #endif
2632  {
2633  /* error: no local ord yet with shifts */
2634  Print("No local ordering possible for shifts");
2635  return(NULL);
2636  }
2637  else
2638  {
2639  /* global ordering */
2640  if (w!=NULL)
2641  r=bbaShift(F,Q,*w,hilb,strat,uptodeg,lV);
2642  else
2643  r=bbaShift(F,Q,NULL,hilb,strat,uptodeg,lV);
2644  }
2645 #ifdef KDEBUG
2646  idTest(r);
2647 #endif
2648  if (toReset)
2649  {
2650  kModW = NULL;
2651  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2652  }
2653  currRing->pLexOrder = b;
2654 //Print("%d reductions canceled \n",strat->cel);
2655  HCord=strat->HCord;
2656  delete(strat);
2657  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
2658  return r;
2659 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
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:494
int HCord
Definition: kutil.h:353
pFDegProc pOrigFDeg
Definition: kutil.h:292
intvec * kHomW
Definition: kstd1.cc:2200
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:2200
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:3492
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2212
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3504
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:434
#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:2202
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 1568 of file kstd1.cc.

1569 {
1570 #ifdef HAVE_RINGS
1571 #if ADIDEBUG
1572 int loop_count;
1573 loop_count = 1;
1574 #endif
1575 #endif
1576  int olddeg = 0;
1577  int reduc = 0;
1578  int red_result = 1;
1579  int hilbeledeg=1,hilbcount=0;
1580  BITSET save1;
1581  SI_SAVE_OPT1(save1);
1582  if (currRing->MixedOrder)
1583  {
1584  si_opt_1 &= ~Sy_bit(OPT_REDSB);
1586  }
1587 
1588  strat->update = TRUE;
1589  /*- setting global variables ------------------- -*/
1590  initBuchMoraCrit(strat);
1591  initHilbCrit(F,Q,&hilb,strat);
1592  initMora(F,strat);
1593  initBuchMoraPos(strat);
1594  /*Shdl=*/initBuchMora(F,Q,strat);
1595  if (TEST_OPT_FASTHC) missingAxis(&strat->lastAxis,strat);
1596  /*updateS in initBuchMora has Hecketest
1597  * and could have put strat->kHEdgdeFound FALSE*/
1598  if ((currRing->ppNoether)!=NULL)
1599  {
1600  strat->kHEdgeFound = TRUE;
1601  }
1602  if (strat->kHEdgeFound && strat->update)
1603  {
1604  firstUpdate(strat);
1605  updateLHC(strat);
1606  reorderL(strat);
1607  }
1608  if (TEST_OPT_FASTHC && (strat->lastAxis) && strat->posInLOldFlag)
1609  {
1610  strat->posInLOld = strat->posInL;
1611  strat->posInLOldFlag = FALSE;
1612  strat->posInL = posInL10;
1613  updateL(strat);
1614  reorderL(strat);
1615  }
1616  kTest_TS(strat);
1617  strat->use_buckets = kMoraUseBucket(strat);
1618  /*- compute-------------------------------------------*/
1619 
1620 #ifdef HAVE_TAIL_RING
1621  if (strat->homog && strat->red == redFirst)
1622  if(!idIs0(F) &&(!rField_is_Ring(currRing)))
1623  kStratInitChangeTailRing(strat);
1624 #endif
1625 
1626  if (BVERBOSE(23))
1627  {
1628  kDebugPrint(strat);
1629  }
1630 
1631  while (strat->Ll >= 0)
1632  {
1633  #if ADIDEBUG
1634  printf("\n ------------------------NEW LOOP\n");
1635  printf("\nShdl = \n");
1636  for(int iii = 0; iii<= strat->sl; iii++)
1637  {
1638  printf("S[%i]:",iii);
1639  p_Write(strat->S[iii], strat->tailRing);
1640  }
1641  printf("\n list L has %i\n", strat->Ll);
1642  int iii;
1643  #if ADIDEBUG
1644  for(iii = 0; iii<= strat->Ll; iii++)
1645  {
1646  printf("L[%i]:",iii);
1647  #if 0
1648  p_Write(strat->L[iii].p, strat->tailRing);
1649  p_Write(strat->L[iii].p1, strat->tailRing);
1650  p_Write(strat->L[iii].p2, strat->tailRing);
1651  #else
1652  pWrite(strat->L[iii].p);
1653  pWrite(strat->L[iii].p1);
1654  pWrite(strat->L[iii].p2);
1655  pWrite(strat->L[iii].lcm);
1656  #endif
1657  }
1658  #endif
1659  getchar();
1660  #endif
1661  #ifdef KDEBUG
1662  if (TEST_OPT_DEBUG) messageSets(strat);
1663  #endif
1664  if (TEST_OPT_DEGBOUND
1665  && (strat->L[strat->Ll].ecart+strat->L[strat->Ll].GetpFDeg()> Kstd1_deg))
1666  {
1667  /*
1668  * stops computation if
1669  * - 24 (degBound)
1670  * && upper degree is bigger than Kstd1_deg
1671  */
1672  while ((strat->Ll >= 0)
1673  && (strat->L[strat->Ll].p1!=NULL) && (strat->L[strat->Ll].p2!=NULL)
1674  && (strat->L[strat->Ll].ecart+strat->L[strat->Ll].GetpFDeg()> Kstd1_deg)
1675  )
1676  {
1677  deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
1678  //if (TEST_OPT_PROT)
1679  //{
1680  // PrintS("D"); mflush();
1681  //}
1682  }
1683  if (strat->Ll<0) break;
1684  else strat->noClearS=TRUE;
1685  }
1686  strat->P = strat->L[strat->Ll];/*- picks the last element from the lazyset L -*/
1687  if (strat->Ll==0) strat->interpt=TRUE;
1688  strat->Ll--;
1689  //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);
1690  // create the real Spoly
1691  if (pNext(strat->P.p) == strat->tail)
1692  {
1693  /*- deletes the short spoly and computes -*/
1694 #ifdef HAVE_RINGS
1695  if (rField_is_Ring(currRing))
1696  pLmDelete(strat->P.p);
1697  else
1698 #endif
1699  pLmFree(strat->P.p);
1700  strat->P.p = NULL;
1701  poly m1 = NULL, m2 = NULL;
1702  // check that spoly creation is ok
1703  while (strat->tailRing != currRing &&
1704  !kCheckSpolyCreation(&(strat->P), strat, m1, m2))
1705  {
1706  assume(m1 == NULL && m2 == NULL);
1707  // if not, change to a ring where exponents are large enough
1708  kStratChangeTailRing(strat);
1709  }
1710  /* create the real one */
1711  ksCreateSpoly(&(strat->P), strat->kNoetherTail(), strat->use_buckets,
1712  strat->tailRing, m1, m2, strat->R);
1713  if (!strat->use_buckets)
1714  strat->P.SetLength(strat->length_pLength);
1715  }
1716  else if (strat->P.p1 == NULL)
1717  {
1718  // for input polys, prepare reduction (buckets !)
1719  strat->P.SetLength(strat->length_pLength);
1720  strat->P.PrepareRed(strat->use_buckets);
1721  }
1722 
1723  // the s-poly
1724  if (!strat->P.IsNull())
1725  {
1726  // might be NULL from noether !!!
1727  if (TEST_OPT_PROT)
1728  message(strat->P.ecart+strat->P.GetpFDeg(),&olddeg,&reduc,strat, red_result);
1729  // reduce
1730  #if ADIDEBUG
1731  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);
1732  printf("\nBefore Ll = %i\n", strat->Ll);
1733  #endif
1734  #ifdef HAVE_RINGS
1735  if(rField_is_Ring(strat->tailRing) && rHasLocalOrMixedOrdering(currRing))
1736  {
1737  //int inittl = strat->tl;
1738  red_result = strat->red(&strat->P,strat);
1739  //strat->tl = inittl;
1740  }
1741  else
1742  #endif
1743  red_result = strat->red(&strat->P,strat);
1744  #if ADIDEBUG
1745  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);
1746  printf("\nAfter Ll = %i\n", strat->Ll);
1747  #endif
1748  }
1749 
1750  // the reduced s-poly
1751  if (! strat->P.IsNull())
1752  {
1753  strat->P.GetP();
1754  // statistics
1755  if (TEST_OPT_PROT) PrintS("s");
1756  // normalization
1758  strat->P.pCleardenom();
1759  else
1760  strat->P.pNorm();
1761  // tailreduction
1762  strat->P.p = redtail(&(strat->P),strat->sl,strat);
1763  if (strat->P.p==NULL)
1764  {
1765  WerrorS("expoent overflow - wrong ordering");
1766  return(idInit(1,1));
1767  }
1768  // set ecart -- might have changed because of tail reductions
1769  if ((!strat->noTailReduction) && (!strat->honey))
1770  strat->initEcart(&strat->P);
1771  // cancel unit
1772  cancelunit(&strat->P);
1773  // for char 0, clear denominators
1774  if ((strat->P.p->next==NULL) /* i.e. cancelunit did something*/
1776  strat->P.pCleardenom();
1777 
1778  // put in T
1779  //if(red_result!=3)
1780  {
1781  #ifdef HAVE_RINGS
1782  if(rField_is_Ring(strat->tailRing) && rHasLocalOrMixedOrdering(currRing))
1783  {
1784  //int inittl = strat->tl;
1785  enterT(strat->P,strat);
1786  //enterT_strong(strat->P,strat);
1787  //strat->tl = inittl+1;
1788  }
1789  else
1790  #endif
1791  enterT(strat->P,strat);
1792  //enterT_strong(strat->P,strat);
1793  }
1794  // build new pairs
1795 #ifdef HAVE_RINGS
1796  if (rField_is_Ring(currRing))
1797  {
1798  superenterpairs(strat->P.p,strat->sl,strat->P.ecart,0,strat, strat->tl);
1799  }
1800  else
1801 #endif
1802  enterpairs(strat->P.p,strat->sl,strat->P.ecart,0,strat, strat->tl);
1803  // put in S
1804 
1805  #if ADIDEBUG
1806  Print("\n The new pair list L -- after superenterpairs in loop %d -- is:\n",loop_count);
1807  for(int iii=0;iii<=strat->Ll;iii++)
1808  {
1809  printf("\n L[%d]:\n",iii);
1810  PrintS(" ");p_Write(strat->L[iii].p,strat->tailRing);
1811  PrintS(" ");p_Write(strat->L[iii].p1,strat->tailRing);
1812  PrintS(" ");p_Write(strat->L[iii].p2,strat->tailRing);
1813  }
1814  #endif
1815  //if(red_result!=3)
1816  strat->enterS(strat->P,
1817  posInS(strat,strat->sl,strat->P.p, strat->P.ecart),
1818  strat, strat->tl);
1819  #if ADIDEBUG
1820  printf("\nThis pair has been added to S:\n");
1821  pWrite(strat->P.p);
1822  pWrite(strat->P.p1);
1823  pWrite(strat->P.p2);
1824  #endif
1825 
1826  // apply hilbert criterion
1827  if (hilb!=NULL)
1828  {
1829  if (strat->homog==isHomog)
1830  khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
1831  else
1832  khCheckLocInhom(Q,w,hilb,hilbcount,strat);
1833  }
1834 
1835  // clear strat->P
1836  if (strat->P.lcm!=NULL)
1837  {
1838 #if defined(HAVE_RINGS)
1839  pLmDelete(strat->P.lcm);
1840 #else
1841  pLmFree(strat->P.lcm);
1842 #endif
1843  strat->P.lcm=NULL;
1844  }
1845 #ifdef KDEBUG
1846  // make sure kTest_TS does not complain about strat->P
1847  memset(&strat->P,0,sizeof(strat->P));
1848 #endif
1849  }
1850  if (strat->kHEdgeFound)
1851  {
1852  if ((TEST_OPT_FINDET)
1853  || ((TEST_OPT_MULTBOUND) && (scMult0Int(strat->Shdl,NULL,strat->tailRing) < Kstd1_mu)))
1854  {
1855  // obachman: is this still used ???
1856  /*
1857  * stops computation if strat->kHEdgeFound and
1858  * - 27 (finiteDeterminacyTest)
1859  * or
1860  * - 23
1861  * (multBound)
1862  * && multiplicity of the ideal is smaller then a predefined number mu
1863  */
1864  while (strat->Ll >= 0) deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
1865  }
1866  }
1867  kTest_TS(strat);
1868 
1869 #if ADIDEBUG
1870  Print("\n The new reducer list T -- at the end of loop %d -- is\n",loop_count);
1871  for(int iii=0;iii<=strat->tl;iii++)
1872  {
1873  printf("\n T[%d]:",iii);
1874  p_Write(strat->T[iii].p,strat->tailRing);
1875  }
1876  PrintLn();
1877 
1878  loop_count++;
1879 #endif /* ADIDEBUG */
1880  }
1881  /*- complete reduction of the standard basis------------------------ -*/
1882  if (TEST_OPT_REDSB) completeReduce(strat);
1883  else if (TEST_OPT_PROT) PrintLn();
1884  /*- release temp data------------------------------- -*/
1885  exitBuchMora(strat);
1886  /*- polynomials used for HECKE: HC, noether -*/
1887  if (TEST_OPT_FINDET)
1888  {
1889  if (strat->kHEdge!=NULL)
1890  Kstd1_mu=currRing->pFDeg(strat->kHEdge,currRing);
1891  else
1892  Kstd1_mu=-1;
1893  }
1894  pDelete(&strat->kHEdge);
1895  strat->update = TRUE; //???
1896  strat->lastAxis = 0; //???
1897  pDelete(&strat->kNoether);
1898  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
1899  if ((TEST_OPT_PROT)||(TEST_OPT_DEBUG)) messageStat(hilbcount,strat);
1900 // if (TEST_OPT_WEIGHTM)
1901 // {
1902 // pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
1903 // if (ecartWeights)
1904 // {
1905 // omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
1906 // ecartWeights=NULL;
1907 // }
1908 // }
1909 #ifdef HAVE_RINGS
1910  if(nCoeff_is_Ring_Z(currRing->cf))
1911  finalReduceByMon(strat);
1912 #endif
1913  if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
1914  SI_RESTORE_OPT1(save1);
1915  idTest(strat->Shdl);
1916  return (strat->Shdl);
1917 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
#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:1509
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:755
#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:434
#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:1250
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:3359
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 2200 of file kstd1.cc.

intvec* kModW

Definition at line 2200 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.