Loading...
Searching...
No Matches
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()

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

static

Definition at line 1264 of file MinorProcessor.cc.

{
/* fills all terms of f1 * f2 into the bucket */
poly a = f1; poly b = f2;
int aLen = pLength(a); int bLen = pLength(b);
if (aLen > bLen)
{
b = f1; a = f2; bLen = aLen;
}
pNormalize(b);
while (a != NULL)
{
/* The next line actually uses only LT(a): */
kBucket_Plus_mm_Mult_pp(bucket, a, b, bLen);
a = pNext(a);
}
}
b
CanonicalForm b
Definition cfModGcd.cc:4111
kBucket_Plus_mm_Mult_pp
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:815
pNext
#define pNext(p)
Definition monomials.h:36
NULL
#define NULL
Definition omList.c:12
pLength
static int pLength(poly a)
Definition p_polys.h:190
pNormalize
#define pNormalize(p)
Definition polys.h:318

## elimOperationBucket()

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

Definition at line 1324 of file MinorProcessor.cc.

{
#ifdef COUNT_AND_PRINT_OPERATIONS
if ((pLength(p1) != 0) && (pLength(p2) != 0))
{
multsPoly++;
multsMon += pLength(p1) * pLength(p2);
}
if ((pLength(p3) != 0) && (pLength(p4) != 0))
{
multsPoly++;
multsMon += pLength(p3) * pLength(p4);
}
if ((pLength(p1) != 0) && (pLength(p2) != 0) &&
(pLength(p3) != 0) && (pLength(p4) != 0))
addsPoly++;
#endif
kBucket_pt myBucket = kBucketCreate(currRing);
addOperationBucket(p1, p2, myBucket);
poly p3Neg = pNeg(pCopy(p3));
addOperationBucket(p3Neg, p4, myBucket);
pDelete(&p3Neg);
/* Now, myBucket contains all terms of p1 * p2 - p3 * p4.
Now we need to perform the polynomial division myBucket / p5
which is known to work without remainder: */
pDelete(&p1); poly helperPoly = NULL;
poly bucketLm = pCopy(kBucketGetLm(myBucket));
while (bucketLm != NULL)
{
/* divide bucketLm by the leading term of p5 and put result into bucketLm;
we start with the coefficients;
note that bucketLm will always represent a term */
number coeff = nDiv(pGetCoeff(bucketLm), c5);
nNormalize(coeff);
pSetCoeff(bucketLm, coeff);
/* subtract exponent vector of p5 from that of quotient; modifies
quotient */
p_ExpVectorSub(bucketLm, p5, currRing);
#ifdef COUNT_AND_PRINT_OPERATIONS
divsMon++;
multsMonForDiv += p5Len;
multsMon += p5Len;
savedMultsMFD++;
multsPoly++;
multsPolyForDiv++;
addsPoly++;
addsPolyForDiv++;
#endif
kBucket_Minus_m_Mult_p(myBucket, bucketLm, p5, &p5Len);
/* The following lines make bucketLm the new leading term of p1,
i.e., put bucketLm in front of everything which is already in p1.
Thus, after the while loop, we need to revert p1. */
helperPoly = bucketLm;
helperPoly->next = p1;
p1 = helperPoly;
bucketLm = pCopy(kBucketGetLm(myBucket));
}
p1 = pReverse(p1);
kBucketDestroy(&myBucket);
}
addOperationBucket
static void addOperationBucket(poly f1, poly f2, kBucket_pt bucket)
Definition MinorProcessor.cc:1264
kBucket_Minus_m_Mult_p
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
kBucketDestroy
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition kbuckets.cc:216
kBucketCreate
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition kbuckets.cc:209
kBucketGetLm
const poly kBucketGetLm(kBucket_pt bucket)
Definition kbuckets.cc:506
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:44
nDiv
#define nDiv(a, b)
Definition numbers.h:32
nNormalize
#define nNormalize(n)
Definition numbers.h:30
p_ExpVectorSub
static void p_ExpVectorSub(poly p1, poly p2, const ring r)
Definition p_polys.h:1461
pReverse
static poly pReverse(poly p)
Definition p_polys.h:337
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
pDelete
#define pDelete(p_ptr)
Definition polys.h:187
pNeg
#define pNeg(p)
Definition polys.h:199
pSetCoeff
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition polys.h:32
pCopy
#define pCopy(p)
return a copy of the poly
Definition polys.h:186
kBucket_pt
kBucket * kBucket_pt
Definition ring.h:26

## elimOperationBucketNoDiv()

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

static

Definition at line 1289 of file MinorProcessor.cc.

{
#ifdef COUNT_AND_PRINT_OPERATIONS
if ((pLength(p1) != 0) && (pLength(p2) != 0))
{
multsPoly++;
multsMon += pLength(p1) * pLength(p2);
}
if ((pLength(p3) != 0) && (pLength(p4) != 0))
{
multsPoly++;
multsMon += pLength(p3) * pLength(p4);
}
if ((pLength(p1) != 0) && (pLength(p2) != 0) &&
(pLength(p3) != 0) && (pLength(p4) != 0))
addsPoly++;
#endif
kBucket_pt myBucket = kBucketCreate(currRing);
addOperationBucket(p1, p2, myBucket);
poly p3Neg = pNeg(pCopy(p3));
addOperationBucket(p3Neg, p4, myBucket);
pDelete(&p3Neg);
pDelete(&p1);
p1 = kBucketClear(myBucket);
kBucketDestroy(&myBucket);
}
kBucketClear
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 437 of file MinorProcessor.cc.

{
if (i == 0) return 0;
poly f = pISet(i);
poly g = kNF(iSB, currRing->qideal, f);
int result = 0;
if (g != NULL) result = n_Int(pGetCoeff(g), currRing->cf);
pDelete(&f);
pDelete(&g);
return result;
}
i
int i
Definition cfEzgcd.cc:132
g
g
Definition cfModGcd.cc:4098
f
FILE * f
Definition checklibs.c:9
n_Int
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:550
result
return result
Definition facAbsBiFact.cc:76
kNF
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition kstd1.cc:3229
pISet
#define pISet(i)
Definition polys.h:313