Loading...
Searching...
No Matches
kInline.h File Reference
`#include "omalloc/omalloc.h"`
`#include "misc/options.h"`
`#include "polys/monomials/p_polys.h"`
`#include "polys/kbuckets.h"`
`#include "kernel/polys.h"`
`#include "polys/shiftop.h"`

Go to the source code of this file.

## Macros

#define | HAVE_TAIL_BIN

## Functions

KINLINE TSet | initT ()
KINLINE TObject ** | initR ()
KINLINE unsigned long * | initsevT ()
KINLINE poly | k_LmInit_currRing_2_tailRing (poly p, ring tailRing, omBin tailBin)
KINLINE poly | k_LmInit_tailRing_2_currRing (poly t_p, ring tailRing, omBin lmBin)
KINLINE poly | k_LmShallowCopyDelete_currRing_2_tailRing (poly p, ring tailRing, omBin tailBin)
KINLINE poly | k_LmShallowCopyDelete_tailRing_2_currRing (poly p, ring tailRing, omBin lmBin)
KINLINE poly | k_LmInit_currRing_2_tailRing (poly p, ring tailRing)
KINLINE poly | k_LmInit_tailRing_2_currRing (poly p, ring tailRing)
KINLINE poly | k_LmShallowCopyDelete_currRing_2_tailRing (poly p, ring tailRing)
KINLINE poly | k_LmShallowCopyDelete_tailRing_2_currRing (poly p, ring tailRing)
KINLINE BOOLEAN | k_GetLeadTerms (const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
KINLINE void | k_GetStrongLeadTerms (const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring tailRing)
KINLINE int | ksReducePolyTailLC_Z (LObject *PR, TObject *PW, LObject *Red)
KINLINE int | ksReducePolyTail_Z (LObject *PR, TObject *PW, LObject *Red)
KINLINE int | ksReducePolyTail (LObject *PR, TObject *PW, LObject *Red)
KINLINE poly | ksOldSpolyRed (poly p1, poly p2, poly spNoether)
KINLINE poly | ksOldSpolyRedNew (poly p1, poly p2, poly spNoether)
KINLINE poly | ksOldCreateSpoly (poly p1, poly p2, poly spNoether, ring r)
void | ksOldSpolyTail (poly p1, poly q, poly q2, poly spNoether, ring r)
KINLINE poly | redtailBba (poly p, int pos, kStrategy strat, BOOLEAN normalize)
KINLINE poly | redtailBbaBound (poly p, int pos, kStrategy strat, int bound, BOOLEAN normalize)
KINLINE poly | redtailBba_Ring (poly p, int pos, kStrategy strat)
KINLINE poly | redtailBba_Z (poly p, int pos, kStrategy strat)
KINLINE void | clearS (poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
KINLINE BOOLEAN | arriRewDummy (poly, unsigned long, poly, kStrategy, int)

## Macro Definition Documentation

## HAVE_TAIL_BIN

#define HAVE_TAIL_BIN

Definition at line 32 of file kInline.h.

## Function Documentation

## arriRewDummy()

KINLINE BOOLEAN arriRewDummy | ( | poly | sig,
|  | unsigned long | not_sevSig,
|  | poly | lm,
|  | kStrategy | strat,
|  | int | start )

Definition at line 1258 of file kInline.h.

{
return FALSE;
}
FALSE
#define FALSE
Definition auxiliary.h:97

## clearS()

KINLINE void clearS | ( | poly | p,
|  | unsigned long | p_sev,
|  | int * | at,
|  | int * | k,
|  | kStrategy | strat )

Definition at line 1235 of file kInline.h.

{
assume(p_sev == pGetShortExpVector(p));
if (strat->noClearS) return;
if(rField_is_Ring(currRing))
{
if (!pLmShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at]))
return;
if(!n_DivBy(pGetCoeff(strat->S[*at]), pGetCoeff(p), currRing->cf))
return;
}
else
{
if (!pLmShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at])) return;
}
deleteInS((*at),strat);
(*at)--;
(*k)--;
}
p
int p
Definition cfModGcd.cc:4086
skStrategy::S
polyset S
Definition kutil.h:305
skStrategy::noClearS
char noClearS
Definition kutil.h:399
skStrategy::sevS
unsigned long * sevS
Definition kutil.h:321
n_DivBy
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z:...
Definition coeffs.h:750
deleteInS
void deleteInS(int i, kStrategy strat)
Definition kutil.cc:1132
assume
#define assume(x)
Definition mod2.h:389
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition monomials.h:44
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
pLmShortDivisibleBy
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
Definition polys.h:147
pGetShortExpVector
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl....
Definition polys.h:153
rField_is_Ring
#define rField_is_Ring(R)
Definition ring.h:491

## initR()

KINLINE TObject ** initR | ( |  | ) |

