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"
19 #include "polys/operations/p_Mult_q.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"
27 #include "kernel/GBEngine/kInline.h"
28 #include "kernel/combinatorics/stairc.h"
29 #include "polys/weight.h"
30 #include "misc/intvec.h"
31 #include "kernel/GBEngine/shiftgb.h"
32 #include "polys/nc/sca.h"
33 #include "polys/shiftop.h"
34 
p_LPCopyAndShiftLM(poly p,int sh,const ring r)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 
p_mLPmaxPossibleShift(poly p,const ring r)45 int p_mLPmaxPossibleShift(poly p, const ring r)
46 {
47   int lastBlock = p_mLastVblock(p, r);
48   if (lastBlock == 0) return 0;
49   int uptodeg = r->N/r->isLPring;
50   return uptodeg - lastBlock;
51 }
52 
53 #endif
54