My Project
Functions
MinorProcessor.cc File Reference
#include "kernel/mod2.h"
#include "kernel/linear_algebra/MinorProcessor.h"
#include "polys/kbuckets.h"
#include "kernel/structs.h"
#include "kernel/polys.h"
#include "kernel/GBEngine/kstd1.h"
#include "kernel/ideals.h"

Go to the source code of this file.

Functions

int getReduction (const int i, const ideal &iSB)
 
static void addOperationBucket (poly f1, poly f2, kBucket_pt bucket)
 
static void elimOperationBucketNoDiv (poly &p1, poly p2, poly p3, poly p4)
 
void elimOperationBucket (poly &p1, poly &p2, poly &p3, poly &p4, poly &p5, number &c5, int p5Len)
 

Function Documentation

◆ addOperationBucket()

static void addOperationBucket ( poly  f1,
poly  f2,
kBucket_pt  bucket 
)
static

Definition at line 1261 of file MinorProcessor.cc.

1262{
1263 /* fills all terms of f1 * f2 into the bucket */
1264 poly a = f1; poly b = f2;
1265 int aLen = pLength(a); int bLen = pLength(b);
1266 if (aLen > bLen)
1267 {
1268 b = f1; a = f2; bLen = aLen;
1269 }
1270 pNormalize(b);
1271
1272 while (a != NULL)
1273 {
1274 /* The next line actually uses only LT(a): */
1275 kBucket_Plus_mm_Mult_pp(bucket, a, b, bLen);
1276 a = pNext(a);
1277 }
1278}
CanonicalForm b
Definition: cfModGcd.cc:4103
void kBucket_Plus_mm_Mult_pp(kBucket_pt bucket, poly m, poly p, int l)
Bpoly == Bpoly + m*p; where m is a monom Does not destroy p and m assume (l <= 0 || pLength(p) == l)
Definition: kbuckets.cc:827
#define pNext(p)
Definition: monomials.h:36
#define NULL
Definition: omList.c:12
static unsigned pLength(poly a)
Definition: p_polys.h:191
#define pNormalize(p)
Definition: polys.h:317

◆ elimOperationBucket()

void elimOperationBucket ( poly &  p1,
poly &  p2,
poly &  p3,
poly &  p4,
poly &  p5,
number &  c5,
int  p5Len 
)

Definition at line 1321 of file MinorProcessor.cc.