Definition at line 95 of file kInline.h.

{
return (TObject**) omAlloc0(setmaxT*sizeof(TObject*));
}
setmaxT
#define setmaxT
Definition kutil.h:34
TObject
class sTObject TObject
Definition kutil.h:58
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211

## initsevT()

KINLINE unsigned long * initsevT | ( |  | ) |

Definition at line 100 of file kInline.h.

{
return (unsigned long*) omAlloc0(setmaxT*sizeof(unsigned long));
}

## initT()

KINLINE TSet initT | ( |  | ) |

Definition at line 84 of file kInline.h.

{
TSet T = (TSet)omAlloc0(setmaxT*sizeof(TObject));
for (int i=setmaxT-1; i>=0; i--)
{
T[i].tailRing = currRing;
T[i].i_r = -1;
}
return T;
}
i
int i
Definition cfEzgcd.cc:132
T
STATIC_VAR jList * T
Definition janet.cc:30
TSet
TObject * TSet
Definition kutil.h:60

## k_GetLeadTerms()

KINLINE BOOLEAN k_GetLeadTerms | ( | const poly | p1,
|  | const poly | p2,
|  | const ring | p_r,
|  | poly & | m1,
|  | poly & | m2,
|  | const ring | m_r )

Definition at line 1018 of file kInline.h.

{
p_LmCheckPolyRing(p1, p_r);
p_LmCheckPolyRing(p2, p_r);
int i;
long x;
m1 = p_Init(m_r,m_r->PolyBin);
m2 = p_Init(m_r,m_r->PolyBin);
for (i = p_r->N; i; i--)
{
x = p_GetExpDiff(p1, p2, i, p_r);
if (x > 0)
{
if (x > (long) m_r->bitmask) goto false_return;
p_SetExp(m2,i,x, m_r);
p_SetExp(m1,i,0, m_r);
}
else
{
if (-x > (long) m_r->bitmask) goto false_return;
p_SetExp(m1,i,-x, m_r);
p_SetExp(m2,i,0, m_r);
}
}
p_Setm(m1, m_r);
p_Setm(m2, m_r);
return TRUE;
false_return:
p_LmFree(m1, m_r);
p_LmFree(m2, m_r);
m1 = m2 = NULL;
return FALSE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
x
Variable x
Definition cfModGcd.cc:4090
NULL
#define NULL
Definition omList.c:12
p_GetExpDiff
static long p_GetExpDiff(poly p1, poly p2, int i, ring r)
Definition p_polys.h:637
p_LmCheckPolyRing
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
Definition pDebug.cc:123
p_SetExp
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition p_polys.h:490
p_Setm
static void p_Setm(poly p, const ring r)
Definition p_polys.h:235
p_LmFree
static void p_LmFree(poly p, ring)
Definition p_polys.h:685
p_Init
static poly p_Init(const ring r, omBin bin)
Definition p_polys.h:1341

## k_GetStrongLeadTerms()

KINLINE void k_GetStrongLeadTerms | ( | const poly | p1,
|  | const poly | p2,
|  | const ring | leadRing,
|  | poly & | m1,
|  | poly & | m2,
|  | poly & | lcm,
|  | const ring | tailRing )

Definition at line 1060 of file kInline.h.

{
p_LmCheckPolyRing(p1, leadRing);
p_LmCheckPolyRing(p2, leadRing);
int i;
int x;
int e1;
int e2;
int s;
m1 = p_Init(tailRing,tailRing->PolyBin);
m2 = p_Init(tailRing,tailRing->PolyBin);
lcm = p_Init(leadRing,leadRing->PolyBin);
for (i = leadRing->N; i>=0; i--)
{
e1 = p_GetExp(p1,i,leadRing);
e2 = p_GetExp(p2,i,leadRing);
x = e1 - e2;
if (x > 0)
{
p_SetExp(m2,i,x, tailRing);
//p_SetExp(m1,i,0, tailRing); // done by p_Init
s = e1;
}
else if (x<0)
{
p_SetExp(m1,i,-x, tailRing);
//p_SetExp(m2,i,0, tailRing); // done by p_Init
s = e2;
}
else
s = e1; // e1==e2
p_SetExp(lcm,i,s, leadRing);
}
p_Setm(m1, tailRing);
p_Setm(m2, tailRing);
p_Setm(lcm, leadRing);
}
s
const CanonicalForm int s
Definition facAbsFact.cc:51
lcm
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition minpoly.cc:709
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition p_polys.h:471

## k_LmInit_currRing_2_tailRing() [1/2]

KINLINE poly k_LmInit_currRing_2_tailRing | ( | poly | p,
|  | ring | tailRing )

Definition at line 991 of file kInline.h.

{
return k_LmInit_currRing_2_tailRing(p, tailRing, tailRing->PolyBin);
}
k_LmInit_currRing_2_tailRing
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
Definition kInline.h:959

## k_LmInit_currRing_2_tailRing() [2/2]

KINLINE poly k_LmInit_currRing_2_tailRing | ( | poly | p,
|  | ring | tailRing,
|  | omBin | tailBin )

Definition at line 959 of file kInline.h.

{
poly t_p = p_LmInit(p, currRing, tailRing, tailBin);
pNext(t_p) = pNext(p);
pSetCoeff0(t_p, pGetCoeff(p));
return t_p;
}
pNext
#define pNext(p)
Definition monomials.h:36
pSetCoeff0
#define pSetCoeff0(p, n)
Definition monomials.h:59
p_LmInit
static poly p_LmInit(poly p, const ring r)
Definition p_polys.h:1356

## k_LmInit_tailRing_2_currRing() [1/2]

KINLINE poly k_LmInit_tailRing_2_currRing | ( | poly | p,
|  | ring | tailRing )

Definition at line 996 of file kInline.h.

{
return k_LmInit_tailRing_2_currRing(p, tailRing, currRing->PolyBin);
}
k_LmInit_tailRing_2_currRing
KINLINE poly k_LmInit_tailRing_2_currRing(poly t_p, ring tailRing, omBin lmBin)
Definition kInline.h:968

## k_LmInit_tailRing_2_currRing() [2/2]

KINLINE poly k_LmInit_tailRing_2_currRing | ( | poly | t_p,
|  | ring | tailRing,
|  | omBin | lmBin )

Definition at line 968 of file kInline.h.

{
poly p = p_LmInit(t_p, tailRing, currRing, lmBin);
pNext(p) = pNext(t_p);
pSetCoeff0(p, pGetCoeff(t_p));
return p;
}

## k_LmShallowCopyDelete_currRing_2_tailRing() [1/2]

KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing | ( | poly | p,
|  | ring | tailRing )

Definition at line 1001 of file kInline.h.

{
return k_LmShallowCopyDelete_currRing_2_tailRing(p, tailRing, tailRing->PolyBin);
}
k_LmShallowCopyDelete_currRing_2_tailRing
KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
Definition kInline.h:977

## k_LmShallowCopyDelete_currRing_2_tailRing() [2/2]

KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing | ( | poly | p,
|  | ring | tailRing,
|  | omBin | tailBin )

Definition at line 977 of file kInline.h.

{
poly np = k_LmInit_currRing_2_tailRing(p, tailRing, tailBin);
p_LmFree(p, currRing);
return np;
}

## k_LmShallowCopyDelete_tailRing_2_currRing() [1/2]

KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing | ( | poly | p,
|  | ring | tailRing )

Definition at line 1006 of file kInline.h.

{
return k_LmShallowCopyDelete_tailRing_2_currRing(p, tailRing, currRing->PolyBin);
}
k_LmShallowCopyDelete_tailRing_2_currRing
KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin lmBin)
Definition kInline.h:984

