My Project  debian-1:4.1.1-p2+ds-4build3
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.

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)
 

Function Documentation

◆ khCheck()

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

Definition at line 28 of file khstd.cc.

47 {
48  intvec *newhilb;
49  int deg,l,ln,mw;
50  pFDegProc degp;
51 
52  eledeg--;
53  if (eledeg == 0)
54  {
55  if (strat->ak>0)
56  {
57  char *used_comp=(char*)omAlloc0(strat->ak+1);
58  int i;
59  for(i=strat->sl;i>0;i--)
60  {
61  used_comp[pGetComp(strat->S[i])]='\1';
62  }
63  for(i=strat->ak;i>0;i--)
64  {
65  if(used_comp[i]=='\0')
66  {
67  omFree((ADDRESS)used_comp);
68  return;
69  }
70  }
71  omFree((ADDRESS)used_comp);
72  }
73  degp=currRing->pFDeg;
74  // if weights for variables were given to std computations,
75  // then pFDeg == degp == kHomModDeg (see kStd)
76  if ((degp!=kModDeg) && (degp!=kHomModDeg)) degp=p_Totaldegree;
77  // degp = pWDegree;
78  l = hilb->length()-1;
79  mw = (*hilb)[l];
80  newhilb = hHstdSeries(strat->Shdl,w,strat->kHomW,Q,strat->tailRing);
81  ln = newhilb->length()-1;
82  deg = degp(strat->P.p,currRing)-mw;
83  loop // compare the series in degree deg, try to increase deg -----------
84  {
85  if (deg < ln) // deg may be out of range
86  {
87  if (deg < l)
88  eledeg = (*newhilb)[deg]-(*hilb)[deg];
89  else
90  eledeg = (*newhilb)[deg];
91  }
92  else
93  {
94  if (deg < l)
95  eledeg = -(*hilb)[deg];
96  else // we have newhilb = hilb
97  {
98  while (strat->Ll>=0)
99  {
100  count++;
101  if(TEST_OPT_PROT)
102  {
103  PrintS("h");
104  mflush();
105  }
106  deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
107  }
108  delete newhilb;
109  return;
110  }
111  }
112  if (eledeg > 0) // elements to delete
113  break;
114  else if (eledeg <0) // strange....see bug_43
115  return;
116  deg++;
117  } /* loop */
118  delete newhilb;
119  while ((strat->Ll>=0) && (degp(strat->L[strat->Ll].p,currRing)-mw < deg)) // the essential step
120  {
121  count++;
122  if(TEST_OPT_PROT)
123  {
124  PrintS("h");
125  mflush();
126  }
127  deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
128  }
129  }
130 }

◆ khCheckLocInhom()

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

Definition at line 133 of file khstd.cc.

144 {
145  ideal Lm;
146  intvec *newhilb;
147 
148  Lm = id_Head(strat->Shdl,currRing);
149 
150  newhilb =hHstdSeries(Lm,w,strat->kHomW,Q,currRing); // ,strat->tailRing?
151 
152  if(newhilb->compare(hilb) == 0)
153  {
154  while (strat->Ll>=0)
155  {
156  count++;
157  if(TEST_OPT_PROT)
158  {
159  PrintS("h");
160  mflush();
161  }
162  deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
163  }
164  delete newhilb;
165  return;
166  }
167  id_Delete(&Lm,currRing);
168 }
pGetComp
#define pGetComp(p)
Component.
Definition: polys.h:37
omFree
#define omFree(addr)
Definition: omAllocDecl.h:261
TEST_OPT_PROT
#define TEST_OPT_PROT
Definition: options.h:102
skStrategy::P
LObject P
Definition: kutil.h:293
ADDRESS
void * ADDRESS
Definition: auxiliary.h:133
pFDegProc
long(* pFDegProc)(poly p, ring r)
Definition: ring.h:45
skStrategy::L
LSet L
Definition: kutil.h:318
skStrategy::S
polyset S
Definition: kutil.h:297
skStrategy::kHomW
intvec * kHomW
Definition: kutil.h:329
skStrategy::tailRing
ring tailRing
Definition: kutil.h:336
loop
#define loop
Definition: structs.h:78
w
const CanonicalForm & w
Definition: facAbsFact.cc:55
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
i
int i
Definition: cfEzgcd.cc:125
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition: simpleideals.cc:114
skStrategy::sl
int sl
Definition: kutil.h:341
PrintS
void PrintS(const char *s)
Definition: reporter.cc:284
intvec::compare
int compare(const intvec *o) const
Definition: intvec.cc:206
skStrategy::Shdl
ideal Shdl
Definition: kutil.h:294
kModDeg
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2073
intvec
Definition: intvec.h:21
hHstdSeries
intvec * hHstdSeries(ideal S, intvec *modulweight, intvec *wdegree, ideal Q, ring tailRing)
Definition: hilb.cc:1329
skStrategy::Ll
int Ll
Definition: kutil.h:344
mflush
#define mflush()
Definition: reporter.h:57
l
int l
Definition: cfEzgcd.cc:93
skStrategy::ak
int ak
Definition: kutil.h:346
p_Totaldegree
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1453
deleteInL
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition: kutil.cc:1152
count
int status int void size_t count
Definition: si_signals.h:59
kHomModDeg
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2083
Q
#define Q
Definition: sirandom.c:25
intvec::length
int length() const
Definition: intvec.h:94
id_Head
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
Definition: simpleideals.cc:1111
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:211