My Project  UNKNOWN_GIT_VERSION
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 1124 of file kInline.h.

1133 {

◆ clearS()

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

Definition at line 1099 of file kInline.h.

1101 {
1102  LObject L(p, currRing, strat->tailRing);
1103  return redtailBba_Z(&L, pos, strat);
1104 }
1105 #endif
1106 
1107 KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k,
1108  kStrategy strat)
1109 {
1110  assume(p_sev == pGetShortExpVector(p));
1111  if (strat->noClearS) return;
1112  #ifdef HAVE_RINGS
1114  {
1115  if (!pLmShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at]))
1116  return;
1117  if(!n_DivBy(pGetCoeff(strat->S[*at]), pGetCoeff(p), currRing->cf))
1118  return;
1119  }
1120  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 925 of file kInline.h.

933 {
934  p_LmCheckPolyRing(p1, p_r);
935  p_LmCheckPolyRing(p2, p_r);
936 
937  int i;
938  long x;
939  m1 = p_Init(m_r,m_r->PolyBin);
940  m2 = p_Init(m_r,m_r->PolyBin);
941 
942  for (i = p_r->N; i; i--)
943  {
944  x = p_GetExpDiff(p1, p2, i, p_r);
945  if (x > 0)
946  {
947  if (x > (long) m_r->bitmask) goto false_return;
948  p_SetExp(m2,i,x, m_r);
949  p_SetExp(m1,i,0, m_r);
950  }
951  else
952  {
953  if (-x > (long) m_r->bitmask) goto false_return;
954  p_SetExp(m1,i,-x, m_r);
955  p_SetExp(m2,i,0, m_r);
956  }
957  }
958 
959  p_Setm(m1, m_r);
960  p_Setm(m2, m_r);
961  return TRUE;
962 

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

976 {
977  p_LmCheckPolyRing(p1, leadRing);
978  p_LmCheckPolyRing(p2, leadRing);
979 
980  int i;
981  int x;
982  int e1;
983  int e2;
984  int s;
985  m1 = p_Init(tailRing,tailRing->PolyBin);
986  m2 = p_Init(tailRing,tailRing->PolyBin);
987  lcm = p_Init(leadRing,leadRing->PolyBin);
988 
989  for (i = leadRing->N; i>=0; i--)
990  {
991  e1 = p_GetExp(p1,i,leadRing);
992  e2 = p_GetExp(p2,i,leadRing);
993  x = e1 - e2;
994  if (x > 0)
995  {
996  p_SetExp(m2,i,x, tailRing);
997  //p_SetExp(m1,i,0, tailRing); // done by p_Init
998  s = e1;
999  }
1000  else if (x<0)
1001  {
1002  p_SetExp(m1,i,-x, tailRing);
1003  //p_SetExp(m2,i,0, tailRing); // done by p_Init
1004  s = e2;
1005  }
1006  else
1007  s = e1; // e1==e2
1008  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 899 of file kInline.h.

905 {

◆ k_LmInit_currRing_2_tailRing() [2/2]

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

Definition at line 867 of file kInline.h.

873 {
874 

◆ k_LmInit_tailRing_2_currRing() [1/2]

KINLINE poly k_LmInit_tailRing_2_currRing ( poly  p,
ring  tailRing 
)

Definition at line 904 of file kInline.h.

905 {
906  return k_LmInit_currRing_2_tailRing(p, tailRing, tailRing->PolyBin);
907 }

◆ k_LmInit_tailRing_2_currRing() [2/2]

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

Definition at line 876 of file kInline.h.

882 {

◆ k_LmShallowCopyDelete_currRing_2_tailRing() [1/2]

KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing ( poly  p,
ring  tailRing 
)

Definition at line 909 of file kInline.h.

910 {
911  return k_LmInit_tailRing_2_currRing(p, tailRing, currRing->PolyBin);
912 }

◆ k_LmShallowCopyDelete_currRing_2_tailRing() [2/2]

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

Definition at line 885 of file kInline.h.

891 {

◆ k_LmShallowCopyDelete_tailRing_2_currRing() [1/2]

KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing ( poly  p,
ring  tailRing 
)

Definition at line 914 of file kInline.h.

915 {
916  return k_LmShallowCopyDelete_currRing_2_tailRing(p, tailRing, tailRing->PolyBin);
917 }

◆ k_LmShallowCopyDelete_tailRing_2_currRing() [2/2]

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

Definition at line 892 of file kInline.h.

898 {

◆ ksOldCreateSpoly()

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

Definition at line 1061 of file kInline.h.

1070 {

◆ ksOldSpolyRed()

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

Definition at line 1041 of file kInline.h.

1050 {

◆ ksOldSpolyRedNew()

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

Definition at line 1051 of file kInline.h.

1060 {

◆ ksOldSpolyTail()

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

Definition at line 1071 of file kInline.h.

1080 {

◆ ksReducePolyTail()

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

Definition at line 1015 of file kInline.h.

1023 {
1024  BOOLEAN ret;
1025  number coef;
1026 
1027  assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
1028  Red->HeadNormalize();
1029  ret = ksReducePoly(Red, PW, NULL, &coef);
1030 
1031  if (!ret)
1032  {
1033  if (! n_IsOne(coef, currRing->cf))
1034  {

◆ redtailBba()

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

Definition at line 1079 of file kInline.h.

1080 {
1081  LObject L(q, currRing, r);
1082  TObject T(p1, currRing, r);
1083 

◆ redtailBba_Z()

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

Definition at line 1092 of file kInline.h.

1094 {
1095  LObject L(p, currRing, strat->tailRing); // ? L(p); ??
1096  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 1085 of file kInline.h.

1088 {
1089  LObject L(p);
clearS
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
Definition: kInline.h:1099
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:885
k_LmInit_tailRing_2_currRing
KINLINE poly k_LmInit_tailRing_2_currRing(poly t_p, ring tailRing, omBin lmBin)
Definition: kInline.h:876
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:458
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:467
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:477
k_LmInit_currRing_2_tailRing
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
Definition: kInline.h:867
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:1092
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:474
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:1240
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:1085
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:624
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: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:225
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:42
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:209