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)
 
void addOperationBucket (poly &f1, poly &f2, kBucket_pt &bucket)
 
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

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

Definition at line 1262 of file MinorProcessor.cc.

1263 {
1264  /* fills all terms of f1 * f2 into the bucket */
1265  poly a = f1; poly b = f2;
1266  int aLen = pLength(a); int bLen = pLength(b);
1267  if (aLen > bLen)
1268  {
1269  b = f1; a = f2; bLen = aLen;
1270  }
1271  pNormalize(b);
1272 
1273  while (a != NULL)
1274  {
1275  /* The next line actually uses only LT(a): */
1276  kBucket_Plus_mm_Mult_pp(bucket, a, b, bLen);
1277  a = pNext(a);
1278  }
1279 }
const poly a
Definition: syzextra.cc:212
static int pLength(poly a)
Definition: p_polys.h:189
pNormalize(P.p)
#define NULL
Definition: omList.c:10
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:803
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
const poly b
Definition: syzextra.cc:213
void elimOperationBucket ( poly p1,
poly p2,
poly p3,
poly p4,
poly p5,
number &  c5,
int  p5Len 
)

Definition at line 1322 of file MinorProcessor.cc.

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

Definition at line 1287 of file MinorProcessor.cc.

1288 {
1289 #ifdef COUNT_AND_PRINT_OPERATIONS
1290  if ((pLength(p1) != 0) && (pLength(p2) != 0))
1291  {
1292  multsPoly++;
1293  multsMon += pLength(p1) * pLength(p2);
1294  }
1295  if ((pLength(p3) != 0) && (pLength(p4) != 0))
1296  {
1297  multsPoly++;
1298  multsMon += pLength(p3) * pLength(p4);
1299  }
1300  if ((pLength(p1) != 0) && (pLength(p2) != 0) &&
1301  (pLength(p3) != 0) && (pLength(p4) != 0))
1302  addsPoly++;
1303 #endif
1304  kBucket_pt myBucket = kBucketCreate(currRing);
1305  addOperationBucket(p1, p2, myBucket);
1306  poly p3Neg = pNeg(pCopy(p3));
1307  addOperationBucket(p3Neg, p4, myBucket);
1308  pDelete(&p3Neg);
1309  pDelete(&p1);
1310  p1 = kBucketClear(myBucket);
1311  kBucketDestroy(&myBucket);
1312 }
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:499
#define pNeg(p)
Definition: polys.h:169
kBucket_pt kBucketCreate(ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:197
static int pLength(poly a)
Definition: p_polys.h:189
void addOperationBucket(poly &f1, poly &f2, kBucket_pt &bucket)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:204
#define pDelete(p_ptr)
Definition: polys.h:157
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
polyrec * poly
Definition: hilb.h:10
#define pCopy(p)
return a copy of the poly
Definition: polys.h:156
int getReduction ( const int  i,
const ideal &  iSB 
)

Definition at line 435 of file MinorProcessor.cc.

436 {
437  if (i == 0) return 0;
438  poly f = pISet(i);
439  poly g = kNF(iSB, currRing->qideal, f);
440  int result = 0;
441  if (g != NULL) result = n_Int(pGetCoeff(g), currRing->cf);
442  pDelete(&f);
443  pDelete(&g);
444  return result;
445 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2815
f
Definition: cfModGcd.cc:4022
g
Definition: cfModGcd.cc:4031
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
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:548
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
#define pDelete(p_ptr)
Definition: polys.h:157
polyrec * poly
Definition: hilb.h:10
#define pISet(i)
Definition: polys.h:283
return result
Definition: facAbsBiFact.cc:76