## k_LmShallowCopyDelete_tailRing_2_currRing() [2/2]

KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing | ( | poly | p,
|  | ring | tailRing,
|  | omBin | lmBin )

Definition at line 984 of file kInline.h.

{
poly np = k_LmInit_tailRing_2_currRing(p, tailRing, lmBin);
p_LmFree(p, tailRing);
return np;
}

## ksOldCreateSpoly()

KINLINE poly ksOldCreateSpoly | ( | poly | p1,
|  | poly | p2,
|  | poly | spNoether,
|  | ring | r )

Definition at line 1194 of file kInline.h.

{
LObject L(r);
L.p1 = p1;
L.p2 = p2;
ksCreateSpoly(&L, spNoether);
return L.GetLmCurrRing();
}
ksCreateSpoly
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
Definition kspoly.cc:1203
LObject
class sLObject LObject
Definition kutil.h:59

## ksOldSpolyRed()

KINLINE poly ksOldSpolyRed | ( | poly | p1,
|  | poly | p2,
|  | poly | spNoether )

Definition at line 1174 of file kInline.h.

{
LObject L(p2);
TObject T(p1);
ksReducePoly(&L, &T, spNoether);
return L.GetLmCurrRing();
}
ksReducePoly
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, poly *mon, kStrategy strat, BOOLEAN reduce)
Definition kspoly.cc:187

## ksOldSpolyRedNew()

KINLINE poly ksOldSpolyRedNew | ( | poly | p1,
|  | poly | p2,
|  | poly | spNoether )

Definition at line 1184 of file kInline.h.

{
LObject L(p_Copy(p2, currRing));
TObject T(p1);
ksReducePoly(&L, &T, spNoether);
return L.GetLmCurrRing();
}
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848

## ksOldSpolyTail()

void ksOldSpolyTail | ( | poly | p1,
|  | poly | q,
|  | poly | q2,
|  | poly | spNoether,
|  | ring | r )

