4#include "gfanlib/gfanlib.h"
6long wDeg(
const poly
p,
const ring r,
const gfan::ZVector &
w)
9 for (
unsigned i=0;
i<
w.size();
i++)
11 if (!
w[
i].fitsInInt())
13 WerrorS(
"wDeg: overflow in weight vector");
21gfan::ZVector
WDeg(
const poly
p,
const ring r,
const gfan::ZVector &
w,
const gfan::ZMatrix &W)
23 gfan::ZVector d = gfan::ZVector(W.getHeight()+1);
25 for (
int i=0;
i<W.getHeight();
i++)
30poly
initial(
const poly
p,
const ring r,
const gfan::ZVector &
w)
38 for (poly currentTerm =
p->next; currentTerm;
pIter(currentTerm))
40 long e =
wDeg(currentTerm,r,
w);
44 q0 =
p_Head(currentTerm,r);
58ideal
initial(
const ideal I,
const ring r,
const gfan::ZVector &
w)
61 for (
int i=0;
i<
k;
i++)
66poly
initial(
const poly
p,
const ring r,
const gfan::ZVector &
w,
const gfan::ZMatrix &W)
73 gfan::ZVector d =
WDeg(
p,r,
w,W);
74 for (poly currentTerm =
p->next; currentTerm;
pIter(currentTerm))
76 gfan::ZVector e =
WDeg(currentTerm,r,
w,W);
94ideal
initial(
const ideal I,
const ring r,
const gfan::ZVector &
w,
const gfan::ZMatrix &W)
97 for (
int i=0;
i<
k;
i++)
102void initial(poly* pStar,
const ring r,
const gfan::ZVector &
w)
141void initial(ideal* IStar,
const ring r,
const gfan::ZVector &
w)
145 for (
int i=0;
i<
k;
i++)
150void initial(poly* pStar,
const ring r,
const gfan::ZVector &
w,
const gfan::ZMatrix &W)
156 gfan::ZVector d =
WDeg(
p,r,
w,W);
164 gfan::ZVector e =
WDeg(
p,r,
w,W);
189void initial(ideal* IStar,
const ring r,
const gfan::ZVector &
w,
const gfan::ZMatrix &W)
193 for (
int i=0;
i<
k;
i++)
void WerrorS(const char *s)
gfan::ZVector WDeg(const poly p, const ring r, const gfan::ZVector &w, const gfan::ZMatrix &W)
Returns the weighted multidegree of the leading term of p with respect to (w,W).
long wDeg(const poly p, const ring r, const gfan::ZVector &w)
various functions to compute the initial form of polynomials and ideals
poly initial(const poly p, const ring r, const gfan::ZVector &w)
Returns the initial form of p with respect to w.
static poly p_Head(const poly p, const ring r)
copy the (leading) term of p
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
static void p_Delete(poly *p, const ring r)
static poly p_LmDeleteAndNext(poly p, const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module