Macros | Functions
khstd.cc File Reference
#include <kernel/mod2.h>
#include <misc/options.h>
#include <misc/intvec.h>
#include <polys/simpleideals.h>
#include <kernel/combinatorics/stairc.h>
#include <kernel/combinatorics/hilb.h>
#include <kernel/GBEngine/kutil.h>
#include <kernel/GBEngine/kstd1.h>
#include <kernel/GBEngine/khstd.h>
#include <kernel/polys.h>

Go to the source code of this file.

Macros

#define ADIDEBUG   0
 

Functions

void khCheck (ideal Q, intvec *w, intvec *hilb, int &eledeg, int &count, kStrategy strat)
 
void khCheckLocInhom (ideal Q, intvec *w, intvec *hilb, int &count, kStrategy strat)
 

Macro Definition Documentation

#define ADIDEBUG   0

Definition at line 28 of file khstd.cc.

Function Documentation

void khCheck ( ideal  Q,
intvec w,
intvec hilb,
int &  eledeg,
int &  count,
kStrategy  strat 
)

Definition at line 35 of file khstd.cc.

54 {
55  intvec *newhilb;
56  int deg,l,ln,mw;
57  pFDegProc degp;
58 
59  eledeg--;
60  if (eledeg == 0)
61  {
62  if (strat->ak>0)
63  {
64  char *used_comp=(char*)omAlloc0(strat->ak+1);
65  int i;
66  for(i=strat->sl;i>0;i--)
67  {
68  used_comp[pGetComp(strat->S[i])]='\1';
69  }
70  for(i=strat->ak;i>0;i--)
71  {
72  if(used_comp[i]=='\0')
73  {
74  omFree((ADDRESS)used_comp);
75  return;
76  }
77  }
78  omFree((ADDRESS)used_comp);
79  }
80  degp=currRing->pFDeg;
81  // if weights for variables were given to std computations,
82  // then pFDeg == degp == kHomModDeg (see kStd)
83  if ((degp!=kModDeg) && (degp!=kHomModDeg)) degp=p_Totaldegree;
84  // degp = pWDegree;
85  l = hilb->length()-1;
86  mw = (*hilb)[l];
87  newhilb = hHstdSeries(strat->Shdl,w,strat->kHomW,Q,strat->tailRing);
88  ln = newhilb->length()-1;
89  deg = degp(strat->P.p,currRing)-mw;
90  loop // compare the series in degree deg, try to increase deg -----------
91  {
92  if (deg < ln) // deg may be out of range
93  {
94  if (deg < l)
95  eledeg = (*newhilb)[deg]-(*hilb)[deg];
96  else
97  eledeg = (*newhilb)[deg];
98  }
99  else
100  {
101  if (deg < l)
102  eledeg = -(*hilb)[deg];
103  else // we have newhilb = hilb
104  {
105  while (strat->Ll>=0)
106  {
107  count++;
108  if(TEST_OPT_PROT)
109  {
110  PrintS("h");
111  mflush();
112  }
113  deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
114  }
115  delete newhilb;
116  return;
117  }
118  }
119  if (eledeg > 0) // elements to delete
120  break;
121  else if (eledeg <0) // strange....see bug_43
122  return;
123  deg++;
124  } /* loop */
125  delete newhilb;
126  while ((strat->Ll>=0) && (degp(strat->L[strat->Ll].p,currRing)-mw < deg)) // the essential step
127  {
128  count++;
129  if(TEST_OPT_PROT)
130  {
131  PrintS("h");
132  mflush();
133  }
134  deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
135  }
136  }
137 }
int status int void size_t count
Definition: si_signals.h:59
#define TEST_OPT_PROT
Definition: options.h:98
loop
Definition: myNF.cc:98
int Ll
Definition: kutil.h:349
int length() const
Definition: intvec.h:86
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1436
void * ADDRESS
Definition: auxiliary.h:161
int ak
Definition: kutil.h:351
#define Q
Definition: sirandom.c:25
#define pGetComp(p)
Component.
Definition: polys.h:37
intvec * hHstdSeries(ideal S, intvec *modulweight, intvec *wdegree, ideal Q, ring tailRing)
Definition: hilb.cc:1292
#define mflush()
Definition: reporter.h:55
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition: kutil.cc:1049
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: intvec.h:14
#define omFree(addr)
Definition: omAllocDecl.h:261
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2212
LObject P
Definition: kutil.h:298
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
polyset S
Definition: kutil.h:302
LSet L
Definition: kutil.h:323
intvec * kHomW
Definition: kutil.h:334
ring tailRing
Definition: kutil.h:341
long(* pFDegProc)(poly p, ring r)
Definition: ring.h:46
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2202
int sl
Definition: kutil.h:346
ideal Shdl
Definition: kutil.h:299
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:94
void khCheckLocInhom ( ideal  Q,
intvec w,
intvec hilb,
int &  count,
kStrategy  strat 
)

Definition at line 140 of file khstd.cc.

151 {
152  ideal Lm;
153  intvec *newhilb;
154 
155  Lm = id_Head(strat->Shdl,currRing);
156 
157  newhilb =hHstdSeries(Lm,w,strat->kHomW,Q,currRing); // ,strat->tailRing?
158 
159 #if ADIDEBUG
160 PrintS("\nOriginal\n");
161 int i, j, l, k;
162  if (hilb == NULL)
163  return;
164  l = hilb->length()-1;
165  k = (*hilb)[l];
166  for (i = 0; i < l; i++)
167  {
168  j = (*hilb)[i];
169  if (j != 0)
170  {
171  Print("// %8d t^%d\n", j, i+k);
172  }
173  }
174  PrintS("\nActual\n");
175  if (newhilb == NULL)
176  return;
177  l = newhilb->length()-1;
178  k = (*newhilb)[l];
179  for (i = 0; i < l; i++)
180  {
181  j = (*newhilb)[i];
182  if (j != 0)
183  {
184  Print("// %8d t^%d\n", j, i+k);
185  }
186  }
187 #endif
188 
189  if(newhilb->compare(hilb) == 0)
190  {
191  while (strat->Ll>=0)
192  {
193  count++;
194  if(TEST_OPT_PROT)
195  {
196  PrintS("h");
197  mflush();
198  }
199  deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
200  }
201  delete newhilb;
202  return;
203  }
204  id_Delete(&Lm,currRing);
205 }
int status int void size_t count
Definition: si_signals.h:59
#define Print
Definition: emacs.cc:83
#define TEST_OPT_PROT
Definition: options.h:98
int Ll
Definition: kutil.h:349
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
int length() const
Definition: intvec.h:86
int k
Definition: cfEzgcd.cc:93
#define Q
Definition: sirandom.c:25
intvec * hHstdSeries(ideal S, intvec *modulweight, intvec *wdegree, ideal Q, ring tailRing)
Definition: hilb.cc:1292
#define mflush()
Definition: reporter.h:55
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition: kutil.cc:1049
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: intvec.h:14
int j
Definition: myNF.cc:70
int compare(const intvec *o) const
Definition: intvec.cc:207
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
LSet L
Definition: kutil.h:323
#define NULL
Definition: omList.c:10
intvec * kHomW
Definition: kutil.h:334
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
ideal Shdl
Definition: kutil.h:299
int l
Definition: cfEzgcd.cc:94