Loading...
Searching...
No Matches
p_kBucketSetLm__T.cc File Reference

Go to the source code of this file.

## Macros

#define | MULTIPLY_BUCKET(B, I)

## Functions

LINKAGE void | p_kBucketSetLm__T (kBucket_pt bucket)

## Macro Definition Documentation

## MULTIPLY_BUCKET

#define MULTIPLY_BUCKET | ( |  | B,
|  |  | I )

Definition at line 24 of file p_kBucketSetLm__T.cc.

## Function Documentation

## p_kBucketSetLm__T()

LINKAGE void p_kBucketSetLm__T | ( | kBucket_pt | bucket | ) |

Definition at line 27 of file p_kBucketSetLm__T.cc.

{
int j = 0;
poly lt;
ring r = bucket->bucket_ring;
assume(bucket->buckets[0] == NULL && bucket->buckets_length[0] == 0);
DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
DECLARE_ORDSGN(const long* ordsgn = r->ordsgn);
poly p;
do
{
j = 0;
for (int i = 1; i<=bucket->buckets_used; i++)
{
if (bucket->buckets[i] != NULL)
{
MULTIPLY_BUCKET(bucket,i);
p = bucket->buckets[j];
if (j == 0)
{
if (p != NULL) goto Greater;
j = i;
goto Continue;
}
assume(p != NULL);
p_MemCmp__T(bucket->buckets[i]->exp, p->exp, length, ordsgn, goto Equal, goto Greater, goto Continue);
Greater:
{
if (n_IsZero__T(pGetCoeff(p), r->cf))
{
n_Delete__T(&pGetCoeff(p), r->cf);
pIter(bucket->buckets[j]);
p_FreeBinAddr(p, r);
(bucket->buckets_length[j])--;
}
j = i;
goto Continue;
}
Equal:
{
MULTIPLY_BUCKET(bucket,i);
number tn = pGetCoeff(p);
#if 0
pSetCoeff0(p, n_Add__T(pGetCoeff(bucket->buckets[i]), tn, r->cf));
n_Delete__T(&tn, r->cf);
#else
n_InpAdd__T(tn,pGetCoeff(bucket->buckets[i]), r->cf);
pSetCoeff0(p, tn);
#endif
p = bucket->buckets[i];
pIter(bucket->buckets[i]);
n_Delete__T(&pGetCoeff(p), r->cf);
p_FreeBinAddr(p, r);
(bucket->buckets_length[i])--;
}
Continue:;
}
}
p = bucket->buckets[j];
if (j > 0 && n_IsZero__T(pGetCoeff(p), r->cf))
{
n_Delete__T(&pGetCoeff(p), r->cf);
pIter(bucket->buckets[j]);
p_FreeBinAddr(p, r);
(bucket->buckets_length[j])--;
j = -1;
}
}
while (j < 0);
if (j == 0)
{
return;
}
assume(bucket->buckets[j] != NULL);
lt = bucket->buckets[j];
bucket->buckets[j] = pNext(lt);
bucket->buckets_length[j]--;
pNext(lt) = NULL;
bucket->buckets[0] = lt;
bucket->buckets_length[0] = 1;
kBucketAdjustBucketsUsed(bucket);
}
i
int i
Definition cfEzgcd.cc:132
p
int p
Definition cfModGcd.cc:4086
j
int j
Definition facHensel.cc:110
Equal
static BOOLEAN Equal(number a, number b, const coeffs)
Definition flintcf_Q.cc:381
Greater
static bool Greater(mono_type m1, mono_type m2)
Definition interpolation.cc:285
length
static BOOLEAN length(leftv result, leftv arg)
Definition interval.cc:257
kBucket::bucket_ring
ring bucket_ring
Definition kbuckets.h:196
assume
#define assume(x)
Definition mod2.h:389
p_FreeBinAddr
#define p_FreeBinAddr(p, r)
Definition monomials.h:217
pIter
#define pIter(p)
Definition monomials.h:37
pNext
#define pNext(p)
Definition monomials.h:36
pSetCoeff0
#define pSetCoeff0(p, n)
Definition monomials.h:59
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
NULL
#define NULL
Definition omList.c:12
MULTIPLY_BUCKET
#define MULTIPLY_BUCKET(B, I)
Definition p_kBucketSetLm__T.cc:24
n_Delete__T
#define n_Delete__T(n, r)
Definition p_polys.cc:5042