Macros | 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
 

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 kNF (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)
 
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 17 of file kstd1.h.

#define KSTD_NF_LAZY   1

Definition at line 15 of file kstd1.h.

#define KSTD_NF_NONORM   4

Definition at line 19 of file kstd1.h.

Function Documentation

void initMora ( ideal  F,
kStrategy  strat 
)

Definition at line 1403 of file kstd1.cc.

1404 {
1405  int i,j;
1406 
1407  strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN));
1408  for (j=(currRing->N); j>0; j--) strat->NotUsedAxis[j] = TRUE;
1409  strat->enterS = enterSMora;
1410  strat->initEcartPair = initEcartPairMora; /*- ecart approximation -*/
1411  strat->posInLOld = strat->posInL;
1412  strat->posInLOldFlag = TRUE;
1413  strat->initEcart = initEcartNormal;
1414  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
1415  if ( strat->kHEdgeFound )
1416  strat->kNoether = pCopy((currRing->ppNoether));
1417  else if (strat->kHEdgeFound || strat->homog)
1418  strat->red = redFirst; /*take the first possible in T*/
1419  else
1420  strat->red = redEcart;/*take the first possible in under ecart-restriction*/
1421  if (strat->kHEdgeFound)
1422  {
1423  strat->HCord = currRing->pFDeg((currRing->ppNoether),currRing)+1;
1424  strat->posInT = posInT2;
1425  }
1426  else
1427  {
1428  strat->HCord = 32000;/*- very large -*/
1429  }
1430 
1431 #ifdef HAVE_RINGS
1432  if (rField_is_Ring(currRing))
1433  strat->red = redRiloc;
1434 #endif
1435 
1436  /*reads the ecartWeights used for Graebes method from the
1437  *intvec ecart and set ecartWeights
1438  */
1439  if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
1440  {
1441  //interred machen Aenderung
1442  strat->pOrigFDeg=currRing->pFDeg;
1443  strat->pOrigLDeg=currRing->pLDeg;
1444  ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
1445  /*uses automatic computation of the ecartWeights to set them*/
1447 
1449  if (TEST_OPT_PROT)
1450  {
1451  for(i=1; i<=(currRing->N); i++)
1452  Print(" %d",ecartWeights[i]);
1453  PrintLn();
1454  mflush();
1455  }
1456  }
1457  kOptimizeLDeg(currRing->pLDeg, strat);
1458 }
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.h:283
void PrintLn()
Definition: reporter.cc:322
int posInT2(const TSet set, const int length, LObject &p)
Definition: kutil.cc:4004
#define Print
Definition: emacs.cc:83
int redEcart(LObject *h, kStrategy strat)
Definition: kstd1.cc:176
#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
void enterSMora(LObject p, int atS, kStrategy strat, int atR=-1)
Definition: kstd1.cc:1215
short * ecartWeights
Definition: weight0.c:32
int redFirst(LObject *h, kStrategy strat)
Definition: kstd1.cc:574
BOOLEAN * NotUsedAxis
Definition: kutil.h:332
poly kNoether
Definition: kutil.h:328
#define TRUE
Definition: auxiliary.h:144
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
Definition: kutil.h:286
int(* red)(LObject *L, kStrategy strat)
Definition: kutil.h:277
#define omAlloc(size)
Definition: omAllocDecl.h:210
int(* posInT)(const TSet T, const int tl, LObject &h)
Definition: kutil.h:280
int HCord
Definition: kutil.h:358
#define mflush()
Definition: reporter.h:42
pFDegProc pOrigFDeg
Definition: kutil.h:295
int redRiloc(LObject *h, kStrategy strat)
Definition: kstd1.cc:351
void(* initEcart)(TObject *L)
Definition: kutil.h:279
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:296
BOOLEAN homog
Definition: kutil.h:366
void initEcartPairMora(LObject *Lp, poly, poly, int ecartF, int ecartG)
Definition: kutil.cc:1147
int j
Definition: myNF.cc:70
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition: p_polys.cc:3452
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:287
#define IDELEMS(i)
Definition: simpleideals.h:19
BOOLEAN kHEdgeFound
Definition: kutil.h:370
#define TEST_OPT_WEIGHTM
Definition: options.h:115
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:428
#define NULL
Definition: omList.c:10
BOOLEAN posInLOldFlag
Definition: kutil.h:376
long maxdegreeWecart(poly p, int *l, ring r)
Definition: weight.cc:255
void initEcartNormal(TObject *h)
Definition: kutil.cc:1125
void(* enterS)(LObject h, int pos, kStrategy strat, int atR)
Definition: kutil.h:285
int BOOLEAN
Definition: auxiliary.h:131
#define pCopy(p)
return a copy of the poly
Definition: polys.h:156
long kHomModDeg ( poly  p,
ring  r = currRing 
)

Definition at line 2054 of file kstd1.cc.

2055 {
2056  int i;
2057  long j=0;
2058 
2059  for (i=r->N;i>0;i--)
2060  j+=p_GetExp(p,i,r)*(*kHomW)[i-1];
2061  if (kModW == NULL) return j;
2062  i = p_GetComp(p,r);
2063  if (i==0) return j;
2064  return j+(*kModW)[i-1];
2065 }
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:2042
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 3059 of file kstd1.cc.

3060 {
3061 #ifdef HAVE_PLURAL
3062  if(rIsPluralRing(currRing)) return kInterRedOld(F,Q);
3063 #endif
3065  #ifdef HAVE_RINGS
3067  #endif
3068  )
3069  return kInterRedOld(F,Q);
3070 
3071  //return kInterRedOld(F,Q);
3072 
3073  BITSET save1;
3074  SI_SAVE_OPT1(save1);
3075  //si_opt_1|=Sy_bit(OPT_NOT_SUGAR);
3077  //si_opt_1&= ~Sy_bit(OPT_REDTAIL);
3078  //si_opt_1&= ~Sy_bit(OPT_REDSB);
3079  //extern char * showOption() ;
3080  //Print("%s\n",showOption());
3081 
3082  int need_retry;
3083  int counter=3;
3084  ideal res, res1;
3085  int elems;
3086  ideal null=NULL;
3087  if ((Q==NULL) || (!TEST_OPT_REDSB))
3088  {
3089  elems=idElem(F);
3090  res=kInterRedBba(F,Q,need_retry);
3091  }
3092  else
3093  {
3094  ideal FF=idSimpleAdd(F,Q);
3095  res=kInterRedBba(FF,NULL,need_retry);
3096  idDelete(&FF);
3097  null=idInit(1,1);
3098  if (need_retry)
3099  res1=kNF(null,Q,res,0,KSTD_NF_LAZY);
3100  else
3101  res1=kNF(null,Q,res);
3102  idDelete(&res);
3103  res=res1;
3104  need_retry=1;
3105  }
3106  if (idElem(res)<=1) need_retry=0;
3107  while (need_retry && (counter>0))
3108  {
3109  #ifdef KDEBUG
3110  if (TEST_OPT_DEBUG) { Print("retry counter %d\n",counter); }
3111  #endif
3112  res1=kInterRedBba(res,Q,need_retry);
3113  int new_elems=idElem(res1);
3114  counter -= (new_elems >= elems);
3115  elems = new_elems;
3116  idDelete(&res);
3117  if (idElem(res1)<=1) need_retry=0;
3118  if ((Q!=NULL) && (TEST_OPT_REDSB))
3119  {
3120  if (need_retry)
3121  res=kNF(null,Q,res1,0,KSTD_NF_LAZY);
3122  else
3123  res=kNF(null,Q,res1);
3124  idDelete(&res1);
3125  }
3126  else
3127  res = res1;
3128  if (idElem(res)<=1) need_retry=0;
3129  }
3130  if (null!=NULL) idDelete(&null);
3131  SI_RESTORE_OPT1(save1);
3132  idSkipZeroes(res);
3133  return res;
3134 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:742
unsigned si_opt_1
Definition: options.c:5
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2598
#define Print
Definition: emacs.cc:83
#define idSimpleAdd(A, B)
Definition: ideals.h:58
const ideal
Definition: gb_hack.h:42
#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:355
#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:2801
#define KSTD_NF_LAZY
Definition: kstd1.h:15
void idDelete(ideal *h, ring r=currRing)
delete an ideal
Definition: ideals.h:31
ideal kInterRedOld(ideal F, ideal Q)
Definition: kstd1.cc:2710
void idSkipZeroes(ideal ide)
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:428
#define NULL
Definition: omList.c:10
#define OPT_REDTHROUGH
Definition: options.h:77
int idElem(const ideal F)
number of non-zero polys in F
#define SI_RESTORE_OPT1(A)
Definition: options.h:23
static BOOLEAN rField_is_numeric(const ring r)
Definition: ring.h:455
ideal kInterRedOld ( ideal  F,
ideal  Q = NULL 
)

Definition at line 2710 of file kstd1.cc.

