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

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

Function Documentation

◆ arriRewDummy()

KINLINE BOOLEAN arriRewDummy ( poly  ,
unsigned long  ,
poly  ,
kStrategy  ,
int   
)

Definition at line 1132 of file kInline.h.

1141 {

◆ clearS()

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

Definition at line 1107 of file kInline.h.

1109 {
1110  LObject L(p, currRing, strat->tailRing);
1111  return redtailBba_Z(&L, pos, strat);
1112 }
1113 #endif
1114 
1115 KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k,
1116  kStrategy strat)
1117 {
1118  assume(p_sev == pGetShortExpVector(p));
1119  if (strat->noClearS) return;
1120  #ifdef HAVE_RINGS
1122  {
1123  if (!pLmShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at]))
1124  return;
1125  if(!n_DivBy(pGetCoeff(strat->S[*at]), pGetCoeff(p), currRing->cf))
1126  return;
1127  }
1128  else

◆ initR()

KINLINE TObject** initR ( )

Definition at line 89 of file kInline.h.

93 {

◆ initsevT()

KINLINE unsigned long* initsevT ( )

Definition at line 94 of file kInline.h.

98 {

◆ initT()

KINLINE TSet initT ( )

Definition at line 78 of file kInline.h.

82 {
83  TSet T = (TSet)omAlloc0(setmaxT*sizeof(TObject));
84  for (int i=setmaxT-1; i>=0; i--)
85  {
86  T[i].tailRing = currRing;
87  T[i].i_r = -1;

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

941 {
942  p_LmCheckPolyRing(p1, p_r);
943  p_LmCheckPolyRing(p2, p_r);
944 
945  int i;
946  long x;
947  m1 = p_Init(m_r,m_r->PolyBin);
948  m2 = p_Init(m_r,m_r->PolyBin);
949 
950  for (i = p_r->N; i; i--)
951  {
952  x = p_GetExpDiff(p1, p2, i, p_r);
953  if (x > 0)
954  {
955  if (x > (long) m_r->bitmask) goto false_return;
956  p_SetExp(m2,i,x, m_r);
957  p_SetExp(m1,i,0, m_r);
958  }
959  else
960  {
961  if (-x > (long) m_r->bitmask) goto false_return;
962  p_SetExp(m1,i,-x, m_r);
963  p_SetExp(m2,i,0, m_r);
964  }
965  }
966 
967  p_Setm(m1, m_r);
968  p_Setm(m2, m_r);
969  return TRUE;
970 

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

984 {
985  p_LmCheckPolyRing(p1, leadRing);
986  p_LmCheckPolyRing(p2, leadRing);
987 
988  int i;
989  int x;
990  int e1;
991  int e2;
992  int s;
993  m1 = p_Init(tailRing,tailRing->PolyBin);
994  m2 = p_Init(tailRing,tailRing->PolyBin);
995  lcm = p_Init(leadRing,leadRing->PolyBin);
996 
997  for (i = leadRing->N; i>=0; i--)
998  {
999  e1 = p_GetExp(p1,i,leadRing);
1000  e2 = p_GetExp(p2,i,leadRing);
1001  x = e1 - e2;
1002  if (x > 0)
1003  {
1004  p_SetExp(m2,i,x, tailRing);
1005  //p_SetExp(m1,i,0, tailRing); // done by p_Init
1006  s = e1;
1007  }
1008  else if (x<0)
1009  {
1010  p_SetExp(m1,i,-x, tailRing);
1011  //p_SetExp(m2,i,0, tailRing); // done by p_Init
1012  s = e2;
1013  }
1014  else
1015  s = e1; // e1==e2
1016  p_SetExp(lcm,i,s, leadRing);

◆ k_LmInit_currRing_2_tailRing() [1/2]

KINLINE poly k_LmInit_currRing_2_tailRing ( poly  p,
ring  tailRing 
)

Definition at line 907 of file kInline.h.

913 {

◆ k_LmInit_currRing_2_tailRing() [2/2]

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

Definition at line 875 of file kInline.h.

881 {
882 

◆ k_LmInit_tailRing_2_currRing() [1/2]

KINLINE poly k_LmInit_tailRing_2_currRing ( poly  p,
ring  tailRing 
)

Definition at line 912 of file kInline.h.

913 {
914  return k_LmInit_currRing_2_tailRing(p, tailRing, tailRing->PolyBin);
915 }

◆ k_LmInit_tailRing_2_currRing() [2/2]

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

Definition at line 884 of file kInline.h.

890 {

◆ k_LmShallowCopyDelete_currRing_2_tailRing() [1/2]

KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing ( poly  p,
ring  tailRing 
)

Definition at line 917 of file kInline.h.

918 {
919  return k_LmInit_tailRing_2_currRing(p, tailRing, currRing->PolyBin);
920 }

◆ k_LmShallowCopyDelete_currRing_2_tailRing() [2/2]

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

Definition at line 893 of file kInline.h.

899 {

◆ k_LmShallowCopyDelete_tailRing_2_currRing() [1/2]

KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing ( poly  p,
ring  tailRing 
)

Definition at line 922 of file kInline.h.

923 {
924  return k_LmShallowCopyDelete_currRing_2_tailRing(p, tailRing, tailRing->PolyBin);
925 }

◆ k_LmShallowCopyDelete_tailRing_2_currRing() [2/2]

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

Definition at line 900 of file kInline.h.

906 {

◆ ksOldCreateSpoly()

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

Definition at line 1069 of file kInline.h.

1078 {

◆ ksOldSpolyRed()

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

Definition at line 1049 of file kInline.h.

1058 {

◆ ksOldSpolyRedNew()

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

Definition at line 1059 of file kInline.h.

1068 {

◆ ksOldSpolyTail()

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

Definition at line 1079 of file kInline.h.

1088 {

◆ ksReducePolyTail()

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

Definition at line 1023 of file kInline.h.

1031 {
1032  BOOLEAN ret;
1033  number coef;
1034 
1035  assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
1036  Red->HeadNormalize();
1037  ret = ksReducePoly(Red, PW, NULL, &coef);
1038 
1039  if (!ret)
1040  {
1041  if (! n_IsOne(coef, currRing->cf))
1042  {

◆ redtailBba()

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

Definition at line 1087 of file kInline.h.

1088 {
1089  LObject L(q, currRing, r);
1090  TObject T(p1, currRing, r);
1091 

◆ redtailBba_Z()

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

Definition at line 1100 of file kInline.h.

1102 {
1103  LObject L(p, currRing, strat->tailRing); // ? L(p); ??
1104  return redtailBbaBound(&L, pos, strat,bound, FALSE, normalize);

◆ redtailBbaBound()

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

Definition at line 1093 of file kInline.h.

1096 {
1097  LObject L(p);
clearS
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
Definition: kInline.h:1107
FALSE
#define FALSE
Definition: auxiliary.h:94
k_LmShallowCopyDelete_currRing_2_tailRing
KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
Definition: kInline.h:893
k_LmInit_tailRing_2_currRing
KINLINE poly k_LmInit_tailRing_2_currRing(poly t_p, ring tailRing, omBin lmBin)
Definition: kInline.h:884
skStrategy
Definition: kutil.h:261
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:457
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:296
skStrategy::tailRing
ring tailRing
Definition: kutil.h:335
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:312
n_IsOne
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:468
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:476
k_LmInit_currRing_2_tailRing
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
Definition: kInline.h:875
p_LmCheckPolyRing
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
Definition: pDebug.cc:116
redtailBba_Z
KINLINE poly redtailBba_Z(poly p, int pos, kStrategy strat)
Definition: kInline.h:1100
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
TRUE
#define TRUE
Definition: auxiliary.h:98
i
int i
Definition: cfEzgcd.cc:125
ksReducePoly
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
Definition: kspoly.cc:39
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:85
T
static jList * T
Definition: janet.cc:31
rField_is_Ring
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:476
TSet
TObject * TSet
Definition: kutil.h:54
setmaxT
#define setmaxT
Definition: kutil.h:32
p_Init
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1249
normalize
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
Definition: syz3.cc:1026
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:1093
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:623
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:783
assume
#define assume(x)
Definition: mod2.h:384
NULL
#define NULL
Definition: omList.c:9
skStrategy::noClearS
char noClearS
Definition: kutil.h:395
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:224
LObject
class sLObject LObject
Definition: kutil.h:53
p
int p
Definition: cfModGcd.cc:4019
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
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:48
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:209