shiftgb.cc
Go to the documentation of this file.
1 /****************************************
2 * Computer Algebra System SINGULAR *
3 ****************************************/
4 /*
5 * ABSTRACT: kernel: utils for shift GB and free GB
6 */
7 
8 #include "kernel/mod2.h"
9 
10 #ifdef HAVE_SHIFTBBA
11 #include "polys/monomials/ring.h"
12 #include "kernel/polys.h"
13 #include "coeffs/numbers.h"
14 #include "kernel/ideals.h"
15 #include "polys/matpol.h"
16 #include "polys/kbuckets.h"
17 #include "kernel/GBEngine/kstd1.h"
18 #include "polys/sbuckets.h"
20 #include "kernel/GBEngine/kutil.h"
21 #include "kernel/structs.h"
22 #include "kernel/GBEngine/khstd.h"
23 #include "polys/kbuckets.h"
24 #include "polys/weight.h"
25 #include "misc/intvec.h"
26 #include "kernel/structs.h"
29 #include "polys/weight.h"
30 #include "misc/intvec.h"
32 #include "polys/nc/sca.h"
33 #include "polys/shiftop.h"
34 
35 poly p_LPCopyAndShiftLM(poly p, int sh, const ring r)
36 {
37  if (sh == 0 || p == NULL) return p;
38 
39  poly q = p_Head(p, r);
40  p_mLPshift(q, sh, r);
41  pNext(q) = pNext(p);
42  return q;
43 }
44 
45 /* for poly in lmCR/tailTR presentation */
46 int itoInsert(poly p, const ring r)
47 {
48  /* the below situation (commented out) might happen! */
49 // if (r == currRing)
50 // {
51 // "Current ring is not expected in toInsert";
52 // return(0);
53 // }
54  /* compute the number of insertions */
55  int i = p_mLastVblock(p, currRing);
56  if (pNext(p) != NULL)
57  {
58  i = si_max(i, p_LastVblock(pNext(p), r) );
59  }
60  // i = uptodeg - i +1;
61  int uptodeg = r->N/r->isLPring;
62  // p_wrp(p,currRing,r); Print("----i:%d",i); PrintLn();
63  return uptodeg - i;
64 }
65 
66 #endif
int itoInsert(poly p, const ring r)
Definition: shiftgb.cc:46
int p_mLastVblock(poly p, const ring ri)
Definition: shiftop.cc:412
Compatiblity layer for legacy polynomial operations (over currRing)
static poly p_Head(poly p, const ring r)
Definition: p_polys.h:824
static int si_max(const int a, const int b)
Definition: auxiliary.h:138
int p_LastVblock(poly p, const ring r)
Definition: shiftop.cc:397
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12
poly p_LPCopyAndShiftLM(poly p, int sh, const ring r)
Definition: shiftgb.cc:35
#define pNext(p)
Definition: monomials.h:36
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
int p
Definition: cfModGcd.cc:4019
void p_mLPshift(poly m, int sh, const ring ri)
Definition: shiftop.cc:357