2711 {
2712  int j;
2713  kStrategy strat = new skStrategy;
2714 
2715  ideal tempF = F;
2716  ideal tempQ = Q;
2717 
2718 #ifdef HAVE_PLURAL
2719  if(rIsSCA(currRing))
2720  {
2721  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
2722  const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
2723  tempF = id_KillSquares(F, m_iFirstAltVar, m_iLastAltVar, currRing);
2724 
2725  // this should be done on the upper level!!! :
2726  // tempQ = SCAQuotient(currRing);
2727 
2728  if(Q == currRing->qideal)
2729  tempQ = SCAQuotient(currRing);
2730  }
2731 #endif
2732 
2733 // if (TEST_OPT_PROT)
2734 // {
2735 // writeTime("start InterRed:");
2736 // mflush();
2737 // }
2738  //strat->syzComp = 0;
2739  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
2740  strat->kNoether=pCopy((currRing->ppNoether));
2741  strat->ak = id_RankFreeModule(tempF,currRing);
2742  initBuchMoraCrit(strat);
2743  strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN));
2744  for (j=(currRing->N); j>0; j--) strat->NotUsedAxis[j] = TRUE;
2745  strat->enterS = enterSBba;
2746  strat->posInT = posInT17;
2747  strat->initEcart = initEcartNormal;
2748  strat->sl = -1;
2749  strat->tl = -1;
2750  strat->tmax = setmaxT;
2751  strat->T = initT();
2752  strat->R = initR();
2753  strat->sevT = initsevT();
2755  initS(tempF, tempQ, strat);
2756  if (TEST_OPT_REDSB)
2757  strat->noTailReduction=FALSE;
2758  updateS(TRUE,strat);
2760  completeReduce(strat);
2761  //else if (TEST_OPT_PROT) PrintLn();
2762  pDelete(&strat->kHEdge);
2763  omFreeSize((ADDRESS)strat->T,strat->tmax*sizeof(TObject));
2764  omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
2765  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
2766  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
2767  omfree(strat->sevT);
2768  omfree(strat->S_2_R);
2769  omfree(strat->R);
2770 
2771  if (strat->fromQ)
2772  {
2773  for (j=IDELEMS(strat->Shdl)-1;j>=0;j--)
2774  {
2775  if(strat->fromQ[j]) pDelete(&strat->Shdl->m[j]);
2776  }
2777  omFreeSize((ADDRESS)strat->fromQ,IDELEMS(strat->Shdl)*sizeof(int));
2778  }
2779 // if (TEST_OPT_PROT)
2780 // {
2781 // writeTime("end Interred:");
2782 // mflush();
2783 // }
2784  ideal shdl=strat->Shdl;
2785  idSkipZeroes(shdl);
2786  if (strat->fromQ)
2787  {
2788  strat->fromQ=NULL;
2789  ideal res=kInterRed(shdl,NULL);
2790  idDelete(&shdl);
2791  shdl=res;
2792  }
2793  delete(strat);
2794 #ifdef HAVE_PLURAL
2795  if( tempF != F )
2796  id_Delete( &tempF, currRing);
2797 #endif
2798  return shdl;
2799 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:742
ideal SCAQuotient(const ring r)
Definition: sca.h:10
KINLINE TObject ** initR()
Definition: kInline.h:92
BOOLEAN honey
Definition: kutil.h:371
KINLINE unsigned long * initsevT()
Definition: kInline.h:97
poly kHEdge
Definition: kutil.h:327
KINLINE TSet initT()
Definition: kInline.h:81
#define FALSE
Definition: auxiliary.h:140
BOOLEAN noTailReduction
Definition: kutil.h:372
int * S_2_R
Definition: kutil.h:342
BOOLEAN * NotUsedAxis
Definition: kutil.h:332
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
const ideal
Definition: gb_hack.h:42
void id_Delete(ideal *h, ring r)
poly kNoether
Definition: kutil.h:328
int tl
Definition: kutil.h:353
#define TRUE
Definition: auxiliary.h:144
#define TEST_OPT_REDSB
Definition: options.h:99
unsigned long * sevT
Definition: kutil.h:323
void * ADDRESS
Definition: auxiliary.h:161
int ak
Definition: kutil.h:356
#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:280
poly res
Definition: myNF.cc:322
void(* initEcart)(TObject *L)
Definition: kutil.h:279
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:5733
#define TEST_OPT_INTSTRATEGY
Definition: options.h:105
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
#define setmaxT
Definition: kutil.h:30
int j
Definition: myNF.cc:70
intset fromQ
Definition: kutil.h:319
#define omfree(addr)
Definition: omAllocDecl.h:237
ideal kInterRed(ideal F, ideal Q)
Definition: kstd1.cc:3059
void idDelete(ideal *h, ring r=currRing)
delete an ideal
Definition: ideals.h:31
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:7325
int posInT17(const TSet set, const int length, LObject &p)
Definition: kutil.cc:4339
TObject ** R
Definition: kutil.h:340
#define IDELEMS(i)
Definition: simpleideals.h:19
void idSkipZeroes(ideal ide)
static short scaFirstAltVar(ring r)
Definition: sca.h:18
int tmax
Definition: kutil.h:353
kStrategy strat
Definition: myNF.cc:319
BOOLEAN kHEdgeFound
Definition: kutil.h:370
intset ecartS
Definition: kutil.h:307
#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:6695
unsigned long * sevS
Definition: kutil.h:320
static bool rIsSCA(const ring r)
Definition: nc.h:206
void completeReduce(kStrategy strat, BOOLEAN withT)
Definition: kutil.cc:7991
int sl
Definition: kutil.h:351
TSet T
Definition: kutil.h:324
void initEcartNormal(TObject *h)
Definition: kutil.cc:1125
void enterSBba(LObject p, int atS, kStrategy strat, int atR)
Definition: kutil.cc:6927
ideal Shdl
Definition: kutil.h:301
void(* enterS)(LObject h, int pos, kStrategy strat, int atR)
Definition: kutil.h:285
int BOOLEAN
Definition: auxiliary.h:131
class sTObject TObject
Definition: kutil.h:57
#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 2447 of file kstd1.cc.

