Loading...
Searching...
No Matches
khstd.h File Reference
`#include "kernel/structs.h"`
`#include "coeffs/bigintmat.h"`

Go to the source code of this file.

## Functions

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

## Function Documentation

## khCheck()

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

Definition at line 28 of file khstd.cc.

{
bigintmat *newhilb;
int deg,l,ln,mw;
pFDegProc degp;
eledeg--;
if (eledeg == 0)
{
if (strat->ak>0)
{
char *used_comp=(char*)omAlloc0(strat->ak+1);
int i;
for(i=strat->sl;i>0;i--)
{
used_comp[pGetComp(strat->S[i])]='\1';
}
for(i=strat->ak;i>0;i--)
{
if(used_comp[i]=='\0')
{
omFree((ADDRESS)used_comp);
return;
}
}
omFree((ADDRESS)used_comp);
}
degp=currRing->pFDeg;
// if weights for variables were given to std computations,
// then pFDeg == degp == kHomModDeg (see kStd)
if ((degp!=kModDeg) && (degp!=kHomModDeg)) degp=p_Totaldegree;
// degp = pWDegree;
l = hilb->cols();
mw = n_Int(BIMATELEM(*hilb,1,l),coeffs_BIGINT);
newhilb =hFirstSeries0b(strat->Shdl,Q,strat->kHomW,w,currRing,coeffs_BIGINT);
ln = newhilb->cols();
deg = degp(strat->P.p,currRing);
loop // compare the series in degree deg, try to increase deg -----------
{
if (deg < ln) // deg may be out of range
{
if (deg < l)
{
number s=n_Sub(BIMATELEM(*newhilb,1,deg+1),
BIMATELEM(*hilb,1,deg+1),coeffs_BIGINT);
eledeg = n_Int(s,coeffs_BIGINT);
}
else
eledeg = n_Int(BIMATELEM(*newhilb,1,deg+1),coeffs_BIGINT);
}
else
{
if (deg < l)
eledeg = -n_Int(BIMATELEM(*hilb,1,deg+1),coeffs_BIGINT);
else // we have newhilb = hilb
{
while (strat->Ll>=0)
{
count++;
if(TEST_OPT_PROT)
{
PrintS("h");
mflush();
}
deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
}
delete newhilb;
return;
}
}
if (eledeg > 0) // elements to delete
break;
else if (eledeg <0) // strange....see bug_43
return;
deg++;
} /* loop */
delete newhilb;
while ((strat->Ll>=0) && (degp(strat->L[strat->Ll].p,currRing)-mw < deg)) // the essential step
{
count++;
if(TEST_OPT_PROT)
{
PrintS("h");
mflush();
}
deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
}
}
}
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
BIMATELEM
#define BIMATELEM(M, I, J)
Definition bigintmat.h:133
l
int l
Definition cfEzgcd.cc:100
i
int i
Definition cfEzgcd.cc:132
bigintmat
Matrices of numbers.
Definition bigintmat.h:51
bigintmat::cols
int cols() const
Definition bigintmat.h:144
skStrategy::Ll
int Ll
Definition kutil.h:350
skStrategy::S
polyset S
Definition kutil.h:305
skStrategy::ak
int ak
Definition kutil.h:352
skStrategy::kHomW
intvec * kHomW
Definition kutil.h:335
skStrategy::Shdl
ideal Shdl
Definition kutil.h:302
skStrategy::P
LObject P
Definition kutil.h:301
skStrategy::L
LSet L
Definition kutil.h:326
skStrategy::sl
int sl
Definition kutil.h:347
n_Int
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
Definition coeffs.h:550
n_Sub
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of 'a' and 'b', i.e., a-b
Definition coeffs.h:658
s
const CanonicalForm int s
Definition facAbsFact.cc:51
w
const CanonicalForm & w
Definition facAbsFact.cc:51
hFirstSeries0b
bigintmat * hFirstSeries0b(ideal I, ideal Q, intvec *wdegree, intvec *shifts, const ring src, const coeffs biv_cf)
Definition hilb.cc:2019
kHomModDeg
long kHomModDeg(poly p, const ring r)
Definition kstd1.cc:2421
kModDeg
long kModDeg(poly p, const ring r)
Definition kstd1.cc:2411
deleteInL
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition kutil.cc:1208
omFree
#define omFree(addr)
Definition omAllocDecl.h:261
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211
TEST_OPT_PROT
#define TEST_OPT_PROT
Definition options.h:105
p_Totaldegree
static long p_Totaldegree(poly p, const ring r)
Definition p_polys.h:1528
coeffs_BIGINT
VAR coeffs coeffs_BIGINT
Definition polys.cc:14
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
pGetComp
#define pGetComp(p)
Component.
Definition polys.h:38
PrintS
void PrintS(const char *s)
Definition reporter.cc:288
mflush
#define mflush()
Definition reporter.h:58
pFDegProc
long(* pFDegProc)(poly p, ring r)
Definition ring.h:39
count
int status int void size_t count
Definition si_signals.h:69
Q
#define Q
Definition sirandom.c:26
loop
#define loop
Definition structs.h:71

## khCheckLocInhom()

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

Definition at line 248 of file khstd.cc.

{
ideal Lm;
bigintmat *newhilb;
Lm = id_Head(strat->Shdl,currRing);
newhilb =hFirstSeries0b(strat->Shdl,Q,strat->kHomW,w,currRing,coeffs_BIGINT);
if(newhilb->compare(hilb) == 0)
{
while (strat->Ll>=0)
{
count++;
if(TEST_OPT_PROT)
{
PrintS("h");
mflush();
}
deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
}
delete newhilb;
return;
}
id_Delete(&Lm,currRing);
}
bigintmat::compare
int compare(const bigintmat *op) const
Definition bigintmat.cc:360
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition simpleideals.cc:123
id_Head
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
Definition simpleideals.cc:1483