My Project  debian-1:4.1.2-p1+ds-2
Macros | Functions
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_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  ,
unsigned long  ,
poly  ,
kStrategy  ,
int   
)

Definition at line 1197 of file kInline.h.

1204 {

◆ clearS()

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

Definition at line 1172 of file kInline.h.

1172 {
1173  LObject L(p, currRing, strat->tailRing);
1174  return redtailBba_Z(&L, pos, strat);
1175 }
1176 #endif
1177 
1178 KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k,
1179  kStrategy strat)
1180 {
1181  assume(p_sev == pGetShortExpVector(p));
1182  if (strat->noClearS) return;
1183  #ifdef HAVE_RINGS
1185  {
1186  if (!pLmShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at]))
1187  return;
1188  if(!n_DivBy(pGetCoeff(strat->S[*at]), pGetCoeff(p), currRing->cf))
1189  return;
1190  }
1191  else
1192  #endif
1193  {

◆ initR()

KINLINE TObject** initR ( )

Definition at line 94 of file kInline.h.

96 {
97  return (TObject**) omAlloc0(setmaxT*sizeof(TObject*));

◆ initsevT()

KINLINE unsigned long* initsevT ( )

Definition at line 99 of file kInline.h.

101 {
102  return (unsigned long*) omAlloc0(setmaxT*sizeof(unsigned long));

◆ initT()

KINLINE TSet initT ( )

Definition at line 83 of file kInline.h.

85 {
86  TSet T = (TSet)omAlloc0(setmaxT*sizeof(TObject));
87  for (int i=setmaxT-1; i>=0; i--)
88  {
89  T[i].tailRing = currRing;
90  T[i].i_r = -1;
91  }
92  return T;

◆ 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 960 of file kInline.h.

966 {
967  p_LmCheckPolyRing(p1, p_r);
968  p_LmCheckPolyRing(p2, p_r);
969 
970  int i;
971  long x;
972  m1 = p_Init(m_r,m_r->PolyBin);
973  m2 = p_Init(m_r,m_r->PolyBin);
974 
975  for (i = p_r->N; i; i--)
976  {
977  x = p_GetExpDiff(p1, p2, i, p_r);
978  if (x > 0)
979  {
980  if (x > (long) m_r->bitmask) goto false_return;
981  p_SetExp(m2,i,x, m_r);
982  p_SetExp(m1,i,0, m_r);
983  }
984  else
985  {
986  if (-x > (long) m_r->bitmask) goto false_return;
987  p_SetExp(m1,i,-x, m_r);
988  p_SetExp(m2,i,0, m_r);
989  }
990  }
991 
992  p_Setm(m1, m_r);
993  p_Setm(m2, m_r);
994  return TRUE;
995 
996  false_return:
997  p_LmFree(m1, m_r);

◆ 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 1003 of file kInline.h.

1009 {
1010  p_LmCheckPolyRing(p1, leadRing);
1011  p_LmCheckPolyRing(p2, leadRing);
1012 
1013  int i;
1014  int x;
1015  int e1;
1016  int e2;
1017  int s;
1018  m1 = p_Init(tailRing,tailRing->PolyBin);
1019  m2 = p_Init(tailRing,tailRing->PolyBin);
1020  lcm = p_Init(leadRing,leadRing->PolyBin);
1021 
1022  for (i = leadRing->N; i>=0; i--)
1023  {
1024  e1 = p_GetExp(p1,i,leadRing);
1025  e2 = p_GetExp(p2,i,leadRing);
1026  x = e1 - e2;
1027  if (x > 0)
1028  {
1029  p_SetExp(m2,i,x, tailRing);
1030  //p_SetExp(m1,i,0, tailRing); // done by p_Init
1031  s = e1;
1032  }
1033  else if (x<0)
1034  {
1035  p_SetExp(m1,i,-x, tailRing);
1036  //p_SetExp(m2,i,0, tailRing); // done by p_Init
1037  s = e2;
1038  }
1039  else
1040  s = e1; // e1==e2
1041  p_SetExp(lcm,i,s, leadRing);
1042  }
1043 

◆ k_LmInit_currRing_2_tailRing() [1/2]

KINLINE poly k_LmInit_currRing_2_tailRing ( poly  p,
ring  tailRing 
)

Definition at line 934 of file kInline.h.

938 {

◆ k_LmInit_currRing_2_tailRing() [2/2]

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

Definition at line 902 of file kInline.h.

906 {
907 
908  poly t_p = p_LmInit(p, currRing, tailRing, tailBin);
909  pNext(t_p) = pNext(p);

◆ k_LmInit_tailRing_2_currRing() [1/2]

KINLINE poly k_LmInit_tailRing_2_currRing ( poly  p,
ring  tailRing 
)

Definition at line 939 of file kInline.h.

943 {

◆ k_LmInit_tailRing_2_currRing() [2/2]

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

Definition at line 911 of file kInline.h.

915 {
916  poly p = p_LmInit(t_p, tailRing, currRing, lmBin);
917  pNext(p) = pNext(t_p);

◆ k_LmShallowCopyDelete_currRing_2_tailRing() [1/2]

KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing ( poly  p,
ring  tailRing 
)

Definition at line 944 of file kInline.h.

948 {

◆ k_LmShallowCopyDelete_currRing_2_tailRing() [2/2]

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

Definition at line 920 of file kInline.h.

924 {
925  poly np = k_LmInit_currRing_2_tailRing(p, tailRing, tailBin);

◆ k_LmShallowCopyDelete_tailRing_2_currRing() [1/2]

KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing ( poly  p,
ring  tailRing 
)

Definition at line 949 of file kInline.h.

953 {

◆ k_LmShallowCopyDelete_tailRing_2_currRing() [2/2]

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

Definition at line 927 of file kInline.h.

931 {
932  poly np = k_LmInit_tailRing_2_currRing(p, tailRing, lmBin);

◆ ksOldCreateSpoly()

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

Definition at line 1134 of file kInline.h.

1141 {
1142  LObject L(r);

◆ ksOldSpolyRed()

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

Definition at line 1114 of file kInline.h.

1121 {
1122  LObject L(p2);

◆ ksOldSpolyRedNew()

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

Definition at line 1124 of file kInline.h.

1131 {
1132  LObject L(p_Copy(p2, currRing));

◆ ksOldSpolyTail()

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

Definition at line 1144 of file kInline.h.

1151 {

◆ ksReducePolyTail()

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

Definition at line 1088 of file kInline.h.

1094 {
1095  BOOLEAN ret;
1096  number coef;
1097 
1098  assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
1099  Red->HeadNormalize();
1100  ret = ksReducePoly(Red, PW, NULL, &coef);
1101 
1102  if (!ret)
1103  {
1104  if (! n_IsOne(coef, currRing->cf))
1105  {
1106  PR->Mult_nn(coef);
1107  // HANNES: mark for Normalize

◆ ksReducePolyTail_Z()

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

Definition at line 1068 of file kInline.h.

1074 {
1075  BOOLEAN ret;
1076  number coef;
1077 
1078  assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
1079  ret = ksReducePoly(Red, PW, NULL, &coef);
1080 
1081  if (!ret)
1082  {
1083  if (! n_IsOne(coef, currRing->cf))
1084  {
1085  PR->Mult_nn(coef);
1086  // HANNES: mark for Normalize

◆ ksReducePolyTailLC_Z()

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

Definition at line 1050 of file kInline.h.

1056 {
1057  BOOLEAN ret;
1058  number mult, rest;
1059  TObject red = *PW;
1060  red.Copy();
1061  rest = n_QuotRem(pGetCoeff(Red->p), pGetCoeff(red.p),
1062  &mult, currRing->cf);
1063  red.Mult_nn(rest);
1064 
1065  assume(PR->GetLmCurrRing() != red.GetLmCurrRing());
1066  ret = ksReducePolyLC(Red, &red, NULL, &mult);

◆ redtailBba()

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

Definition at line 1152 of file kInline.h.

1159 {

◆ redtailBba_Z()

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

Definition at line 1165 of file kInline.h.

1165 {
1166  LObject L(p, currRing, strat->tailRing); // ? L(p); ??
1167  return redtailBbaBound(&L, pos, strat,bound, FALSE, normalize);
1168 }
1169 

◆ redtailBbaBound()

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

Definition at line 1158 of file kInline.h.

1159 {
1160  LObject L(p);
1161  return redtailBba(&L, pos, strat,FALSE, normalize);
1162 }
clearS
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
Definition: kInline.h:1172
FALSE
#define FALSE
Definition: auxiliary.h:96
k_LmInit_tailRing_2_currRing
KINLINE poly k_LmInit_tailRing_2_currRing(poly t_p, ring tailRing, omBin lmBin)
Definition: kInline.h:911
skStrategy
Definition: kutil.h:266
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:456
k
int k
Definition: cfEzgcd.cc:92
TObject
class sTObject TObject
Definition: kutil.h:52
x
Variable x
Definition: cfModGcd.cc:4023
skStrategy::S
polyset S
Definition: kutil.h:301
p_LmInit
static poly p_LmInit(poly p, const ring r)
Definition: p_polys.h:1257
skStrategy::tailRing
ring tailRing
Definition: kutil.h:340
pGetShortExpVector
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl....
Definition: polys.h:146
skStrategy::sevS
unsigned long * sevS
Definition: kutil.h:317
n_IsOne
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:467
n_QuotRem
static FORCE_INLINE number n_QuotRem(number a, number b, number *q, const coeffs r)
Definition: coeffs.h:702
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:475
k_LmInit_currRing_2_tailRing
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
Definition: kInline.h:902
p_LmCheckPolyRing
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
Definition: pDebug.cc:114
redtailBba_Z
KINLINE poly redtailBba_Z(poly p, int pos, kStrategy strat)
Definition: kInline.h:1165
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:796
TRUE
#define TRUE
Definition: auxiliary.h:100
i
int i
Definition: cfEzgcd.cc:125
ksReducePoly
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
Definition: kspoly.cc:186
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:87
rField_is_Ring
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:478
TSet
TObject * TSet
Definition: kutil.h:54
setmaxT
#define setmaxT
Definition: kutil.h:32
T
STATIC_VAR jList * T
Definition: janet.cc:30
p_Init
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1242
p_LmFree
static void p_LmFree(poly p, ring)
Definition: p_polys.h:669
redtailBba
KINLINE poly redtailBba(poly p, int pos, kStrategy strat, BOOLEAN normalize)
Definition: kInline.h:1152
normalize
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
Definition: syz3.cc:1025
bound
static CanonicalForm bound(const CFMatrix &M)
Definition: cf_linsys.cc:460
mult
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:647
redtailBbaBound
KINLINE poly redtailBbaBound(poly p, int pos, kStrategy strat, int bound, BOOLEAN normalize)
Definition: kInline.h:1158
KINLINE
#define KINLINE
Definition: kutil.h:44
p_GetExpDiff
static long p_GetExpDiff(poly p1, poly p2, int i, ring r)
Definition: p_polys.h:622
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:774
assume
#define assume(x)
Definition: mod2.h:384
NULL
#define NULL
Definition: omList.c:11
skStrategy::noClearS
char noClearS
Definition: kutil.h:400
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:140
lcm
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:709
p_Setm
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:223
LObject
class sLObject LObject
Definition: kutil.h:53
p
int p
Definition: cfModGcd.cc:4019
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
ksReducePolyLC
int ksReducePolyLC(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
Definition: kspoly.cc:434
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:41
pNext
#define pNext(p)
Definition: monomials.h:33
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:209