2449 {
2450  if(idIs0(F))
2451  {
2452  M=idInit(1,F->rank);
2453  return idInit(1,F->rank);
2454  }
2455  #ifdef HAVE_RINGS
2457  {
2458  ideal sb;
2459  sb = kStd(F, Q, h, w, hilb);
2460  idSkipZeroes(sb);
2461  if(IDELEMS(sb) <= IDELEMS(F))
2462  {
2463  M = idCopy(sb);
2464  idSkipZeroes(M);
2465  return(sb);
2466  }
2467  else
2468  {
2469  M = idCopy(F);
2470  idSkipZeroes(M);
2471  return(sb);
2472  }
2473  }
2474  #endif
2475  ideal r=NULL;
2476  int Kstd1_OldDeg = Kstd1_deg,i;
2477  intvec* temp_w=NULL;
2478  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
2479  BOOLEAN delete_w=(w==NULL);
2480  BOOLEAN oldDegBound=TEST_OPT_DEGBOUND;
2482 
2483  if(!TEST_OPT_RETURN_SB)
2484  strat->syzComp = syzComp;
2486  strat->LazyPass=20;
2487  else
2488  strat->LazyPass=2;
2489  strat->LazyDegree = 1;
2490  strat->minim=(reduced % 2)+1;
2491  strat->ak = id_RankFreeModule(F,currRing);
2492  if (delete_w)
2493  {
2494  temp_w=new intvec((strat->ak)+1);
2495  w = &temp_w;
2496  }
2497  if (h==testHomog)
2498  {
2499  if (strat->ak == 0)
2500  {
2501  h = (tHomog)idHomIdeal(F,Q);
2502  w=NULL;
2503  }
2504  else
2505  {
2506  h = (tHomog)idHomModule(F,Q,w);
2507  }
2508  }
2509  if (h==isHomog)
2510  {
2511  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2512  {
2513  kModW = *w;
2514  strat->kModW = *w;
2515  assume(currRing->pFDeg != NULL && currRing->pLDeg != NULL);
2516  strat->pOrigFDeg = currRing->pFDeg;
2517  strat->pOrigLDeg = currRing->pLDeg;
2519 
2520  toReset = TRUE;
2521  if (reduced>1)
2522  {
2523  Kstd1_OldDeg=Kstd1_deg;
2524  Kstd1_deg = -1;
2525  for (i=IDELEMS(F)-1;i>=0;i--)
2526  {
2527  if ((F->m[i]!=NULL) && (currRing->pFDeg(F->m[i],currRing)>=Kstd1_deg))
2528  Kstd1_deg = currRing->pFDeg(F->m[i],currRing)+1;
2529  }
2530  }
2531  }
2532  currRing->pLexOrder = TRUE;
2533  strat->LazyPass*=2;
2534  }
2535  strat->homog=h;
2537  {
2538  if (w!=NULL)
2539  r=mora(F,Q,*w,hilb,strat);
2540  else
2541  r=mora(F,Q,NULL,hilb,strat);
2542  }
2543  else
2544  {
2545  if (w!=NULL)
2546  r=bba(F,Q,*w,hilb,strat);
2547  else
2548  r=bba(F,Q,NULL,hilb,strat);
2549  }
2550 #ifdef KDEBUG
2551  {
2552  int i;
2553  for (i=IDELEMS(r)-1; i>=0; i--) pTest(r->m[i]);
2554  }
2555 #endif
2556  idSkipZeroes(r);
2557  if (toReset)
2558  {
2559  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2560  kModW = NULL;
2561  }
2562  currRing->pLexOrder = b;
2563  HCord=strat->HCord;
2564  if ((delete_w)&&(temp_w!=NULL)) delete temp_w;
2565  if ((IDELEMS(r)==1) && (r->m[0]!=NULL) && pIsConstant(r->m[0]) && (strat->ak==0))
2566  {
2567  M=idInit(1,F->rank);
2568  M->m[0]=pOne();
2569  //if (strat->ak!=0) { pSetComp(M->m[0],strat->ak); pSetmComp(M->m[0]); }
2570  if (strat->M!=NULL) idDelete(&strat->M);
2571  }
2572  else if (strat->M==NULL)
2573  {
2574  M=idInit(1,F->rank);
2575  Warn("no minimal generating set computed");
2576  }
2577  else
2578  {
2579  idSkipZeroes(strat->M);
2580  M=strat->M;
2581  }
2582  delete(strat);
2583  if (reduced>2)
2584  {
2585  Kstd1_deg=Kstd1_OldDeg;
2586  if (!oldDegBound)
2588  }
2589  else
2590  {
2591  if (IDELEMS(M)>IDELEMS(r)) {
2592  idDelete(&M);
2593  M=idCopy(r); }
2594  }
2595  return r;
2596 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:742
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL, const ring R=currRing)
Definition: ideals.h:109
unsigned si_opt_1
Definition: options.c:5
int HCord
Definition: kutil.cc:227
int syzComp
Definition: kutil.h:357
#define TEST_OPT_DEGBOUND
Definition: options.h:108
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw)
Definition: kstd1.cc:2067
#define FALSE
Definition: auxiliary.h:140
#define pTest(p)
Definition: polys.h:387
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
int ak
Definition: kutil.h:356
#define Q
Definition: sirandom.c:25
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w, const ring R=currRing)
Definition: ideals.h:114
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:1338
#define Sy_bit(x)
Definition: options.h:30
int minim
Definition: kutil.h:361
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:488
int HCord
Definition: kutil.h:358
pFDegProc pOrigFDeg
Definition: kutil.h:295
#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:296
intvec * kModW
Definition: kstd1.cc:2042
BOOLEAN homog
Definition: kutil.h:366
Definition: intvec.h:16
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
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:3452
#define assume(x)
Definition: mod2.h:405
void idDelete(ideal *h, ring r=currRing)
delete an ideal
Definition: ideals.h:31
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:209
ideal M
Definition: kutil.h:303
int i
Definition: cfEzgcd.cc:123
#define pOne()
Definition: polys.h:286
#define IDELEMS(i)
Definition: simpleideals.h:19
void idSkipZeroes(ideal ide)
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3464
kStrategy strat
Definition: myNF.cc:319
#define TEST_OPT_RETURN_SB
Definition: options.h:107
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:428
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
intvec * kModW
Definition: kutil.h:335
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2044
ideal idCopy(ideal A, const ring R=currRing)
Definition: ideals.h:76
#define OPT_DEGBOUND
Definition: options.h:85
int LazyPass
Definition: kutil.h:356
int Kstd1_deg
Definition: kutil.cc:228
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN idIs0(ideal h)
const poly b
Definition: syzextra.cc:213
int LazyDegree
Definition: kutil.h:356
ideal mora(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd1.cc:1462
#define Warn
Definition: emacs.cc:80
long kModDeg ( poly  p,
ring  r = currRing 
)

Definition at line 2044 of file kstd1.cc.

2045 {
2046  long o=p_WDegree(p, r);
2047  long i=p_GetComp(p, r);
2048  if (i==0) return o;
2049  //assume((i>0) && (i<=kModW->length()));
2050  if (i<=kModW->length())
2051  return o+(*kModW)[i-1];
2052  return o;
2053 }
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 2598 of file kstd1.cc.

2599 {
2600  if (p==NULL)
2601  return NULL;
2602 
2603  poly pp = p;
2604 
2605 #ifdef HAVE_PLURAL
2606  if(rIsSCA(currRing))
2607  {
2608  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
2609  const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
2610  pp = p_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing);
2611 
2612  if(Q == currRing->qideal)
2613  Q = SCAQuotient(currRing);
2614  }
2615 #endif
2616 
2617  if ((idIs0(F))&&(Q==NULL))
2618  {
2619 #ifdef HAVE_PLURAL
2620  if(p != pp)
2621  return pp;
2622 #endif
2623  return pCopy(p); /*F+Q=0*/
2624  }
2625 
2627  strat->syzComp = syzComp;
2628  strat->ak = si_max(id_RankFreeModule(F,currRing),pMaxComp(p));
2629  poly res;
2630 
2632  res=kNF1(F,Q,pp,strat,lazyReduce);
2633  else
2634  res=kNF2(F,Q,pp,strat,lazyReduce);
2635  delete(strat);
2636 
2637 #ifdef HAVE_PLURAL
2638  if(pp != p)
2639  p_Delete(&pp, currRing);
2640 #endif
2641  return res;
2642 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:742
ideal SCAQuotient(const ring r)
Definition: sca.h:10
int syzComp
Definition: kutil.h:357
#define pMaxComp(p)
Definition: polys.h:270
return P p
Definition: myNF.cc:203
int ak
Definition: kutil.h:356
#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:2395
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int syzComp
Definition: myNF.cc:291
polyrec * poly
Definition: hilb.h:10
poly kNF1(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
Definition: kstd1.cc:1766
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
static short scaFirstAltVar(ring r)
Definition: sca.h:18
kStrategy strat
Definition: myNF.cc:319
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
BOOLEAN idIs0(ideal h)
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 2644 of file kstd1.cc.

2645 {
2646  ideal res;
2647  if (TEST_OPT_PROT)
2648  {
2649  Print("(S:%d)",IDELEMS(p));mflush();
2650  }
2651  if (idIs0(p))
2652  return idInit(IDELEMS(p),si_max(p->rank,F->rank));
2653 
2654  ideal pp = p;
2655 #ifdef HAVE_PLURAL
2656  if(rIsSCA(currRing))
2657  {
2658  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
2659  const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
2660  pp = id_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing, false);
2661 
2662  if(Q == currRing->qideal)
2663  Q = SCAQuotient(currRing);
2664  }
2665 #endif
2666 
2667  if ((idIs0(F))&&(Q==NULL))
2668  {
2669 #ifdef HAVE_PLURAL
2670  if(p != pp)
2671  return pp;
2672 #endif
2673  return idCopy(p); /*F+Q=0*/
2674  }
2675 
2677  strat->syzComp = syzComp;
2679  if (strat->ak>0) // only for module case, see Tst/Short/bug_reduce.tst
2680  {
2681  strat->ak = si_max(strat->ak,(int)F->rank);
2682  }
2683 
2685  res=kNF1(F,Q,pp,strat,lazyReduce);
2686  else
2687  res=kNF2(F,Q,pp,strat,lazyReduce);
2688  delete(strat);
2689 
2690 #ifdef HAVE_PLURAL
2691  if(pp != p)
2692  id_Delete(&pp, currRing);
2693 #endif
2694 
2695  return res;
2696 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:742
ideal SCAQuotient(const ring r)
Definition: sca.h:10
#define Print
Definition: emacs.cc:83
int syzComp
Definition: kutil.h:357
#define TEST_OPT_PROT
Definition: options.h:98
return P p
Definition: myNF.cc:203
const ideal
Definition: gb_hack.h:42
void id_Delete(ideal *h, ring r)
int ak
Definition: kutil.h:356
#define Q
Definition: sirandom.c:25
poly pp
Definition: myNF.cc:296
#define mflush()
Definition: reporter.h:42
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:2395
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
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:1766
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
#define IDELEMS(i)
Definition: simpleideals.h:19
static short scaFirstAltVar(ring r)
Definition: sca.h:18
kStrategy strat
Definition: myNF.cc:319
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
#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
ideal idCopy(ideal A, const ring R=currRing)
Definition: ideals.h:76
BOOLEAN idIs0(ideal h)
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int int lazyReduce
Definition: myNF.cc:292
poly kNF ( 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 2698 of file kstd1.cc.

2699 {
2700  const ring save = currRing; if( currRing != _currRing ) rChangeCurrRing(_currRing);
2701  poly ret = kNF(F, Q, p, syzComp, lazyReduce);
2702  if( currRing != save ) rChangeCurrRing(save);
2703  return ret;
2704 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2598
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
polyrec * poly
Definition: hilb.h:10
void rChangeCurrRing(ring r)
Definition: polys.cc:14
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 1766 of file kstd1.cc.

1767 {
1768  assume(q!=NULL);
1769  assume(!(idIs0(F)&&(Q==NULL)));
1770 
1771 // lazy_reduce flags: can be combined by |
1772 //#define KSTD_NF_LAZY 1
1773  // do only a reduction of the leading term
1774 //#define KSTD_NF_ECART 2
1775  // only local: recude even with bad ecart
1776  poly p;
1777  int i;
1778  int j;
1779  int o;
1780  LObject h;
1781  BITSET save1;
1782  SI_SAVE_OPT1(save1);
1783 
1784  //if ((idIs0(F))&&(Q==NULL))
1785  // return pCopy(q); /*F=0*/
1786  //strat->ak = si_max(idRankFreeModule(F),pMaxComp(q));
1787  /*- creating temp data structures------------------- -*/
1788  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
1789  strat->kNoether = pCopy((currRing->ppNoether));
1793  && (! TEST_V_DEG_STOP)
1794  && (0<Kstd1_deg)
1795  && ((!strat->kHEdgeFound)
1797  {
1798  pDelete(&strat->kNoether);
1799  strat->kNoether=pOne();
1800  pSetExp(strat->kNoether,1, Kstd1_deg+1);
1801  pSetm(strat->kNoether);
1802  strat->kHEdgeFound=TRUE;
1803  }
1804  initBuchMoraCrit(strat);
1805  initBuchMoraPos(strat);
1806  initMora(F,strat);
1807  strat->enterS = enterSMoraNF;
1808  /*- set T -*/
1809  strat->tl = -1;
1810  strat->tmax = setmaxT;
1811  strat->T = initT();
1812  strat->R = initR();
1813  strat->sevT = initsevT();
1814  /*- set S -*/
1815  strat->sl = -1;
1816  /*- init local data struct.-------------------------- -*/
1817  /*Shdl=*/initS(F,Q,strat);
1818  if ((strat->ak!=0)
1819  && (strat->kHEdgeFound))
1820  {
1821  if (strat->ak!=1)
1822  {
1823  pSetComp(strat->kNoether,1);
1824  pSetmComp(strat->kNoether);
1825  poly p=pHead(strat->kNoether);
1826  pSetComp(p,strat->ak);
1827  pSetmComp(p);
1828  p=pAdd(strat->kNoether,p);
1829  strat->kNoether=pNext(p);
1830  p_LmFree(p,currRing);
1831  }
1832  }
1833  if ((lazyReduce & KSTD_NF_LAZY)==0)
1834  {
1835  for (i=strat->sl; i>=0; i--)
1836  pNorm(strat->S[i]);
1837  }
1838  /*- puts the elements of S also to T -*/
1839  for (i=0; i<=strat->sl; i++)
1840  {
1841  h.p = strat->S[i];
1842  h.ecart = strat->ecartS[i];
1843  if (strat->sevS[i] == 0) strat->sevS[i] = pGetShortExpVector(h.p);
1844  else assume(strat->sevS[i] == pGetShortExpVector(h.p));
1845  h.length = pLength(h.p);
1846  h.sev = strat->sevS[i];
1847  h.SetpFDeg();
1848  enterT(h,strat);
1849  }
1850 #ifdef KDEBUG
1851 // kDebugPrint(strat);
1852 #endif
1853  /*- compute------------------------------------------- -*/
1854  p = pCopy(q);
1855  deleteHC(&p,&o,&j,strat);
1856  kTest(strat);
1857  if (TEST_OPT_PROT) { PrintS("r"); mflush(); }
1858  if (BVERBOSE(23)) kDebugPrint(strat);
1859  if (p!=NULL) p = redMoraNF(p,strat, lazyReduce & KSTD_NF_ECART);
1860  if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
1861  {
1862  if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
1863  p = redtail(p,strat->sl,strat);
1864  }
1865  /*- release temp data------------------------------- -*/
1866  cleanT(strat);
1867  assume(strat->L==NULL); /*strat->L unsed */
1868  assume(strat->B==NULL); /*strat->B unused */
1869  omFreeSize((ADDRESS)strat->T,strat->tmax*sizeof(TObject));
1870  omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
1871  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
1872  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
1873  omFree(strat->sevT);
1874  omFree(strat->S_2_R);
1875  omFree(strat->R);
1876 
1877  if ((Q!=NULL)&&(strat->fromQ!=NULL))
1878  {
1879  i=((IDELEMS(Q)+IDELEMS(F)+15)/16)*16;
1880  omFreeSize((ADDRESS)strat->fromQ,i*sizeof(int));
1881  strat->fromQ=NULL;
1882  }
1883  pDelete(&strat->kHEdge);
1884  pDelete(&strat->kNoether);
1885 // if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
1886 // {
1887 // pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
1888 // if (ecartWeights)
1889 // {
1890 // omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
1891 // ecartWeights=NULL;
1892 // }
1893 // }
1894  idDelete(&strat->Shdl);
1895  SI_RESTORE_OPT1(save1);
1896  if (TEST_OPT_PROT) PrintLn();
1897  return p;
1898 }
#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:5337
#define pSetm(p)
Definition: polys.h:241
void PrintLn()
Definition: reporter.cc:322
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:7466
poly kHEdge
Definition: kutil.h:327
void initMora(ideal F, kStrategy strat)
Definition: kstd1.cc:1403
class sLObject LObject
Definition: kutil.h:58
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:342
return P p
Definition: myNF.cc:203
void enterT(LObject p, kStrategy strat, int atT)
Definition: kutil.cc:7161
BOOLEAN * NotUsedAxis
Definition: kutil.h:332
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
poly kNoether
Definition: kutil.h:328
int tl
Definition: kutil.h:353
#define TRUE
Definition: auxiliary.h:144
#define kTest(A)
Definition: kutil.h:615
unsigned long * sevT
Definition: kutil.h:323
void * ADDRESS
Definition: auxiliary.h:161
#define SI_SAVE_OPT1(A)
Definition: options.h:20
int ak
Definition: kutil.h:356
#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
#define mflush()
Definition: reporter.h:42
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:5733
#define KSTD_NF_LAZY
Definition: kstd1.h:15
#define setmaxT
Definition: kutil.h:30
#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
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
intset fromQ
Definition: kutil.h:319
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
Definition: polys.h:140
#define KSTD_NF_ECART
Definition: kstd1.h:17
#define pSetComp(p, v)
Definition: polys.h:38
void idDelete(ideal *h, ring r=currRing)
delete an ideal
Definition: ideals.h:31
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:7325
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:340
#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:304
#define IDELEMS(i)
Definition: simpleideals.h:19
int tmax
Definition: kutil.h:353
#define OPT_INTSTRATEGY
Definition: options.h:87
#define BVERBOSE(a)
Definition: options.h:33
BOOLEAN kHEdgeFound
Definition: kutil.h:370
intset ecartS
Definition: kutil.h:307
LSet L
Definition: kutil.h:325
#define NULL
Definition: omList.c:10
void cleanT(kStrategy strat)
Definition: kutil.cc:491
LSet B
Definition: kutil.h:326
void enterSMoraNF(LObject p, int atS, kStrategy strat, int atR=-1)
Definition: kstd1.cc:1269
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:320
#define pNext(p)
Definition: monomials.h:43
static poly redMoraNF(poly h, kStrategy strat, int flag)
Definition: kstd1.cc:708
int sl
Definition: kutil.h:351
TSet T
Definition: kutil.h:324
int Kstd1_deg
Definition: kutil.cc:228
ideal Shdl
Definition: kutil.h:301
void(* enterS)(LObject h, int pos, kStrategy strat, int atR)
Definition: kutil.h:285
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN idIs0(ideal h)
#define SI_RESTORE_OPT1(A)
Definition: options.h:23
void kDebugPrint(kStrategy strat)
Definition: kutil.cc:8780
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int int lazyReduce
Definition: myNF.cc:292
class sTObject TObject
Definition: kutil.h:57
#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 1900 of file kstd1.cc.

1901 {
1902  assume(!idIs0(q));
1903  assume(!(idIs0(F)&&(Q==NULL)));
1904 
1905 // lazy_reduce flags: can be combined by |
1906 //#define KSTD_NF_LAZY 1
1907  // do only a reduction of the leading term
1908 //#define KSTD_NF_ECART 2
1909  // only local: recude even with bad ecart
1910  poly p;
1911  int i;
1912  int j;
1913  int o;
1914  LObject h;
1915  ideal res;
1916  BITSET save1;
1917  SI_SAVE_OPT1(save1);
1918 
1919  //if (idIs0(q)) return idInit(IDELEMS(q),si_max(q->rank,F->rank));
1920  //if ((idIs0(F))&&(Q==NULL))
1921  // return idCopy(q); /*F=0*/
1922  //strat->ak = si_max(idRankFreeModule(F),idRankFreeModule(q));
1923  /*- creating temp data structures------------------- -*/
1924  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
1925  strat->kNoether=pCopy((currRing->ppNoether));
1928  && (0<Kstd1_deg)
1929  && ((!strat->kHEdgeFound)
1931  {
1932  pDelete(&strat->kNoether);
1933  strat->kNoether=pOne();
1934  pSetExp(strat->kNoether,1, Kstd1_deg+1);
1935  pSetm(strat->kNoether);
1936  strat->kHEdgeFound=TRUE;
1937  }
1938  initBuchMoraCrit(strat);
1939  initBuchMoraPos(strat);
1940  initMora(F,strat);
1941  strat->enterS = enterSMoraNF;
1942  /*- set T -*/
1943  strat->tl = -1;
1944  strat->tmax = setmaxT;
1945  strat->T = initT();
1946  strat->R = initR();
1947  strat->sevT = initsevT();
1948  /*- set S -*/
1949  strat->sl = -1;
1950  /*- init local data struct.-------------------------- -*/
1951  /*Shdl=*/initS(F,Q,strat);
1952  if ((strat->ak!=0)
1953  && (strat->kHEdgeFound))
1954  {
1955  if (strat->ak!=1)
1956  {
1957  pSetComp(strat->kNoether,1);
1958  pSetmComp(strat->kNoether);
1959  poly p=pHead(strat->kNoether);
1960  pSetComp(p,strat->ak);
1961  pSetmComp(p);
1962  p=pAdd(strat->kNoether,p);
1963  strat->kNoether=pNext(p);
1964  p_LmFree(p,currRing);
1965  }
1966  }
1968  {
1969  for (i=strat->sl; i>=0; i--)
1970  pNorm(strat->S[i]);
1971  }
1972  /*- compute------------------------------------------- -*/
1973  res=idInit(IDELEMS(q),strat->ak);
1974  for (i=0; i<IDELEMS(q); i++)
1975  {
1976  if (q->m[i]!=NULL)
1977  {
1978  p = pCopy(q->m[i]);
1979  deleteHC(&p,&o,&j,strat);
1980  if (p!=NULL)
1981  {
1982  /*- puts the elements of S also to T -*/
1983  for (j=0; j<=strat->sl; j++)
1984  {
1985  h.p = strat->S[j];
1986  h.ecart = strat->ecartS[j];
1987  h.pLength = h.length = pLength(h.p);
1988  if (strat->sevS[j] == 0) strat->sevS[j] = pGetShortExpVector(h.p);
1989  else assume(strat->sevS[j] == pGetShortExpVector(h.p));
1990  h.sev = strat->sevS[j];
1991  h.SetpFDeg();
1992  enterT(h,strat);
1993  }
1994  if (TEST_OPT_PROT) { PrintS("r"); mflush(); }
1995  p = redMoraNF(p,strat, lazyReduce & KSTD_NF_ECART);
1996  if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
1997  {
1998  if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
1999  p = redtail(p,strat->sl,strat);
2000  }
2001  cleanT(strat);
2002  }
2003  res->m[i]=p;
2004  }
2005  //else
2006  // res->m[i]=NULL;
2007  }
2008  /*- release temp data------------------------------- -*/
2009  assume(strat->L==NULL); /*strat->L unsed */
2010  assume(strat->B==NULL); /*strat->B unused */
2011  omFreeSize((ADDRESS)strat->T,strat->tmax*sizeof(TObject));
2012  omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
2013  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
2014  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
2015  omFree(strat->sevT);
2016  omFree(strat->S_2_R);
2017  omFree(strat->R);
2018  if ((Q!=NULL)&&(strat->fromQ!=NULL))
2019  {
2020  i=((IDELEMS(Q)+IDELEMS(F)+15)/16)*16;
2021  omFreeSize((ADDRESS)strat->fromQ,i*sizeof(int));
2022  strat->fromQ=NULL;
2023  }
2024  pDelete(&strat->kHEdge);
2025  pDelete(&strat->kNoether);
2026 // if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
2027 // {
2028 // pFDeg=strat->pOrigFDeg;
2029 // pLDeg=strat->pOrigLDeg;
2030 // if (ecartWeights)
2031 // {
2032 // omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
2033 // ecartWeights=NULL;
2034 // }
2035 // }
2036  idDelete(&strat->Shdl);
2037  SI_RESTORE_OPT1(save1);
2038  if (TEST_OPT_PROT) PrintLn();
2039  return res;
2040 }
#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:5337
#define pSetm(p)
Definition: polys.h:241
void PrintLn()
Definition: reporter.cc:322
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:7466
poly kHEdge
Definition: kutil.h:327
void initMora(ideal F, kStrategy strat)
Definition: kstd1.cc:1403
class sLObject LObject
Definition: kutil.h:58
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:342
return P p
Definition: myNF.cc:203
void enterT(LObject p, kStrategy strat, int atT)
Definition: kutil.cc:7161
BOOLEAN * NotUsedAxis
Definition: kutil.h:332
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
const ideal
Definition: gb_hack.h:42
poly kNoether
Definition: kutil.h:328
int tl
Definition: kutil.h:353
#define TRUE
Definition: auxiliary.h:144
unsigned long * sevT
Definition: kutil.h:323
void * ADDRESS
Definition: auxiliary.h:161
#define SI_SAVE_OPT1(A)
Definition: options.h:20
int ak
Definition: kutil.h:356
#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
#define mflush()
Definition: reporter.h:42
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:5733
#define KSTD_NF_LAZY
Definition: kstd1.h:15
#define TEST_OPT_INTSTRATEGY
Definition: options.h:105
#define setmaxT
Definition: kutil.h:30
#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
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
intset fromQ
Definition: kutil.h:319
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
Definition: polys.h:140
#define KSTD_NF_ECART
Definition: kstd1.h:17
#define pSetComp(p, v)
Definition: polys.h:38
void idDelete(ideal *h, ring r=currRing)
delete an ideal
Definition: ideals.h:31
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:7325
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:340
#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:304
#define IDELEMS(i)
Definition: simpleideals.h:19
int tmax
Definition: kutil.h:353
BOOLEAN kHEdgeFound
Definition: kutil.h:370
intset ecartS
Definition: kutil.h:307
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
LSet L
Definition: kutil.h:325
#define NULL
Definition: omList.c:10
void cleanT(kStrategy strat)
Definition: kutil.cc:491
LSet B
Definition: kutil.h:326
void enterSMoraNF(LObject p, int atS, kStrategy strat, int atR=-1)
Definition: kstd1.cc:1269
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:320
#define pNext(p)
Definition: monomials.h:43
static poly redMoraNF(poly h, kStrategy strat, int flag)
Definition: kstd1.cc:708
int sl
Definition: kutil.h:351
TSet T
Definition: kutil.h:324
int Kstd1_deg
Definition: kutil.cc:228
ideal Shdl
Definition: kutil.h:301
void(* enterS)(LObject h, int pos, kStrategy strat, int atR)
Definition: kutil.h:285
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN idIs0(ideal h)
#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:57
#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 2202 of file kstd1.cc.

2204 {
2205  if(idIs0(F))
2206  return idInit(1,F->rank);
2207 
2208  ideal r;
2209  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
2210  BOOLEAN delete_w=(w==NULL);
2212  strat->sbaOrder = sbaOrder;
2213  if (arri!=0)
2214  {
2215  strat->rewCrit1 = arriRewDummy;
2216  strat->rewCrit2 = arriRewCriterion;
2217  strat->rewCrit3 = arriRewCriterionPre;
2218  }
2219  else
2220  {
2221  strat->rewCrit1 = faugereRewCriterion;
2222  strat->rewCrit2 = faugereRewCriterion;
2223  strat->rewCrit3 = faugereRewCriterion;
2224  }
2225 
2226  if(!TEST_OPT_RETURN_SB)
2227  strat->syzComp = syzComp;
2228  if (TEST_OPT_SB_1)
2229  #ifdef HAVE_RINGS
2230  if(!rField_is_Ring(currRing))
2231  #endif
2232  strat->newIdeal = newIdeal;
2234  strat->LazyPass=20;
2235  else
2236  strat->LazyPass=2;
2237  strat->LazyDegree = 1;
2239  strat->chainCrit=chainCritNormal;
2240  strat->ak = id_RankFreeModule(F,currRing);
2241  strat->kModW=kModW=NULL;
2242  strat->kHomW=kHomW=NULL;
2243  if (vw != NULL)
2244  {
2245  currRing->pLexOrder=FALSE;
2246  strat->kHomW=kHomW=vw;
2247  strat->pOrigFDeg = currRing->pFDeg;
2248  strat->pOrigLDeg = currRing->pLDeg;
2250  toReset = TRUE;
2251  }
2252  if (h==testHomog)
2253  {
2254  if (strat->ak == 0)
2255  {
2256  h = (tHomog)idHomIdeal(F,Q);
2257  w=NULL;
2258  }
2259  else if (!TEST_OPT_DEGBOUND)
2260  {
2261  h = (tHomog)idHomModule(F,Q,w);
2262  }
2263  }
2264  currRing->pLexOrder=b;
2265  if (h==isHomog)
2266  {
2267  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2268  {
2269  strat->kModW = kModW = *w;
2270  if (vw == NULL)
2271  {
2272  strat->pOrigFDeg = currRing->pFDeg;
2273  strat->pOrigLDeg = currRing->pLDeg;
2275  toReset = TRUE;
2276  }
2277  }
2278  currRing->pLexOrder = TRUE;
2279  if (hilb==NULL) strat->LazyPass*=2;
2280  }
2281  strat->homog=h;
2282 #ifdef KDEBUG
2283  idTest(F);
2284  idTest(Q);
2285 
2286 #if MYTEST
2287  if (TEST_OPT_DEBUG)
2288  {
2289  PrintS("// kSTD: currRing: ");
2290  rWrite(currRing);
2291  }
2292 #endif
2293 
2294 #endif
2295 #ifdef HAVE_PLURAL
2296  if (rIsPluralRing(currRing))
2297  {
2298  const BOOLEAN bIsSCA = rIsSCA(currRing) && strat->z2homog; // for Z_2 prod-crit
2299  strat->no_prod_crit = ! bIsSCA;
2300  if (w!=NULL)
2301  r = nc_GB(F, Q, *w, hilb, strat, currRing);
2302  else
2303  r = nc_GB(F, Q, NULL, hilb, strat, currRing);
2304  }
2305  else
2306 #endif
2307 #ifdef HAVE_RINGS
2308  if (rField_is_Ring(currRing))
2309  r=bba(F,Q,NULL,hilb,strat);
2310  else
2311 #endif
2312  {
2314  {
2315  if (w!=NULL)
2316  r=mora(F,Q,*w,hilb,strat);
2317  else
2318  r=mora(F,Q,NULL,hilb,strat);
2319  }
2320  else
2321  {
2322  if (w!=NULL)
2323  r=sba(F,Q,*w,hilb,strat);
2324  else
2325  r=sba(F,Q,NULL,hilb,strat);
2326  }
2327  }
2328 #ifdef KDEBUG
2329  idTest(r);
2330 #endif
2331  if (toReset)
2332  {
2333  kModW = NULL;
2334  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2335  }
2336  currRing->pLexOrder = b;
2337 //Print("%d reductions canceled \n",strat->cel);
2338  HCord=strat->HCord;
2339  delete(strat);
2340  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
2341  return r;
2342 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:742
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL, const ring R=currRing)
Definition: ideals.h:109
int HCord
Definition: kutil.cc:227
int syzComp
Definition: kutil.h:357
#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:292
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly, kStrategy strat, int start=0)
Definition: kutil.cc:5145
#define FALSE
Definition: auxiliary.h:140
void chainCritNormal(poly p, int ecart, kStrategy strat)
Definition: kutil.cc:2186
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.h:293
const ideal
Definition: gb_hack.h:42
BOOLEAN z2homog
Definition: kutil.h:368
#define TRUE
Definition: auxiliary.h:144
BOOLEAN(* rewCrit3)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.h:294
int ak
Definition: kutil.h:356
#define TEST_OPT_DEBUG
Definition: options.h:103
#define Q
Definition: sirandom.c:25
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w, const ring R=currRing)
Definition: ideals.h:114
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:1338
ideal sba(ideal F0, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:1670
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
int int kStrategy strat if(h==NULL) return NULL
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
Definition: kutil.cc:1490
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:488
int HCord
Definition: kutil.h:358
pFDegProc pOrigFDeg
Definition: kutil.h:295
intvec * kHomW
Definition: kstd1.cc:2042
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:289
const ring r
Definition: syzextra.cc:208
pLDegProc pOrigLDeg
Definition: kutil.h:296
intvec * kModW
Definition: kstd1.cc:2042
BOOLEAN homog
Definition: kutil.h:366
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
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:3452
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2054
unsigned sbaOrder
Definition: kutil.h:314
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:3464
BOOLEAN arriRewCriterion(poly, unsigned long, poly, kStrategy strat, int start=0)
Definition: kutil.cc:5201
kStrategy strat
Definition: myNF.cc:319
#define TEST_OPT_RETURN_SB
Definition: options.h:107
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int)
Definition: kutil.cc:5224
void(* chainCrit)(poly p, int ecart, kStrategy strat)
Definition: kutil.h:290
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:428
#define NULL
Definition: omList.c:10
intvec * kHomW
Definition: kutil.h:336
#define TEST_OPT_SB_1
Definition: options.h:113
const CanonicalForm & w
Definition: facAbsFact.cc:55
intvec * kModW
Definition: kutil.h:335
BOOLEAN no_prod_crit
Definition: kutil.h:389
static bool rIsSCA(const ring r)
Definition: nc.h:206
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2044
int LazyPass
Definition: kutil.h:356
int newIdeal
Definition: kutil.h:360
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)
const poly b
Definition: syzextra.cc:213
KINLINE BOOLEAN arriRewDummy(poly, unsigned long, poly, kStrategy, int)
Definition: kInline.h:1158
int LazyDegree
Definition: kutil.h:356
ideal mora(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd1.cc:1462
#define idTest(id)
Definition: ideals.h:63
ideal kStd ( ideal  F,
ideal  Q,
tHomog  h,
intvec **  mw,
intvec hilb = NULL,
int  syzComp = 0,
int  newIdeal = 0,
intvec vw = NULL 
)

Definition at line 2067 of file kstd1.cc.

2069 {
2070  if(idIs0(F))
2071  return idInit(1,F->rank);
2072 
2073  ideal r;
2074  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
2075  BOOLEAN delete_w=(w==NULL);
2077 
2078  if(!TEST_OPT_RETURN_SB)
2079  strat->syzComp = syzComp;
2080  if (TEST_OPT_SB_1
2081  #ifdef HAVE_RINGS
2082  &&(!rField_is_Ring(currRing))
2083  #endif
2084  )
2085  strat->newIdeal = newIdeal;
2087  strat->LazyPass=20;
2088  else
2089  strat->LazyPass=2;
2090  strat->LazyDegree = 1;
2092  strat->chainCrit=chainCritNormal;
2093  strat->ak = id_RankFreeModule(F,currRing);
2094  strat->kModW=kModW=NULL;
2095  strat->kHomW=kHomW=NULL;
2096  if (vw != NULL)
2097  {
2098  currRing->pLexOrder=FALSE;
2099  strat->kHomW=kHomW=vw;
2100  strat->pOrigFDeg = currRing->pFDeg;
2101  strat->pOrigLDeg = currRing->pLDeg;
2103  toReset = TRUE;
2104  }
2105  if (h==testHomog)
2106  {
2107  if (strat->ak == 0)
2108  {
2109  h = (tHomog)idHomIdeal(F,Q);
2110  w=NULL;
2111  }
2112  else if (!TEST_OPT_DEGBOUND)
2113  {
2114  h = (tHomog)idHomModule(F,Q,w);
2115  }
2116  }
2117  currRing->pLexOrder=b;
2118  if (h==isHomog)
2119  {
2120  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2121  {
2122  strat->kModW = kModW = *w;
2123  if (vw == NULL)
2124  {
2125  strat->pOrigFDeg = currRing->pFDeg;
2126  strat->pOrigLDeg = currRing->pLDeg;
2128  toReset = TRUE;
2129  }
2130  }
2131  currRing->pLexOrder = TRUE;
2132  if (hilb==NULL) strat->LazyPass*=2;
2133  }
2134  strat->homog=h;
2135 #ifdef KDEBUG
2136  idTest(F);
2137  idTest(Q);
2138 
2139 #if MYTEST
2140  if (TEST_OPT_DEBUG)
2141  {
2142  PrintS("// kSTD: currRing: ");
2143  rWrite(currRing);
2144  }
2145 #endif
2146 
2147 #endif
2148 #ifdef HAVE_PLURAL
2149  if (rIsPluralRing(currRing))
2150  {
2151  const BOOLEAN bIsSCA = rIsSCA(currRing) && strat->z2homog; // for Z_2 prod-crit
2152  strat->no_prod_crit = ! bIsSCA;
2153  if (w!=NULL)
2154  r = nc_GB(F, Q, *w, hilb, strat, currRing);
2155  else
2156  r = nc_GB(F, Q, NULL, hilb, strat, currRing);
2157  }
2158  else
2159 #endif
2160 #ifdef HAVE_RINGS
2161  if (rField_is_Ring(currRing))
2162  {
2164  r=mora(F,Q,NULL,hilb,strat);
2165  else
2166  r=bba(F,Q,NULL,hilb,strat);
2167  }
2168  else
2169 #endif
2170  {
2172  {
2173  if (w!=NULL)
2174  r=mora(F,Q,*w,hilb,strat);
2175  else
2176  r=mora(F,Q,NULL,hilb,strat);
2177  }
2178  else
2179  {
2180  if (w!=NULL)
2181  r=bba(F,Q,*w,hilb,strat);
2182  else
2183  r=bba(F,Q,NULL,hilb,strat);
2184  }
2185  }
2186 #ifdef KDEBUG
2187  idTest(r);
2188 #endif
2189  if (toReset)
2190  {
2191  kModW = NULL;
2192  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2193  }
2194  currRing->pLexOrder = b;
2195 //Print("%d reductions canceled \n",strat->cel);
2196  HCord=strat->HCord;
2197  delete(strat);
2198  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
2199  return r;
2200 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:742
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL, const ring R=currRing)
Definition: ideals.h:109
int HCord
Definition: kutil.cc:227
int syzComp
Definition: kutil.h:357
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define FALSE
Definition: auxiliary.h:140
void chainCritNormal(poly p, int ecart, kStrategy strat)
Definition: kutil.cc:2186
const ideal
Definition: gb_hack.h:42
BOOLEAN z2homog
Definition: kutil.h:368
#define TRUE
Definition: auxiliary.h:144
int ak
Definition: kutil.h:356
#define TEST_OPT_DEBUG
Definition: options.h:103
#define Q
Definition: sirandom.c:25
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w, const ring R=currRing)
Definition: ideals.h:114
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:1338
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
int int kStrategy strat if(h==NULL) return NULL
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
Definition: kutil.cc:1490
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:488
int HCord
Definition: kutil.h:358
pFDegProc pOrigFDeg
Definition: kutil.h:295
intvec * kHomW
Definition: kstd1.cc:2042
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:289
const ring r
Definition: syzextra.cc:208
pLDegProc pOrigLDeg
Definition: kutil.h:296
intvec * kModW
Definition: kstd1.cc:2042
BOOLEAN homog
Definition: kutil.h:366
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
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:3452
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2054
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:3464
kStrategy strat
Definition: myNF.cc:319
#define TEST_OPT_RETURN_SB
Definition: options.h:107
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
void(* chainCrit)(poly p, int ecart, kStrategy strat)
Definition: kutil.h:290
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:428
#define NULL
Definition: omList.c:10
intvec * kHomW
Definition: kutil.h:336
#define TEST_OPT_SB_1
Definition: options.h:113
const CanonicalForm & w
Definition: facAbsFact.cc:55
intvec * kModW
Definition: kutil.h:335
BOOLEAN no_prod_crit
Definition: kutil.h:389
static bool rIsSCA(const ring r)
Definition: nc.h:206
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2044
int LazyPass
Definition: kutil.h:356
int newIdeal
Definition: kutil.h:360
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)
const poly b
Definition: syzextra.cc:213
int LazyDegree
Definition: kutil.h:356
ideal mora(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd1.cc:1462
#define idTest(id)
Definition: ideals.h:63
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 2345 of file kstd1.cc.

2347 {
2348  ideal r;
2349  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
2350  BOOLEAN delete_w=(w==NULL);
2352 
2353  if(!TEST_OPT_RETURN_SB)
2354  strat->syzComp = syzComp;
2355  if (TEST_OPT_SB_1)
2356  #ifdef HAVE_RINGS
2357  if(!rField_is_Ring(currRing))
2358  #endif
2359  strat->newIdeal = newIdeal;
2361  strat->LazyPass=20;
2362  else
2363  strat->LazyPass=2;
2364  strat->LazyDegree = 1;
2365  strat->ak = id_RankFreeModule(F,currRing);
2366  strat->kModW=kModW=NULL;
2367  strat->kHomW=kHomW=NULL;
2368  if (vw != NULL)
2369  {
2370  currRing->pLexOrder=FALSE;
2371  strat->kHomW=kHomW=vw;
2372  strat->pOrigFDeg = currRing->pFDeg;
2373  strat->pOrigLDeg = currRing->pLDeg;
2375  toReset = TRUE;
2376  }
2377  if (h==testHomog)
2378  {
2379  if (strat->ak == 0)
2380  {
2381  h = (tHomog)idHomIdeal(F,Q);
2382  w=NULL;
2383  }
2384  else if (!TEST_OPT_DEGBOUND)
2385  {
2386  h = (tHomog)idHomModule(F,Q,w);
2387  }
2388  }
2389  currRing->pLexOrder=b;
2390  if (h==isHomog)
2391  {
2392  if (strat->ak > 0 && (w!=NULL) && (*w!=NULL))
2393  {
2394  strat->kModW = kModW = *w;
2395  if (vw == NULL)
2396  {
2397  strat->pOrigFDeg = currRing->pFDeg;
2398  strat->pOrigLDeg = currRing->pLDeg;
2400  toReset = TRUE;
2401  }
2402  }
2403  currRing->pLexOrder = TRUE;
2404  if (hilb==NULL) strat->LazyPass*=2;
2405  }
2406  strat->homog=h;
2407 #ifdef KDEBUG
2408  idTest(F);
2409 #endif
2411  {
2412  /* error: no local ord yet with shifts */
2413  Print("No local ordering possible for shifts");
2414  return(NULL);
2415  }
2416  else
2417  {
2418  /* global ordering */
2419  if (w!=NULL)
2420  r=bbaShift(F,Q,*w,hilb,strat,uptodeg,lV);
2421  else
2422  r=bbaShift(F,Q,NULL,hilb,strat,uptodeg,lV);
2423  }
2424 #ifdef KDEBUG
2425  idTest(r);
2426 #endif
2427  if (toReset)
2428  {
2429  kModW = NULL;
2430  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
2431  }
2432  currRing->pLexOrder = b;
2433 //Print("%d reductions canceled \n",strat->cel);
2434  HCord=strat->HCord;
2435  delete(strat);
2436  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
2437  return r;
2438 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:742
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL, const ring R=currRing)
Definition: ideals.h:109
int HCord
Definition: kutil.cc:227
#define Print
Definition: emacs.cc:83
int syzComp
Definition: kutil.h:357
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define FALSE
Definition: auxiliary.h:140
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
int ak
Definition: kutil.h:356
#define Q
Definition: sirandom.c:25
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w, const ring R=currRing)
Definition: ideals.h:114
int int kStrategy strat if(h==NULL) return NULL
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:488
int HCord
Definition: kutil.h:358
pFDegProc pOrigFDeg
Definition: kutil.h:295
intvec * kHomW
Definition: kstd1.cc:2042
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:296
intvec * kModW
Definition: kstd1.cc:2042
BOOLEAN homog
Definition: kutil.h:366
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
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:3452
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2054
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3464
kStrategy strat
Definition: myNF.cc:319
#define TEST_OPT_RETURN_SB
Definition: options.h:107
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:428
#define NULL
Definition: omList.c:10
intvec * kHomW
Definition: kutil.h:336
#define TEST_OPT_SB_1
Definition: options.h:113
const CanonicalForm & w
Definition: facAbsFact.cc:55
intvec * kModW
Definition: kutil.h:335
ideal bbaShift(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat, int uptodeg, int lV)
Definition: kstd2.cc:2868
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2044
int LazyPass
Definition: kutil.h:356
int newIdeal
Definition: kutil.h:360
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
const poly b
Definition: syzextra.cc:213
int LazyDegree
Definition: kutil.h:356
#define idTest(id)
Definition: ideals.h:63
ideal mora ( ideal  F,
ideal  Q,
intvec w,
intvec hilb,
kStrategy  strat 
)

Definition at line 1462 of file kstd1.cc.

1463 {
1464 #ifdef HAVE_RINGS
1465 #if ADIDEBUG
1466 int loop_count;
1467 loop_count = 1;
1468 #endif
1469 #endif
1470  int olddeg = 0;
1471  int reduc = 0;
1472  int red_result = 1;
1473  int hilbeledeg=1,hilbcount=0;
1474  BITSET save1;
1475  SI_SAVE_OPT1(save1);
1476  if (currRing->MixedOrder)
1477  {
1478  si_opt_1 &= ~Sy_bit(OPT_REDSB);
1480  }
1481 
1482  strat->update = TRUE;
1483  /*- setting global variables ------------------- -*/
1484  initBuchMoraCrit(strat);
1485  initHilbCrit(F,Q,&hilb,strat);
1486  initMora(F,strat);
1487  initBuchMoraPos(strat);
1488  /*Shdl=*/initBuchMora(F,Q,strat);
1489  if (TEST_OPT_FASTHC) missingAxis(&strat->lastAxis,strat);
1490  /*updateS in initBuchMora has Hecketest
1491  * and could have put strat->kHEdgdeFound FALSE*/
1492  if ((currRing->ppNoether)!=NULL)
1493  {
1494  strat->kHEdgeFound = TRUE;
1495  }
1496  if (strat->kHEdgeFound && strat->update)
1497  {
1498  firstUpdate(strat);
1499  updateLHC(strat);
1500  reorderL(strat);
1501  }
1502  if (TEST_OPT_FASTHC && (strat->lastAxis) && strat->posInLOldFlag)
1503  {
1504  strat->posInLOld = strat->posInL;
1505  strat->posInLOldFlag = FALSE;
1506  strat->posInL = posInL10;
1507  updateL(strat);
1508  reorderL(strat);
1509  }
1510  kTest_TS(strat);
1511  strat->use_buckets = kMoraUseBucket(strat);
1512  /*- compute-------------------------------------------*/
1513 
1514 #ifdef HAVE_TAIL_RING
1515 // if (strat->homog && strat->red == redFirst)
1516  kStratInitChangeTailRing(strat);
1517 #endif
1518 
1519  if (BVERBOSE(23))
1520  {
1521  kDebugPrint(strat);
1522  }
1523 
1524  while (strat->Ll >= 0)
1525  {
1526  #ifdef KDEBUG
1527  if (TEST_OPT_DEBUG) messageSets(strat);
1528  #endif
1529  if (TEST_OPT_DEGBOUND
1530  && (strat->L[strat->Ll].ecart+strat->L[strat->Ll].GetpFDeg()> Kstd1_deg))
1531  {
1532  /*
1533  * stops computation if
1534  * - 24 (degBound)
1535  * && upper degree is bigger than Kstd1_deg
1536  */
1537  while ((strat->Ll >= 0)
1538  && (strat->L[strat->Ll].p1!=NULL) && (strat->L[strat->Ll].p2!=NULL)
1539  && (strat->L[strat->Ll].ecart+strat->L[strat->Ll].GetpFDeg()> Kstd1_deg)
1540  )
1541  {
1542  deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
1543  //if (TEST_OPT_PROT)
1544  //{
1545  // PrintS("D"); mflush();
1546  //}
1547  }
1548  if (strat->Ll<0) break;
1549  else strat->noClearS=TRUE;
1550  }
1551 
1552 #if ADIDEBUG
1553 #ifdef KDEBUG
1554  Print("\n-------------------------------- LOOP %d ---------------------------------------\n",loop_count);
1555  //print the list L: (p1,p2,p)
1556  Print("\n The pair list L -- in loop %d -- is:\n",loop_count);
1557  for(int iii=0;iii<=strat->Ll;iii++)
1558  {
1559  Print("\n L[%d]:\n",iii);
1560  PrintS(" ");p_Write(strat->L[iii].p1,strat->tailRing);
1561  PrintS(" ");p_Write(strat->L[iii].p2,strat->tailRing);
1562  PrintS(" ");p_Write(strat->L[iii].p,strat->tailRing);
1563  }
1564  PrintLn();
1565 #endif
1566 #endif
1567 
1568  strat->P = strat->L[strat->Ll];/*- picks the last element from the lazyset L -*/
1569  if (strat->Ll==0) strat->interpt=TRUE;
1570  strat->Ll--;
1571 
1572 #if ADIDEBUG
1573 #ifdef KDEBUG
1574  PrintS(" My new pair P = (p1,p2,p) is:\n");
1575  PrintS(" p1 = "); p_Write(strat->P.p1,strat->tailRing);PrintLn();
1576  PrintS(" p2 = "); p_Write(strat->P.p2,strat->tailRing);PrintLn();
1577  PrintS(" p = "); p_Write(strat->P.p,strat->tailRing); PrintLn();
1578  Print("\n The old reducer list T -- at the beg of loop %d -- is :",loop_count);
1579  if(strat->tl<0)
1580  {PrintS(" Empty.\n");}
1581  else
1582  for(int iii=0;iii<=strat->tl;iii++)
1583  {
1584  Print("\n T[%d]:",iii);
1585  p_Write(strat->T[iii].p,strat->T->tailRing);
1586  }
1587  PrintLn();
1588 #endif /* ADIDEBUG */
1589 #endif
1590 
1591  // create the real Spoly
1592  if (pNext(strat->P.p) == strat->tail)
1593  {
1594  /*- deletes the short spoly and computes -*/
1595 #ifdef HAVE_RINGS
1596  if (rField_is_Ring(currRing))
1597  pLmDelete(strat->P.p);
1598  else
1599 #endif
1600  pLmFree(strat->P.p);
1601  strat->P.p = NULL;
1602  poly m1 = NULL, m2 = NULL;
1603  // check that spoly creation is ok
1604  while (strat->tailRing != currRing &&
1605  !kCheckSpolyCreation(&(strat->P), strat, m1, m2))
1606  {
1607  assume(m1 == NULL && m2 == NULL);
1608  // if not, change to a ring where exponents are large enough
1609  kStratChangeTailRing(strat);
1610  }
1611  /* create the real one */
1612  ksCreateSpoly(&(strat->P), strat->kNoetherTail(), strat->use_buckets,
1613  strat->tailRing, m1, m2, strat->R);
1614  if (!strat->use_buckets)
1615  strat->P.SetLength(strat->length_pLength);
1616  }
1617  else if (strat->P.p1 == NULL)
1618  {
1619  // for input polys, prepare reduction (buckets !)
1620  strat->P.SetLength(strat->length_pLength);
1621  strat->P.PrepareRed(strat->use_buckets);
1622  }
1623 
1624  if (!strat->P.IsNull())
1625  {
1626  // might be NULL from noether !!!
1627  if (TEST_OPT_PROT)
1628  message(strat->P.ecart+strat->P.GetpFDeg(),&olddeg,&reduc,strat, red_result);
1629  // reduce
1630  red_result = strat->red(&strat->P,strat);
1631  }
1632 
1633  if (! strat->P.IsNull())
1634  {
1635  strat->P.GetP();
1636  // statistics
1637  if (TEST_OPT_PROT) PrintS("s");
1638  // normalization
1639  if (!TEST_OPT_INTSTRATEGY)
1640  strat->P.pNorm();
1641  // tailreduction
1642  strat->P.p = redtail(&(strat->P),strat->sl,strat);
1643  // set ecart -- might have changed because of tail reductions
1644  if ((!strat->noTailReduction) && (!strat->honey))
1645  strat->initEcart(&strat->P);
1646  // cancel unit
1647  cancelunit(&strat->P);
1648  // for char 0, clear denominators
1650  strat->P.pCleardenom();
1651 
1652  // put in T
1653  enterT(strat->P,strat);
1654  // build new pairs
1655 #ifdef HAVE_RINGS
1656  if (rField_is_Ring(currRing))
1657  {
1658  superenterpairs(strat->P.p,strat->sl,strat->P.ecart,0,strat, strat->tl);
1659 
1660 #if ADIDEBUG
1661  Print("\n The new pair list L -- after superenterpairs in loop %d -- is:\n",loop_count);
1662  for(int iii=0;iii<=strat->Ll;iii++)
1663  {
1664  PrintS("\n L[%d]:\n",iii);
1665  PrintS(" ");p_Write(strat->L[iii].p1,strat->tailRing);
1666  PrintS(" ");p_Write(strat->L[iii].p2,strat->tailRing);
1667  PrintS(" ");p_Write(strat->L[iii].p,strat->tailRing);
1668  }
1669 #endif
1670  }
1671  else
1672 #endif
1673  enterpairs(strat->P.p,strat->sl,strat->P.ecart,0,strat, strat->tl);
1674  // put in S
1675  strat->enterS(strat->P,
1676  posInS(strat,strat->sl,strat->P.p, strat->P.ecart),
1677  strat, strat->tl);
1678 
1679  // apply hilbert criterion
1680  if (hilb!=NULL)
1681  {
1682  if (strat->homog==isHomog)
1683  khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
1684  else
1685  khCheckLocInhom(Q,w,hilb,hilbcount,strat);
1686  }
1687 
1688  // clear strat->P
1689  if (strat->P.lcm!=NULL)
1690 #if defined(HAVE_RINGS)
1691  pLmDelete(strat->P.lcm);
1692 #else
1693  pLmFree(strat->P.lcm);
1694 #endif
1695  strat->P.lcm=NULL;
1696 #ifdef KDEBUG
1697  // make sure kTest_TS does not complain about strat->P
1698  memset(&strat->P,0,sizeof(strat->P));
1699 #endif
1700  }
1701  if (strat->kHEdgeFound)
1702  {
1703  if ((TEST_OPT_FINDET)
1704  || ((TEST_OPT_MULTBOUND) && (scMult0Int(strat->Shdl,NULL,strat->tailRing) < Kstd1_mu)))
1705  {
1706  // obachman: is this still used ???
1707  /*
1708  * stops computation if strat->kHEdgeFound and
1709  * - 27 (finiteDeterminacyTest)
1710  * or
1711  * - 23
1712  * (multBound)
1713  * && multiplicity of the ideal is smaller then a predefined number mu
1714  */
1715  while (strat->Ll >= 0) deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
1716  }
1717  }
1718  kTest_TS(strat);
1719 
1720 #if ADIDEBUG
1721  Print("\n The new reducer list T -- at the end of loop %d -- is\n",loop_count);
1722  for(int iii=0;iii<=strat->tl;iii++)
1723  {
1724  PrintS("\n T[%d]:",iii);
1725  p_Write(strat->T[iii].p,strat->tailRing);
1726  }
1727  PrintLn();
1728 
1729  loop_count++;
1730 #endif /* ADIDEBUG */
1731  }
1732  /*- complete reduction of the standard basis------------------------ -*/
1733  if (TEST_OPT_REDSB) completeReduce(strat);
1734  else if (TEST_OPT_PROT) PrintLn();
1735  /*- release temp data------------------------------- -*/
1736  exitBuchMora(strat);
1737  /*- polynomials used for HECKE: HC, noether -*/
1738  if (TEST_OPT_FINDET)
1739  {
1740  if (strat->kHEdge!=NULL)
1741  Kstd1_mu=currRing->pFDeg(strat->kHEdge,currRing);
1742  else
1743  Kstd1_mu=-1;
1744  }
1745  pDelete(&strat->kHEdge);
1746  strat->update = TRUE; //???
1747  strat->lastAxis = 0; //???
1748  pDelete(&strat->kNoether);
1749  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
1750  if (TEST_OPT_PROT) messageStat(hilbcount,strat);
1751 // if (TEST_OPT_WEIGHTM)
1752 // {
1753 // pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
1754 // if (ecartWeights)
1755 // {
1756 // omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
1757 // ecartWeights=NULL;
1758 // }
1759 // }
1760  if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
1761  SI_RESTORE_OPT1(save1);
1762  idTest(strat->Shdl);
1763  return (strat->Shdl);
1764 }
#define OPT_REDSB
Definition: options.h:71
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.h:283
unsigned si_opt_1
Definition: options.c:5
poly redtail(LObject *L, int pos, kStrategy strat)
Definition: kutil.cc:5337
void PrintLn()
Definition: reporter.cc:322
#define Print
Definition: emacs.cc:83
#define TEST_OPT_DEGBOUND
Definition: options.h:108
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:7466
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
Definition: kutil.cc:5628
void initMora(ideal F, kStrategy strat)
Definition: kstd1.cc:1403
BOOLEAN length_pLength
Definition: kutil.h:382
void messageStat(int hilbcount, kStrategy strat)
Definition: kutil.cc:5669
#define TEST_OPT_PROT
Definition: options.h:98
int Ll
Definition: kutil.h:354
#define FALSE
Definition: auxiliary.h:140
void initBuchMora(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:7558
void enterT(LObject p, kStrategy strat, int atT)
Definition: kutil.cc:7161
#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:3671
int tl
Definition: kutil.h:353
#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:397
#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 cancelunit(LObject *L, BOOLEAN inNF)
Definition: kutil.cc:324
#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
void updateL(kStrategy strat)
Definition: kstd1.cc:980
int lastAxis
Definition: kutil.h:359
void kStratInitChangeTailRing(kStrategy strat)
Definition: kutil.cc:8334
int Kstd1_mu
Definition: kutil.cc:229
#define TEST_OPT_FINDET
Definition: options.h:106
void missingAxis(int *last, kStrategy strat)
Definition: kstd1.cc:866
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition: kutil.cc:1039
BOOLEAN interpt
Definition: kutil.h:365
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define TEST_OPT_INTSTRATEGY
Definition: options.h:105
#define kTest_TS(A)
Definition: kutil.h:616
#define OPT_REDTAIL
Definition: options.h:86
void initHilbCrit(ideal, ideal, intvec **hilb, kStrategy strat)
Definition: kutil.cc:7305
polyrec * poly
Definition: hilb.h:10
int scMult0Int(ideal S, ideal Q, const ring tailRing)
Definition: hdegree.cc:914
#define assume(x)
Definition: mod2.h:405
#define messageSets(s)
Definition: kutil.h:506
void updateLHC(kStrategy strat)
Definition: kstd1.cc:1054
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
Definition: kspoly.cc:376
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject *T, unsigned long expbound)
Definition: kutil.cc:8231
LObject P
Definition: kutil.h:300
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:7325
void reorderL(kStrategy strat)
Definition: kstd1.cc:808
BOOLEAN update
Definition: kutil.h:375
void PrintS(const char *s)
Definition: reporter.cc:294
poly tail
Definition: kutil.h:334
int(* posInLOld)(const LSet Ls, const int Ll, LObject *Lo, const kStrategy strat)
Definition: kutil.h:287
TObject ** R
Definition: kutil.h:340
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
Definition: kutil.cc:8176
#define BVERBOSE(a)
Definition: options.h:33
kStrategy strat
Definition: myNF.cc:319
void khCheck(ideal Q, intvec *w, intvec *hilb, int &eledeg, int &count, kStrategy strat)
Definition: khstd.cc:35
BOOLEAN kHEdgeFound
Definition: kutil.h:370
LSet L
Definition: kutil.h:325
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:428
#define NULL
Definition: omList.c:10
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
Definition: kutil.cc:3597
void firstUpdate(kStrategy strat)
Definition: kstd1.cc:1138
ring tailRing
Definition: kutil.h:343
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:3860
#define pDelete(p_ptr)
Definition: polys.h:157
BOOLEAN posInLOldFlag
Definition: kutil.h:376
void completeReduce(kStrategy strat, BOOLEAN withT)
Definition: kutil.cc:7991
#define pNext(p)
Definition: monomials.h:43
void updateResult(ideal r, ideal Q, kStrategy strat)
Definition: kutil.cc:7864
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
TSet T
Definition: kutil.h:324
static BOOLEAN kMoraUseBucket(kStrategy strat)
Definition: kstd1.cc:3137
BOOLEAN use_buckets
Definition: kutil.h:377
void p_Write(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:204
#define TEST_OPT_FASTHC
Definition: options.h:104
int Kstd1_deg
Definition: kutil.cc:228
int BOOLEAN
Definition: auxiliary.h:131
KINLINE poly kNoetherTail()
Definition: kInline.h:63
#define SI_RESTORE_OPT1(A)
Definition: options.h:23
void exitBuchMora(kStrategy strat)
Definition: kutil.cc:7637
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
Definition: kstd1.cc:947
void kDebugPrint(kStrategy strat)
Definition: kutil.cc:8780
#define idTest(id)
Definition: ideals.h:63
ideal stdred ( ideal  F,
ideal  Q,
tHomog  h,
intvec **  w 
)

Variable Documentation

intvec* kHomW

Definition at line 2042 of file kstd1.cc.

intvec* kModW

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