Definition at line 1204 of file kInline.h.

{
LObject L(q, currRing, r);
TObject T(p1, currRing, r);
ksReducePolyTail(&L, &T, q2, spNoether);
}
ksReducePolyTail
KINLINE int ksReducePolyTail(LObject *PR, TObject *PW, LObject *Red)
Definition kInline.h:1147

## ksReducePolyTail()

KINLINE int ksReducePolyTail | ( | LObject * | PR,
|  | TObject * | PW,
|  | LObject * | Red )

Definition at line 1147 of file kInline.h.

{
BOOLEAN ret;
number coef;
assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
Red->HeadNormalize();
ret = ksReducePoly(Red, PW, NULL, &coef);
if (!ret)
{
if (! n_IsOne(coef, currRing->cf))
{
PR->Mult_nn(coef);
// HANNES: mark for Normalize
}
n_Delete(&coef, currRing->cf);
}
return ret;
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:461
n_IsOne
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition coeffs.h:474

## ksReducePolyTail_Z()

KINLINE int ksReducePolyTail_Z | ( | LObject * | PR,
|  | TObject * | PW,
|  | LObject * | Red )

Definition at line 1125 of file kInline.h.

{
BOOLEAN ret;
number coef=NULL;
assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
ret = ksReducePoly(Red, PW, NULL, &coef, NULL,NULL,TRUE);
#if 0 // shlould not happen
if (!ret)
{
if (! n_IsOne(coef, currRing->cf))
{
PR->Mult_nn(coef);
// HANNES: mark for Normalize
}
}
#endif
n_Delete(&coef, currRing->cf);
return ret;
}

## ksReducePolyTailLC_Z()

KINLINE int ksReducePolyTailLC_Z | ( | LObject * | PR,
|  | TObject * | PW,
|  | LObject * | Red )

Definition at line 1107 of file kInline.h.

{
BOOLEAN ret;
number mult, rest;
TObject red = *PW;
red.Copy();
rest = n_QuotRem(pGetCoeff(Red->p), pGetCoeff(red.p),
&mult, currRing->cf);
red.Mult_nn(rest);
assume(PR->GetLmCurrRing() != red.GetLmCurrRing());
ret = ksReducePolyLC(Red, &red, NULL, &mult);
red.Delete();
red.Clear();
return ret;
}
n_QuotRem
static FORCE_INLINE number n_QuotRem(number a, number b, number *q, const coeffs r)
Definition coeffs.h:684
ksReducePolyLC
int ksReducePolyLC(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
Definition kspoly.cc:477
mult
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition minpoly.cc:647

## redtailBba()

KINLINE poly redtailBba | ( | poly | p,
|  | int | pos,
|  | kStrategy | strat,
|  | BOOLEAN | normalize )

Definition at line 1212 of file kInline.h.

{
LObject L(p);
return redtailBba(&L, pos, strat,FALSE, normalize);
}
redtailBba
KINLINE poly redtailBba(poly p, int pos, kStrategy strat, BOOLEAN normalize)
Definition kInline.h:1212
normalize
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
Definition syz3.cc:1027

## redtailBba_Ring()

KINLINE poly redtailBba_Ring | ( | poly | p,
|  | int | pos,
|  | kStrategy | strat )

Definition at line 1224 of file kInline.h.

{
LObject L(p, currRing, strat->tailRing);
return redtailBba_Ring(&L, pos, strat);
}
skStrategy::tailRing
ring tailRing
Definition kutil.h:342
redtailBba_Ring
KINLINE poly redtailBba_Ring(poly p, int pos, kStrategy strat)
Definition kInline.h:1224

## redtailBba_Z()

KINLINE poly redtailBba_Z | ( | poly | p,
|  | int | pos,
|  | kStrategy | strat )

Definition at line 1229 of file kInline.h.

{
LObject L(p, currRing, strat->tailRing);
return redtailBba_Z(&L, pos, strat);
}
redtailBba_Z
KINLINE poly redtailBba_Z(poly p, int pos, kStrategy strat)
Definition kInline.h:1229

## redtailBbaBound()

KINLINE poly redtailBbaBound | ( | poly | p,
|  | int | pos,
|  | kStrategy | strat,
|  | int | bound,
|  | BOOLEAN | normalize )

Definition at line 1218 of file kInline.h.

{
LObject L(p, currRing, strat->tailRing); // ? L(p); ??
return redtailBbaBound(&L, pos, strat,bound, FALSE, normalize);
}
bound
static CanonicalForm bound(const CFMatrix &M)
Definition cf_linsys.cc:460
redtailBbaBound
KINLINE poly redtailBbaBound(poly p, int pos, kStrategy strat, int bound, BOOLEAN normalize)
Definition kInline.h:1218