1323{
1324#ifdef COUNT_AND_PRINT_OPERATIONS
1325 if ((pLength(p1) != 0) && (pLength(p2) != 0))
1326 {
1327 multsPoly++;
1328 multsMon += pLength(p1) * pLength(p2);
1329 }
1330 if ((pLength(p3) != 0) && (pLength(p4) != 0))
1331 {
1332 multsPoly++;
1333 multsMon += pLength(p3) * pLength(p4);
1334 }
1335 if ((pLength(p1) != 0) && (pLength(p2) != 0) &&
1336 (pLength(p3) != 0) && (pLength(p4) != 0))
1337 addsPoly++;
1338#endif
1339 kBucket_pt myBucket = kBucketCreate(currRing);
1340 addOperationBucket(p1, p2, myBucket);
1341 poly p3Neg = pNeg(pCopy(p3));
1342 addOperationBucket(p3Neg, p4, myBucket);
1343 pDelete(&p3Neg);
1344
1345 /* Now, myBucket contains all terms of p1 * p2 - p3 * p4.
1346 Now we need to perform the polynomial division myBucket / p5
1347 which is known to work without remainder: */
1348 pDelete(&p1); poly helperPoly = NULL;
1349
1350 poly bucketLm = pCopy(kBucketGetLm(myBucket));
1351 while (bucketLm != NULL)
1352 {
1353 /* divide bucketLm by the leading term of p5 and put result into bucketLm;
1354 we start with the coefficients;
1355 note that bucketLm will always represent a term */
1356 number coeff = nDiv(pGetCoeff(bucketLm), c5);
1357 nNormalize(coeff);
1358 pSetCoeff(bucketLm, coeff);
1359 /* subtract exponent vector of p5 from that of quotient; modifies
1360 quotient */
1361 p_ExpVectorSub(bucketLm, p5, currRing);
1362#ifdef COUNT_AND_PRINT_OPERATIONS
1363 divsMon++;
1364 multsMonForDiv += p5Len;
1365 multsMon += p5Len;
1366 savedMultsMFD++;
1367 multsPoly++;
1368 multsPolyForDiv++;
1369 addsPoly++;
1370 addsPolyForDiv++;
1371#endif
1372 kBucket_Minus_m_Mult_p(myBucket, bucketLm, p5, &p5Len);
1373 /* The following lines make bucketLm the new leading term of p1,
1374 i.e., put bucketLm in front of everything which is already in p1.
1375 Thus, after the while loop, we need to revert p1. */
1376 helperPoly = bucketLm;
1377 helperPoly->next = p1;
1378 p1 = helperPoly;
1379
1380 bucketLm = pCopy(kBucketGetLm(myBucket));
1381 }
1382 p1 = pReverse(p1);
1383 kBucketDestroy(&myBucket);
1384}
static void addOperationBucket(poly f1, poly f2, kBucket_pt bucket)
void kBucket_Minus_m_Mult_p(kBucket_pt bucket, poly m, poly p, int *l, poly spNoether)
Bpoly == Bpoly - m*p; where m is a monom Does not destroy p and m assume (*l <= 0 || pLength(p) == *l...
Definition: kbuckets.cc:722
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:216
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:209
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:506
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:44
#define nDiv(a, b)
Definition: numbers.h:32
#define nNormalize(n)
Definition: numbers.h:30
static void p_ExpVectorSub(poly p1, poly p2, const ring r)
Definition: p_polys.h:1440
static poly pReverse(poly p)
Definition: p_polys.h:335
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
#define pDelete(p_ptr)
Definition: polys.h:186
#define pNeg(p)
Definition: polys.h:198
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition: polys.h:31
#define pCopy(p)
return a copy of the poly
Definition: polys.h:185

◆ elimOperationBucketNoDiv()

static void elimOperationBucketNoDiv ( poly &  p1,
poly  p2,
poly  p3,
poly  p4 
)
static

Definition at line 1286 of file MinorProcessor.cc.

1287{
1288#ifdef COUNT_AND_PRINT_OPERATIONS
1289 if ((pLength(p1) != 0) && (pLength(p2) != 0))
1290 {
1291 multsPoly++;
1292 multsMon += pLength(p1) * pLength(p2);
1293 }
1294 if ((pLength(p3) != 0) && (pLength(p4) != 0))
1295 {
1296 multsPoly++;
1297 multsMon += pLength(p3) * pLength(p4);
1298 }
1299 if ((pLength(p1) != 0) && (pLength(p2) != 0) &&
1300 (pLength(p3) != 0) && (pLength(p4) != 0))
1301 addsPoly++;
1302#endif
1303 kBucket_pt myBucket = kBucketCreate(currRing);
1304 addOperationBucket(p1, p2, myBucket);
1305 poly p3Neg = pNeg(pCopy(p3));
1306 addOperationBucket(p3Neg, p4, myBucket);
1307 pDelete(&p3Neg);
1308 pDelete(&p1);
1309 p1 = kBucketClear(myBucket);
1310 kBucketDestroy(&myBucket);
1311}
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:521

◆ getReduction()

int getReduction ( const int  i,
const ideal &  iSB 
)

Definition at line 434 of file MinorProcessor.cc.

435{
436 if (i == 0) return 0;
437 poly f = pISet(i);
438 poly g = kNF(iSB, currRing->qideal, f);
439 int result = 0;
440 if (g != NULL) result = n_Int(pGetCoeff(g), currRing->cf);
441 pDelete(&f);
442 pDelete(&g);
443 return result;
444}
int i
Definition: cfEzgcd.cc:132
g
Definition: cfModGcd.cc:4090
FILE * f
Definition: checklibs.c:9
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
Definition: coeffs.h:547
return result
Definition: facAbsBiFact.cc:75
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:3167
#define pISet(i)
Definition: polys.h:312