Loading...
Searching...
No Matches
kInline.h
Go to the documentation of this file.
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/***************************************************************
* File: kInline.h
* Purpose: implementation of std related inline routines
* Author: obachman (Olaf Bachmann)
* Created: 8/00
*******************************************************************/
#ifndef KINLINE_H
#define KINLINE_H
#if !defined(NO_KINLINE) || defined(KUTIL_CC)
/* this file is a header file with inline routines,
* if NO_KINLINE is not defined (AND ONLY THEN!)
* otherwise it is an part of kutil.cc and a source file!
* (remark: NO_KINLINE is defined by KDEBUG, i.e. in the debug version)
*/
#include "omalloc/omalloc.h"
#include "misc/options.h"
#include "polys/monomials/p_polys.h"
#include "polys/kbuckets.h"
#include "kernel/polys.h"
#ifdef HAVE_SHIFTBBA
#include "polys/shiftop.h"
#endif
#define HAVE_TAIL_BIN
// This doesn't really work, fixme, if necessary
// #define HAVE_LM_BIN
KINLINE TObject* skStrategy::S_2_T(int i)
{
assume(i>= 0 && i<=sl);
assume(S_2_R[i] >= 0 && S_2_R[i] <= tl);
TObject* TT = R[S_2_R[i]];
assume(TT != NULL && TT->p == S[i]);
return TT;
}
KINLINE TObject* skStrategy::s_2_t(int i)
{
if (i >= 0 && i <= sl)
{
int sri= S_2_R[i];
if ((sri >= 0) && (sri <= tl))
{
TObject* t = R[sri];
if ((t != NULL) && (t->p == S[i]))
return t;
}
// last but not least, try kFindInT
sri = kFindInT(S[i], T, tl);
if (sri >= 0)
return &(T[sri]);
}
return NULL;
}
KINLINE poly skStrategy::kNoetherTail()
{
if (tailRing == currRing)
return kNoether;
else
{
assume((kNoether == NULL && t_kNoether == NULL) ||
(kNoether != NULL && t_kNoether != NULL));
return t_kNoether;
}
}
/***************************************************************
*
* Operation on TObjects
*
***************************************************************/
KINLINE TSet initT ()
{
TSet T = (TSet)omAlloc0(setmaxT*sizeof(TObject));
for (int i=setmaxT-1; i>=0; i--)
{
T[i].tailRing = currRing;
T[i].i_r = -1;
}
return T;
}
KINLINE TObject** initR()
{
return (TObject**) omAlloc0(setmaxT*sizeof(TObject*));
}
KINLINE unsigned long* initsevT()
{
return (unsigned long*) omAlloc0(setmaxT*sizeof(unsigned long));
}
// initialization
KINLINE void sTObject::Set(ring r)
{
tailRing = r;
}
KINLINE void sTObject::Init(ring r)
{
memset(this, 0, sizeof(sTObject));
i_r = -1;
Set(r);
}
KINLINE sTObject::sTObject(ring r)
{
Init(r);
}
KINLINE void sTObject::Set(poly p_in, ring r)
{
#ifdef HAVE_SHIFTBBA
if (r->isLPring)
{
shift = si_max(p_mFirstVblock(p_in, r) - 1, 0);
if (!shift) p_Test(p_in, r);
}
else
#endif
{
p_Test(p_in, r);
}
if (r != currRing)
{
assume(r == tailRing);
t_p = p_in;
}
else
{
p = p_in;
}
pLength=::pLength(p_in);
}
KINLINE sTObject::sTObject(poly p_in, ring r)
{
Init(r);
Set(p_in, r);
}
KINLINE void sTObject::Set(poly p_in, ring c_r, ring t_r)
{
if (c_r != t_r)
{
assume(c_r == currRing && t_r == tailRing);
#ifdef HAVE_SHIFTBBA
if (c_r->isLPring)
{
shift = si_max(p_mFirstVblock(p_in, c_r) - 1, 0);
if (!shift) p_Test(p_in, currRing);
}
else
#endif
{
p_Test(p_in, currRing);
}
p = p_in;
pLength=::pLength(p_in);
}
else
{
Set(p_in, c_r);
}
}
KINLINE sTObject::sTObject(poly p_in, ring c_r, ring t_r)
{
Init(t_r);
Set(p_in, c_r, t_r);
}
KINLINE sTObject::sTObject(sTObject* T, int copy)
{
*this = *T;
if (copy)
{
if (t_p != NULL)
{
t_p = p_Copy(t_p, tailRing);
p = k_LmInit_tailRing_2_currRing(t_p, tailRing);
}
else
{
p = p_Copy(p, currRing);
}
}
}
KINLINE void sTObject::Delete()
{
if (t_p != NULL)
{
p_Delete(&t_p, tailRing);
if (p != NULL)
p_LmFree(p, currRing);
}
else
{
p_Delete(&p, currRing);
}
}
KINLINE void sTObject::Clear()
{
p = NULL;
t_p = NULL;
ecart = 0;
length = 0;
pLength = 0;
FDeg = 0;
is_normalized = FALSE;
}
KINLINE void sTObject::Copy()
{
if (t_p != NULL)
{
t_p = p_Copy(t_p, tailRing);
if (p != NULL) /* and t_p!=NULL*/
{
p = p_LmInit(p, currRing);
pGetCoeff(p)=pGetCoeff(t_p);
pNext(p) = pNext(t_p);
}
}
else
{
p = p_Copy(p, currRing);
}
}
KINLINE poly sTObject::GetLmCurrRing()
{
if (p == NULL && t_p != NULL)
p = k_LmInit_tailRing_2_currRing(t_p, tailRing);
return p;
}
KINLINE poly sTObject::GetLmTailRing()
{
if (t_p == NULL)
{
if (p != NULL && tailRing != currRing)
{
t_p = k_LmInit_currRing_2_tailRing(p, tailRing);
return t_p;
}
return p;
}
return t_p;
}
KINLINE poly sTObject::GetLm(ring r)
{
assume(r == tailRing || r == currRing);
if (r == currRing)
return GetLmCurrRing();
if (t_p == NULL && p != NULL)
t_p = k_LmInit_currRing_2_tailRing(p, tailRing);
return t_p;
}
KINLINE void sTObject::GetLm(poly &p_r, ring &r_r) const
{
if (t_p != NULL)
{
p_r = t_p;
r_r = tailRing;
}
else
{
p_r = p;
r_r = currRing;
}
}
KINLINE BOOLEAN sTObject::IsNull() const
{
return (p == NULL && t_p == NULL);
}
KINLINE int sTObject::GetpLength()
{
if (pLength <= 0) pLength = ::pLength(p != NULL ? p : t_p);
return pLength;
}
KINLINE void sTObject::SetLmCurrRing()
{
if (p == NULL && t_p != NULL)
p = k_LmInit_tailRing_2_currRing(t_p, tailRing);
}
KINLINE poly sTObject::Next()
{
assume(p != NULL || t_p != NULL);
if (t_p != NULL) return pNext(t_p);
return pNext(p);
}
// Iterations
KINLINE void sTObject::LmDeleteAndIter()
{
assume(p != NULL || t_p != NULL);
if (t_p != NULL)
{
t_p = p_LmDeleteAndNext(t_p, tailRing);
if (p != NULL)
{
p_LmFree(p, currRing);
p = NULL;
}
}
else
{
p = p_LmDeleteAndNext(p, currRing);
}
is_normalized = FALSE;
}
// arithmetic
KINLINE void sTObject::Mult_nn(number n)
{
if (t_p != NULL)
{
t_p = p_Mult_nn(t_p, n, tailRing);
if (p != NULL) pSetCoeff0(p, pGetCoeff(t_p));
}
else
{
p = p_Mult_nn(p, n, currRing, tailRing);
}
}
KINLINE void sLObject::Normalize()
{
if (t_p != NULL)
{
pNormalize(t_p);
if (p != NULL) pSetCoeff0(p, pGetCoeff(t_p));
}
else
{
pNormalize(p);
}
if (bucket!=NULL) kBucketNormalize(bucket);
}
KINLINE void sLObject::CanonicalizeP()
{
if (bucket != NULL)
kBucketCanonicalize(bucket);
}
KINLINE void sLObject::HeadNormalize()
{
if (t_p != NULL)
{
nNormalize(pGetCoeff(t_p));
if (p != NULL) pSetCoeff0(p, pGetCoeff(t_p));
}
else
{
nNormalize(pGetCoeff(p));
}
}
KINLINE void
sTObject::ShallowCopyDelete(ring new_tailRing, omBin new_tailBin,
pShallowCopyDeleteProc p_shallow_copy_delete,
BOOLEAN set_max)
{
if (new_tailBin == NULL) new_tailBin = new_tailRing->PolyBin;
if (t_p != NULL)
{
t_p = p_shallow_copy_delete(t_p, tailRing, new_tailRing, new_tailBin);
if (p != NULL)
pNext(p) = pNext(t_p);
if (new_tailRing == currRing)
{
if (p == NULL) p = t_p;
else p_LmFree(t_p, tailRing);
t_p = NULL;
}
}
else if (p != NULL) /* && t_p==NULL */
{
if (pNext(p) != NULL)
{
pNext(p) = p_shallow_copy_delete(pNext(p),
tailRing, new_tailRing, new_tailBin);
}
if (new_tailRing != currRing)
{
t_p = k_LmInit_currRing_2_tailRing(p, new_tailRing);
pNext(t_p) = pNext(p);
}
}
if (max_exp != NULL)
{
max_exp = p_shallow_copy_delete(max_exp,tailRing,new_tailRing,new_tailBin);
}
else if (set_max && pNext(t_p) != NULL)
{
max_exp = p_GetMaxExpP(pNext(t_p), new_tailRing);
}
tailRing = new_tailRing;
}
KINLINE long sTObject::pFDeg() const
{
if (p != NULL) return p_FDeg(p, currRing);
return tailRing->pFDeg(t_p, tailRing);
}
KINLINE long sTObject::pTotalDeg() const
{
if (p != NULL) return p_Totaldegree(p, currRing);
return p_Totaldegree(t_p,tailRing);
}
KINLINE long sTObject::SetpFDeg()
{
FDeg = this->pFDeg();
return FDeg;
}
KINLINE long sTObject::GetpFDeg() const
{
assume(FDeg == this->pFDeg());
return FDeg;
}
KINLINE long sTObject::pLDeg()
{
return tailRing->pLDeg(GetLmTailRing(), &length, tailRing);
}
KINLINE long sTObject::SetDegStuffReturnLDeg()
{
FDeg = this->pFDeg();
long d = this->pLDeg();
ecart = d - FDeg;
return d;
}
//extern void pCleardenom(poly p);
// extern void pNorm(poly p);
// manipulations
KINLINE void sTObject::pCleardenom()
{
assume(p != NULL);
BOOLEAN is_ring=rField_is_Ring(currRing);
if ((TEST_OPT_CONTENTSB) && (!is_ring))
{
number n;
if (t_p != NULL)
{
p_Cleardenom_n(t_p, tailRing, n);
pSetCoeff0(p, pGetCoeff(t_p));
}
else
{
p_Cleardenom_n(p, currRing, n);
}
if (!nIsOne(n))
{
denominator_list denom=(denominator_list)omAlloc(sizeof(denominator_list_s));
denom->n=nInvers(n);
denom->next=DENOMINATOR_LIST;
DENOMINATOR_LIST=denom;
}
nDelete(&n);
}
else if (is_ring)
{
number c;
if (t_p != NULL)
c=pGetCoeff(t_p);
else
c=pGetCoeff(p);
const coeffs C=tailRing->cf;
number u=n_GetUnit(c,C);
if (t_p != NULL)
{
if (!n_IsOne(u,C))
{
number uInv = n_Invers(u, C);
t_p=p_Mult_nn(t_p,uInv,tailRing);
n_Delete(&uInv,C);
}
if(!n_GreaterZero(pGetCoeff(t_p),tailRing->cf))
{
t_p = p_Neg(t_p,tailRing);
}
pSetCoeff0(p, pGetCoeff(t_p));
}
else
{
if (!n_IsOne(u,C))
{
number uInv = n_Invers(u, C);
p=p_Mult_nn(p,uInv,tailRing);
n_Delete(&uInv,C);
}
if(!n_GreaterZero(pGetCoeff(p),tailRing->cf))
{
p = p_Neg(p,tailRing);
}
}
n_Delete(&u,C);
}
else
{
if (t_p != NULL)
{
p_ProjectiveUnique(t_p, tailRing);
pSetCoeff0(p, pGetCoeff(t_p));
}
else
{
p_ProjectiveUnique(p, currRing);
}
}
}
KINLINE void sTObject::pContent()
{
assume(p != NULL);
if (t_p != NULL)
{
p_SimpleContent(t_p, 1, tailRing);
if (!n_GreaterZero(pGetCoeff(t_p),tailRing->cf))
{
t_p=p_Neg (t_p,tailRing);
}
pSetCoeff0(p, pGetCoeff(t_p));
}
else
{
p_SimpleContent(p, 1, currRing);
if (!n_GreaterZero(pGetCoeff(p),currRing->cf))
{
p=p_Neg (p,currRing);
}
}
}
KINLINE void sTObject::pNorm() // pNorm seems to be a _bad_ method name...
{
assume(p != NULL);
if (! is_normalized)
{
p_Norm(p, currRing);
if (t_p != NULL)
pSetCoeff0(t_p, pGetCoeff(p));
is_normalized = TRUE;
}
}
/***************************************************************
*
* Operation on LObjects
*
***************************************************************/
// Initialization
KINLINE void sLObject::Clear()
{
sTObject::Clear();
sev = 0;
}
KINLINE void sLObject::Delete()
{
sTObject::Delete();
if (bucket != NULL)
kBucketDeleteAndDestroy(&bucket);
}
KINLINE void sLObject::Init(ring r)
{
memset(this, 0, sizeof(sLObject));
i_r1 = -1;
i_r2 = -1;
i_r = -1;
Set(r);
}
KINLINE sLObject::sLObject(ring r)
{
Init(r);
}
KINLINE sLObject::sLObject(poly p_in, ring r)
{
Init(r);
Set(p_in, r);
}
KINLINE sLObject::sLObject(poly p_in, ring c_r, ring t_r)
{
Init(t_r);
Set(p_in, c_r, t_r);
}
KINLINE void sLObject::PrepareRed(BOOLEAN use_bucket)
{
if (bucket == NULL)
{
unsigned l = GetpLength();
if (use_bucket)
{
bucket = kBucketCreate(tailRing);
if (l>1)
{
poly tp = GetLmTailRing();
assume((int)l == ::pLength(tp));
kBucketInit(bucket, pNext(tp), l-1);
pNext(tp) = NULL;
if (p!=NULL) pNext(p) = NULL;
pLength = 0;
}
}
}
}
KINLINE void sLObject::SetLmTail(poly lm, poly p_tail, int p_Length, int use_bucket, ring _tailRing)
{
Set(lm, _tailRing);
if (use_bucket)
{
bucket = kBucketCreate(_tailRing);
kBucketInit(bucket, p_tail, p_Length);
pNext(lm) = NULL;
pLength = 0;
}
else
{
pNext(lm) = p_tail;
pLength = p_Length + 1;
}
}
KINLINE void sLObject::Tail_Mult_nn(number n)
{
if (bucket != NULL)
{
kBucket_Mult_n(bucket, n);
}
else
{
poly _p = (t_p != NULL ? t_p : p);
assume(_p != NULL);
pNext(_p) = __p_Mult_nn(pNext(_p), n, tailRing);
}
}
KINLINE void sLObject::Tail_Minus_mm_Mult_qq(poly m, poly q, int lq,
poly spNoether)
{
if (bucket != NULL)
{
kBucket_Minus_m_Mult_p(bucket, m, q, &lq, spNoether);
}
else
{
if (lq<=0) lq= ::pLength(q);
poly _p = (t_p != NULL ? t_p : p);
assume(_p != NULL);
int lp=pLength-1;
pNext(_p) = p_Minus_mm_Mult_qq( pNext(_p), m, q, lp, lq,
spNoether, tailRing );
pLength=lp+1;
// tailRing->p_Procs->p_Minus_mm_Mult_qq(pNext(_p), m, q, shorter,spNoether, tailRing, last);
// pLength += lq - shorter;
}
}
KINLINE void sLObject::LmDeleteAndIter()
{
sTObject::LmDeleteAndIter();
if (bucket != NULL)
{
poly _p = kBucketExtractLm(bucket);
if (_p == NULL)
{
kBucketDestroy(&bucket);
p = t_p = NULL;
return;
}
Set(_p, tailRing);
}
else
{
pLength--;
}
}
KINLINE poly sLObject::LmExtractAndIter()
{
poly ret = GetLmTailRing();
poly pn;
assume(p != NULL || t_p != NULL);
if (bucket != NULL)
{
pn = kBucketExtractLm(bucket);
if (pn == NULL)
kBucketDestroy(&bucket);
}
else
{
pn = pNext(ret);
}
pLength--;
pNext(ret) = NULL;
if (p != NULL && t_p != NULL)
p_LmFree(p, currRing);
Set(pn, tailRing);
return ret;
}
KINLINE poly sLObject::GetTP()
{
//kTest_L(this);
poly tp = GetLmTailRing();
assume(tp != NULL);
if (bucket != NULL)
{
kBucketClear(bucket, &pNext(tp), &pLength);
kBucketDestroy(&bucket);
pLength++;
}
return tp;
}
KINLINE poly sLObject::GetP(omBin lmBin)
{
//kTest_L(this);
if (p == NULL)
{
p = k_LmInit_tailRing_2_currRing(t_p, tailRing,
((lmBin!=NULL)?lmBin:currRing->PolyBin));
FDeg = pFDeg();
}
else if ((lmBin != NULL) && (lmBin != currRing->PolyBin))
{
p = p_LmShallowCopyDelete(p, currRing);
FDeg = pFDeg();
}
if (bucket != NULL)
{
kBucketClear(bucket, &pNext(p), &pLength);
kBucketDestroy(&bucket);
pLength++;
if (t_p != NULL) pNext(t_p) = pNext(p);
}
//kTest_L(this);
return p;
}
KINLINE void
sLObject::ShallowCopyDelete(ring new_tailRing,
pShallowCopyDeleteProc p_shallow_copy_delete)
{
if (bucket != NULL)
kBucketShallowCopyDelete(bucket, new_tailRing, new_tailRing->PolyBin,
p_shallow_copy_delete);
sTObject::ShallowCopyDelete(new_tailRing,
new_tailRing->PolyBin,p_shallow_copy_delete,
FALSE);
}
KINLINE void sLObject::SetShortExpVector()
{
if (t_p != NULL)
{
sev = p_GetShortExpVector(t_p, tailRing);
}
else
{
sev = p_GetShortExpVector(p, currRing);
}
}
KINLINE void sLObject::Copy()
{
if (bucket != NULL)
{
int i = kBucketCanonicalize(bucket);
kBucket_pt new_bucket = kBucketCreate(tailRing);
kBucketInit(new_bucket,
p_Copy(bucket->buckets[i], tailRing),
bucket->buckets_length[i]);
bucket = new_bucket;
if (t_p != NULL) pNext(t_p) = NULL;
if (p != NULL) pNext(p) = NULL;
}
TObject::Copy();
}
KINLINE long sLObject::pLDeg()
{
poly tp = GetLmTailRing();
assume(tp != NULL);
if (bucket != NULL)
{
int i = kBucketCanonicalize(bucket);
pNext(tp) = bucket->buckets[i];
long ldeg = tailRing->pLDeg(tp, &length, tailRing);
pNext(tp) = NULL;
return ldeg;
}
else
return tailRing->pLDeg(tp, &length, tailRing);
}
KINLINE long sLObject::pLDeg(BOOLEAN deg_last)
{
if (! deg_last || bucket != NULL) return sLObject::pLDeg();
long ldeg;
ldeg = tailRing->pLDeg(GetLmTailRing(), &length, tailRing);
#ifndef SING_NDEBUG
if ( pLength == 0)
p_Last(GetLmTailRing(), pLength, tailRing);
assume ( pLength == length || rIsSyzIndexRing(currRing));
#else
pLength=length;
#endif
return ldeg;
}
KINLINE long sLObject::SetDegStuffReturnLDeg()
{
FDeg = this->pFDeg();
long d = this->pLDeg();
ecart = d - FDeg;
return d;
}
KINLINE long sLObject::SetDegStuffReturnLDeg(BOOLEAN use_last)
{
FDeg = this->pFDeg();
long d = this->pLDeg(use_last);
ecart = d - FDeg;
return d;
}
KINLINE int sLObject::GetpLength()
{
if (bucket == NULL)
return sTObject::GetpLength();
int i = kBucketCanonicalize(bucket);
return bucket->buckets_length[i] + 1;
}
KINLINE int sLObject::SetLength(BOOLEAN length_pLength)
{
if (length_pLength)
{
length = this->GetpLength();
}
else
this->pLDeg();
return length;
}
KINLINE long sLObject::MinComp()
{
poly tp = GetLmTailRing();
assume(tp != NULL);
if (bucket != NULL)
{
int i = kBucketCanonicalize(bucket);
pNext(tp) = bucket->buckets[i];
long m = p_MinComp(tp, tailRing);
pNext(tp) = NULL;
return m;
}
else
return p_MinComp(tp, tailRing);
}
KINLINE long sLObject::Comp()
{
poly pp;
ring r;
GetLm(pp, r);
assume(pp != NULL);
return p_GetComp(pp, r);
}
KINLINE sLObject& sLObject::operator=(const sTObject& t)
{
memcpy(this, &t, sizeof(sTObject));
return *this;
}
KINLINE TObject* sLObject::T_1(const skStrategy* s)
{
if (p1 == NULL) return NULL;
if (i_r1 == -1) i_r1 = kFindInT(p1, s->T, s->tl);
assume(i_r1 >= 0 && i_r1 <= s->tl);
TObject* T = s->R[i_r1];
assume(T->p == p1);
return T;
}
KINLINE TObject* sLObject::T_2(const skStrategy* strat)
{
if (p1 == NULL) return NULL;
assume(p2 != NULL);
if (i_r2 == -1) i_r2 = kFindInT(p2, strat->T, strat->tl);
assume(i_r2 >= 0 && i_r2 <= strat->tl);
TObject* T = strat->R[i_r2];
assume(T->p == p2);
return T;
}
KINLINE void sLObject::T_1_2(const skStrategy* strat,
TObject* &T_1, TObject* &T_2)
{
if (p1 == NULL)
{
T_1 = NULL;
T_2 = NULL;
return;
}
assume(p1 != NULL && p2 != NULL);
if (i_r1 == -1) i_r1 = kFindInT(p1, strat->T, strat->tl);
if (i_r2 == -1) i_r2 = kFindInT(p2, strat->T, strat->tl);
assume(i_r1 >= 0 && i_r1 <= strat->tl);
assume(i_r2 >= 0 && i_r2 <= strat->tl);
T_1 = strat->R[i_r1];
T_2 = strat->R[i_r2];
assume(T_1->p == p1);
assume(T_2->p == p2);
return;
}
/***************************************************************
*
* Conversion of polys
*
***************************************************************/
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
{
poly t_p = p_LmInit(p, currRing, tailRing, tailBin);
pNext(t_p) = pNext(p);
pSetCoeff0(t_p, pGetCoeff(p));
return t_p;
}
KINLINE poly k_LmInit_tailRing_2_currRing(poly t_p, ring tailRing, omBin lmBin)
{
poly p = p_LmInit(t_p, tailRing, currRing, lmBin);
pNext(p) = pNext(t_p);
pSetCoeff0(p, pGetCoeff(t_p));
return p;
}
// this should be made more efficient
KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
{
poly np = k_LmInit_currRing_2_tailRing(p, tailRing, tailBin);
p_LmFree(p, currRing);
return np;
}
KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin lmBin)
{
poly np = k_LmInit_tailRing_2_currRing(p, tailRing, lmBin);
p_LmFree(p, tailRing);
return np;
}
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing)
{
return k_LmInit_currRing_2_tailRing(p, tailRing, tailRing->PolyBin);
}
KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing)
{
return k_LmInit_tailRing_2_currRing(p, tailRing, currRing->PolyBin);
}
KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing)
{
return k_LmShallowCopyDelete_currRing_2_tailRing(p, tailRing, tailRing->PolyBin);
}
KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing)
{
return k_LmShallowCopyDelete_tailRing_2_currRing(p, tailRing, currRing->PolyBin);
}
/***************************************************************
*
* Lcm business
*
***************************************************************/
// get m1 = LCM(LM(p1), LM(p2))/LM(p1)
// m2 = LCM(LM(p1), LM(p2))/LM(p2)
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r,
poly &m1, poly &m2, const ring m_r)
{
p_LmCheckPolyRing(p1, p_r);
p_LmCheckPolyRing(p2, p_r);
int i;
long x;
m1 = p_Init(m_r,m_r->PolyBin);
m2 = p_Init(m_r,m_r->PolyBin);
for (i = p_r->N; i; i--)
{
x = p_GetExpDiff(p1, p2, i, p_r);
if (x > 0)
{
if (x > (long) m_r->bitmask) goto false_return;
p_SetExp(m2,i,x, m_r);
p_SetExp(m1,i,0, m_r);
}
else
{
if (-x > (long) m_r->bitmask) goto false_return;
p_SetExp(m1,i,-x, m_r);
p_SetExp(m2,i,0, m_r);
}
}
p_Setm(m1, m_r);
p_Setm(m2, m_r);
return TRUE;
false_return:
p_LmFree(m1, m_r);
p_LmFree(m2, m_r);
m1 = m2 = NULL;
return FALSE;
}
// get m1 = LCM(LM(p1), LM(p2))/LM(p1)
// m2 = LCM(LM(p1), LM(p2))/LM(p2) in tailRing
// lcm = LCM(LM(p1), LM(p2)) in leadRing
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing,
poly &m1, poly &m2, poly &lcm, const ring tailRing)
{
p_LmCheckPolyRing(p1, leadRing);
p_LmCheckPolyRing(p2, leadRing);
int i;
int x;
int e1;
int e2;
int s;
m1 = p_Init(tailRing,tailRing->PolyBin);
m2 = p_Init(tailRing,tailRing->PolyBin);
lcm = p_Init(leadRing,leadRing->PolyBin);
for (i = leadRing->N; i>=0; i--)
{
e1 = p_GetExp(p1,i,leadRing);
e2 = p_GetExp(p2,i,leadRing);
x = e1 - e2;
if (x > 0)
{
p_SetExp(m2,i,x, tailRing);
//p_SetExp(m1,i,0, tailRing); // done by p_Init
s = e1;
}
else if (x<0)
{
p_SetExp(m1,i,-x, tailRing);
//p_SetExp(m2,i,0, tailRing); // done by p_Init
s = e2;
}
else
s = e1; // e1==e2
p_SetExp(lcm,i,s, leadRing);
}
p_Setm(m1, tailRing);
p_Setm(m2, tailRing);
p_Setm(lcm, leadRing);
}
/***************************************************************
*
* Misc things
*
***************************************************************/
KINLINE int ksReducePolyTailLC_Z(LObject* PR, TObject* PW, LObject* Red)
{
BOOLEAN ret;
number mult, rest;
TObject red = *PW;
red.Copy();
rest = n_QuotRem(pGetCoeff(Red->p), pGetCoeff(red.p),
&mult, currRing->cf);
red.Mult_nn(rest);
assume(PR->GetLmCurrRing() != red.GetLmCurrRing());
ret = ksReducePolyLC(Red, &red, NULL, &mult);
red.Delete();
red.Clear();
return ret;
}
KINLINE int ksReducePolyTail_Z(LObject* PR, TObject* PW, LObject* Red)
{
BOOLEAN ret;
number coef=NULL;
assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
ret = ksReducePoly(Red, PW, NULL, &coef, NULL,NULL,TRUE);
#if 0 // shlould not happen
if (!ret)
{
if (! n_IsOne(coef, currRing->cf))
{
PR->Mult_nn(coef);
// HANNES: mark for Normalize
}
}
#endif
n_Delete(&coef, currRing->cf);
return ret;
}
KINLINE int ksReducePolyTail(LObject* PR, TObject* PW, LObject* Red)
{
BOOLEAN ret;
number coef;
assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
Red->HeadNormalize();
ret = ksReducePoly(Red, PW, NULL, &coef);
if (!ret)
{
if (! n_IsOne(coef, currRing->cf))
{
PR->Mult_nn(coef);
// HANNES: mark for Normalize
}
n_Delete(&coef, currRing->cf);
}
return ret;
}
/***************************************************************
*
* Routines for backwards-Compatibility
*
*
***************************************************************/
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
{
LObject L(p2);
TObject T(p1);
ksReducePoly(&L, &T, spNoether);
return L.GetLmCurrRing();
}
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether)
{
LObject L(p_Copy(p2, currRing));
TObject T(p1);
ksReducePoly(&L, &T, spNoether);
return L.GetLmCurrRing();
}
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
{
LObject L(r);
L.p1 = p1;
L.p2 = p2;
ksCreateSpoly(&L, spNoether);
return L.GetLmCurrRing();
}
void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r)
{
LObject L(q, currRing, r);
TObject T(p1, currRing, r);
ksReducePolyTail(&L, &T, q2, spNoether);
}
KINLINE poly redtailBba (poly p,int pos,kStrategy strat,BOOLEAN normalize)
{
LObject L(p);
return redtailBba(&L, pos, strat,FALSE, normalize);
}
KINLINE poly redtailBbaBound (poly p,int pos,kStrategy strat,int bound,BOOLEAN normalize)
{
LObject L(p, currRing, strat->tailRing); // ? L(p); ??
return redtailBbaBound(&L, pos, strat,bound, FALSE, normalize);
}
KINLINE poly redtailBba_Ring (poly p,int pos,kStrategy strat)
{
LObject L(p, currRing, strat->tailRing);
return redtailBba_Ring(&L, pos, strat);
}
KINLINE poly redtailBba_Z (poly p,int pos,kStrategy strat)
{
LObject L(p, currRing, strat->tailRing);
return redtailBba_Z(&L, pos, strat);
}
KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k,
kStrategy strat)
{
assume(p_sev == pGetShortExpVector(p));
if (strat->noClearS) return;
if(rField_is_Ring(currRing))
{
if (!pLmShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at]))
return;
if(!n_DivBy(pGetCoeff(strat->S[*at]), pGetCoeff(p), currRing->cf))
return;
}
else
{
if (!pLmShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at])) return;
}
deleteInS((*at),strat);
(*at)--;
(*k)--;
}
// dummy function for function pointer strat->rewCrit being usable in all
// possible choices for criteria
KINLINE BOOLEAN arriRewDummy(poly /*sig*/, unsigned long /*not_sevSig*/, poly /*lm*/, kStrategy /*strat*/, int /*start=0*/)
{
return FALSE;
}
#endif // defined(KINLINE) || defined(KUTIL_CC)
#endif // KINLINE_H
si_max
static int si_max(const int a, const int b)
Definition auxiliary.h:125
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
pp
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f ).
Definition cf_gcd.cc:676
l
int l
Definition cfEzgcd.cc:100
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
k
int k
Definition cfEzgcd.cc:99
x
Variable x
Definition cfModGcd.cc:4090
p
int p
Definition cfModGcd.cc:4086
bound
static CanonicalForm bound(const CFMatrix &M)
Definition cf_linsys.cc:460
sLObject::SetDegStuffReturnLDeg
KINLINE long SetDegStuffReturnLDeg()
Definition kInline.h:850
sLObject::Tail_Mult_nn
KINLINE void Tail_Mult_nn(number n)
Definition kInline.h:655
sLObject::i_r1
int i_r1
Definition kutil.h:194
sLObject::Copy
KINLINE void Copy()
Definition kInline.h:803
sLObject::Delete
KINLINE void Delete()
Definition kInline.h:585
sLObject::LmDeleteAndIter
KINLINE void LmDeleteAndIter()
Definition kInline.h:691
sLObject::T_2
KINLINE TObject * T_2(const skStrategy *strat)
Definition kInline.h:921
sLObject::PrepareRed
KINLINE void PrepareRed(BOOLEAN use_bucket)
Definition kInline.h:616
sLObject::CanonicalizeP
KINLINE void CanonicalizeP()
Definition kInline.h:361
sLObject::SetLmTail
KINLINE void SetLmTail(poly lm, poly new_p, int length, int use_bucket, ring r)
Definition kInline.h:637
sLObject::T_1_2
KINLINE void T_1_2(const skStrategy *strat, TObject *&T_1, TObject *&T_2)
Definition kInline.h:932
sLObject::Normalize
KINLINE void Normalize()
Definition kInline.h:347
sLObject::sev
unsigned long sev
Definition kutil.h:188
sLObject::Init
KINLINE void Init(ring tailRing=currRing)
Definition kInline.h:592
sLObject::MinComp
KINLINE long MinComp()
Definition kInline.h:881
sLObject::bucket
kBucket_pt bucket
Definition kutil.h:193
sLObject::p2
poly p2
Definition kutil.h:189
sLObject::T_1
KINLINE TObject * T_1(const skStrategy *strat)
Definition kInline.h:911
sLObject::GetpLength
KINLINE int GetpLength()
Definition kInline.h:864
sLObject::SetLength
KINLINE int SetLength(BOOLEAN lengt_pLength=FALSE)
Definition kInline.h:871
sLObject::Clear
KINLINE void Clear()
Definition kInline.h:578
sLObject::Tail_Minus_mm_Mult_qq
KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether)
Definition kInline.h:669
sLObject::ShallowCopyDelete
KINLINE void ShallowCopyDelete(ring new_tailRing, pShallowCopyDeleteProc p_shallow_copy_delete)
Definition kInline.h:780
sLObject::GetTP
KINLINE poly GetTP()
Definition kInline.h:737
sLObject::pLDeg
KINLINE long pLDeg()
Definition kInline.h:819
sLObject::operator=
KINLINE sLObject & operator=(const sTObject &)
Definition kInline.h:905
sLObject::SetShortExpVector
KINLINE void SetShortExpVector()
Definition kInline.h:791
sLObject::HeadNormalize
KINLINE void HeadNormalize()
Definition kInline.h:367
sLObject::GetP
KINLINE poly GetP(omBin lmBin=(omBin) NULL)
Definition kInline.h:753
sLObject::sLObject
KINLINE sLObject(ring tailRing=currRing)
Definition kInline.h:600
sLObject::p1
poly p1
Definition kutil.h:189
sLObject::Comp
KINLINE long Comp()
Definition kInline.h:896
sLObject::LmExtractAndIter
KINLINE poly LmExtractAndIter()
Definition kInline.h:711
sLObject::i_r2
int i_r2
Definition kutil.h:194
sTObject::GetLm
KINLINE poly GetLm(ring r)
Definition kInline.h:262
sTObject::GetLmCurrRing
KINLINE poly GetLmCurrRing()
Definition kInline.h:242
sTObject::Init
KINLINE void Init(ring r=currRing)
Definition kInline.h:110
sTObject::Mult_nn
KINLINE void Mult_nn(number n)
Definition kInline.h:334
sTObject::length
int length
Definition kutil.h:80
sTObject::SetDegStuffReturnLDeg
KINLINE long SetDegStuffReturnLDeg()
Definition kInline.h:446
sTObject::GetLmTailRing
KINLINE poly GetLmTailRing()
Definition kInline.h:249
sTObject::pCleardenom
KINLINE void pCleardenom()
Definition kInline.h:458
sTObject::ecart
int ecart
Definition kutil.h:79
sTObject::GetpFDeg
KINLINE long GetpFDeg() const
Definition kInline.h:437
sTObject::sTObject
KINLINE sTObject(ring tailRing=currRing)
Definition kInline.h:116
sTObject::ShallowCopyDelete
KINLINE void ShallowCopyDelete(ring new_tailRing, omBin new_tailBin, pShallowCopyDeleteProc p_shallow_copy_delete, BOOLEAN set_max=TRUE)
Definition kInline.h:381
sTObject::SetLmCurrRing
KINLINE void SetLmCurrRing()
Definition kInline.h:299
sTObject::max_exp
poly max_exp
Definition kutil.h:76
sTObject::is_normalized
char is_normalized
Definition kutil.h:88
sTObject::pLDeg
KINLINE long pLDeg()
Definition kInline.h:442
sTObject::LmDeleteAndIter
KINLINE void LmDeleteAndIter()
Definition kInline.h:313
sTObject::pLength
int pLength
Definition kutil.h:81
sTObject::pFDeg
KINLINE long pFDeg() const
Definition kInline.h:422
sTObject::i_r
int i_r
Definition kutil.h:82
sTObject::p
poly p
Definition kutil.h:74
sTObject::IsNull
KINLINE BOOLEAN IsNull() const
Definition kInline.h:288
sTObject::Set
KINLINE void Set(ring r=currRing)
Definition kInline.h:106
sTObject::Delete
KINLINE void Delete()
Definition kInline.h:199
sTObject::t_p
poly t_p
Definition kutil.h:75
sTObject::tailRing
ring tailRing
Definition kutil.h:77
sTObject::GetpLength
KINLINE int GetpLength()
Definition kInline.h:293
sTObject::pNorm
KINLINE void pNorm()
Definition kInline.h:558
sTObject::Clear
KINLINE void Clear()
Definition kInline.h:213
sTObject::FDeg
long FDeg
Definition kutil.h:78
sTObject::Next
KINLINE poly Next()
Definition kInline.h:305
sTObject::shift
int shift
Definition kutil.h:85
sTObject::pContent
KINLINE void pContent()
Definition kInline.h:536
sTObject::pTotalDeg
KINLINE long pTotalDeg() const
Definition kInline.h:427
sTObject::SetpFDeg
KINLINE long SetpFDeg()
Definition kInline.h:432
sTObject::Copy
KINLINE void Copy()
Definition kInline.h:224
skStrategy
Definition kutil.h:276
skStrategy::kNoetherTail
KINLINE poly kNoetherTail()
Definition kInline.h:66
skStrategy::t_kNoether
poly t_kNoether
Definition kutil.h:329
skStrategy::S_2_R
int * S_2_R
Definition kutil.h:341
skStrategy::tailRing
ring tailRing
Definition kutil.h:342
skStrategy::T
TSet T
Definition kutil.h:325
skStrategy::S
polyset S
Definition kutil.h:305
skStrategy::kNoether
poly kNoether
Definition kutil.h:328
skStrategy::R
TObject ** R
Definition kutil.h:339
skStrategy::tl
int tl
Definition kutil.h:349
skStrategy::s_2_t
KINLINE TObject * s_2_t(int i)
Definition kInline.h:47
skStrategy::S_2_T
KINLINE TObject * S_2_T(int i)
Definition kInline.h:38
skStrategy::noClearS
char noClearS
Definition kutil.h:399
skStrategy::sl
int sl
Definition kutil.h:347
skStrategy::sevS
unsigned long * sevS
Definition kutil.h:321
n_Invers
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of 'a'; raise an error if 'a' is not invertible
Definition coeffs.h:567
n_QuotRem
static FORCE_INLINE number n_QuotRem(number a, number b, number *q, const coeffs r)
Definition coeffs.h:684
n_GreaterZero
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2),...
Definition coeffs.h:500
n_GetUnit
static FORCE_INLINE number n_GetUnit(number n, const coeffs r)
in Z: 1 in Z/kZ (where k is not a prime): largest divisor of n (taken in Z) that is co-prime with k i...
Definition coeffs.h:537
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:461
n_DivBy
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z:...
Definition coeffs.h:750
n_IsOne
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition coeffs.h:474
s
const CanonicalForm int s
Definition facAbsFact.cc:51
copy
CFArray copy(const CFList &list)
write elements of list into an array
Definition facFqBivarUtil.cc:364
T
STATIC_VAR jList * T
Definition janet.cc:30
k_LmShallowCopyDelete_tailRing_2_currRing
KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin lmBin)
Definition kInline.h:984
ksOldCreateSpoly
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
Definition kInline.h:1194
redtailBba_Ring
KINLINE poly redtailBba_Ring(poly p, int pos, kStrategy strat)
Definition kInline.h:1224
ksOldSpolyTail
void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r)
Definition kInline.h:1204
k_LmShallowCopyDelete_currRing_2_tailRing
KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
Definition kInline.h:977
k_LmInit_currRing_2_tailRing
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
Definition kInline.h:959
initT
KINLINE TSet initT()
Definition kInline.h:84
k_GetStrongLeadTerms
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring tailRing)
Definition kInline.h:1060
ksReducePolyTailLC_Z
KINLINE int ksReducePolyTailLC_Z(LObject *PR, TObject *PW, LObject *Red)
Definition kInline.h:1107
redtailBba
KINLINE poly redtailBba(poly p, int pos, kStrategy strat, BOOLEAN normalize)
Definition kInline.h:1212
ksOldSpolyRed
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
Definition kInline.h:1174
k_LmInit_tailRing_2_currRing
KINLINE poly k_LmInit_tailRing_2_currRing(poly t_p, ring tailRing, omBin lmBin)
Definition kInline.h:968
initR
KINLINE TObject ** initR()
Definition kInline.h:95
redtailBbaBound
KINLINE poly redtailBbaBound(poly p, int pos, kStrategy strat, int bound, BOOLEAN normalize)
Definition kInline.h:1218
arriRewDummy
KINLINE BOOLEAN arriRewDummy(poly, unsigned long, poly, kStrategy, int)
Definition kInline.h:1258
ksReducePolyTail
KINLINE int ksReducePolyTail(LObject *PR, TObject *PW, LObject *Red)
Definition kInline.h:1147
ksOldSpolyRedNew
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether)
Definition kInline.h:1184
clearS
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
Definition kInline.h:1235
k_GetLeadTerms
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
Definition kInline.h:1018
redtailBba_Z
KINLINE poly redtailBba_Z(poly p, int pos, kStrategy strat)
Definition kInline.h:1229
ksReducePolyTail_Z
KINLINE int ksReducePolyTail_Z(LObject *PR, TObject *PW, LObject *Red)
Definition kInline.h:1125
initsevT
KINLINE unsigned long * initsevT()
Definition kInline.h:100
kBucketDeleteAndDestroy
void kBucketDeleteAndDestroy(kBucket_pt *bucket_pt)
Definition kbuckets.cc:223
kBucketClear
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition kbuckets.cc:521
kBucketShallowCopyDelete
void kBucketShallowCopyDelete(kBucket_pt bucket, ring new_tailRing, omBin new_tailBin, pShallowCopyDeleteProc p_shallow_copy_delete)
For changing the ring of the Bpoly to new_tailBin.
Definition kbuckets.cc:535
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
kBucket_Mult_n
void kBucket_Mult_n(kBucket_pt bucket, number n)
Multiply Bucket by number ,i.e. Bpoly == n*Bpoly.
Definition kbuckets.cc:598
kBucketDestroy
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition kbuckets.cc:216
kBucketInit
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition kbuckets.cc:493
kBucketExtractLm
poly kBucketExtractLm(kBucket_pt bucket)
Definition kbuckets.cc:511
kBucketCreate
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition kbuckets.cc:209
kbuckets.h
kBucketNormalize
void kBucketNormalize(kBucket_pt bucket)
apply n_Normalize to all coefficients
kBucketCanonicalize
int kBucketCanonicalize(kBucket_pt bucket)
Canonicalizes Bpoly, i.e. converts polys of buckets into one poly in one bucket: Returns number of bu...
ksReducePolyLC
int ksReducePolyLC(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
Definition kspoly.cc:477
ksCreateSpoly
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
Definition kspoly.cc:1203
ksReducePoly
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, poly *mon, kStrategy strat, BOOLEAN reduce)
Definition kspoly.cc:187
deleteInS
void deleteInS(int i, kStrategy strat)
Definition kutil.cc:1132
denominator_list
denominator_list_s * denominator_list
Definition kutil.h:64
kFindInT
int kFindInT(poly p, TSet T, int tlength)
returns index of p in TSet, or -1 if not found
Definition kutil.cc:703
TSet
TObject * TSet
Definition kutil.h:60
DENOMINATOR_LIST
EXTERN_VAR denominator_list DENOMINATOR_LIST
Definition kutil.h:67
k_LmInit_tailRing_2_currRing
KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
Definition kInline.h:968
denominator_list_s::n
number n
Definition kutil.h:66
denominator_list_s::next
denominator_list next
Definition kutil.h:66
k_LmInit_currRing_2_tailRing
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin bin)
Definition kInline.h:959
setmaxT
#define setmaxT
Definition kutil.h:34
KINLINE
#define KINLINE
Definition kutil.h:50
TObject
class sTObject TObject
Definition kutil.h:58
LObject
class sLObject LObject
Definition kutil.h:59
denominator_list_s
Definition kutil.h:66
mult
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition minpoly.cc:647
lcm
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition minpoly.cc:709
assume
#define assume(x)
Definition mod2.h:389
p_GetComp
#define p_GetComp(p, r)
Definition monomials.h:64
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
coeffs
The main handler for Singular numbers which are suitable for Singular polynomials.
lq
Definition lq.h:40
nDelete
#define nDelete(n)
Definition numbers.h:16
nInvers
#define nInvers(a)
Definition numbers.h:33
nIsOne
#define nIsOne(n)
Definition numbers.h:25
nNormalize
#define nNormalize(n)
Definition numbers.h:30
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211
NULL
#define NULL
Definition omList.c:12
omBin
omBin_t * omBin
Definition omStructs.h:12
omalloc.h
options.h
TEST_OPT_CONTENTSB
#define TEST_OPT_CONTENTSB
Definition options.h:129
p_Length
p_Length
Definition p_Procs_Impl.h:123
p_GetMaxExpP
poly p_GetMaxExpP(poly p, const ring r)
return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0,...
Definition p_polys.cc:1139
p_Cleardenom_n
void p_Cleardenom_n(poly ph, const ring r, number &c)
Definition p_polys.cc:3002
p_SimpleContent
void p_SimpleContent(poly ph, int smax, const ring r)
Definition p_polys.cc:2612
p_Norm
void p_Norm(poly p1, const ring r)
Definition p_polys.cc:3844
p_GetShortExpVector
unsigned long p_GetShortExpVector(const poly p, const ring r)
Definition p_polys.cc:4934
p_ProjectiveUnique
void p_ProjectiveUnique(poly ph, const ring r)
Definition p_polys.cc:3191
p_Last
poly p_Last(const poly p, int &l, const ring r)
Definition p_polys.cc:4775
p_polys.h
p_Neg
static poly p_Neg(poly p, const ring r)
Definition p_polys.h:1114
p_GetExpDiff
static long p_GetExpDiff(poly p1, poly p2, int i, ring r)
Definition p_polys.h:637
p_LmCheckPolyRing
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
Definition pDebug.cc:123
p_LmInit
static poly p_LmInit(poly p, const ring r)
Definition p_polys.h:1356
p_FDeg
static long p_FDeg(const poly p, const ring r)
Definition p_polys.h:382
p_SetExp
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition p_polys.h:490
p_MinComp
static long p_MinComp(poly p, ring lmRing, ring tailRing)
Definition p_polys.h:315
p_Setm
static void p_Setm(poly p, const ring r)
Definition p_polys.h:235
p_LmShallowCopyDelete
static poly p_LmShallowCopyDelete(poly p, const ring r)
Definition p_polys.h:1414
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition p_polys.h:471
p_Mult_nn
static poly p_Mult_nn(poly p, number n, const ring r)
Definition p_polys.h:960
p_Delete
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903
p_LmFree
static void p_LmFree(poly p, ring)
Definition p_polys.h:685
p_Minus_mm_Mult_qq
static poly p_Minus_mm_Mult_qq(poly p, const poly m, const poly q, int &lp, int lq, const poly spNoether, const ring r)
Definition p_polys.h:1077
p_Init
static poly p_Init(const ring r, omBin bin)
Definition p_polys.h:1341
p_LmDeleteAndNext
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition p_polys.h:757
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848
p_Totaldegree
static long p_Totaldegree(poly p, const ring r)
Definition p_polys.h:1528
p_Test
#define p_Test(p, r)
Definition p_polys.h:161
__p_Mult_nn
#define __p_Mult_nn(p, n, r)
Definition p_polys.h:973
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
polys.h
Compatibility layer for legacy polynomial operations (over currRing).
pLmShortDivisibleBy
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
Definition polys.h:147
pGetShortExpVector
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl....
Definition polys.h:153
pNormalize
#define pNormalize(p)
Definition polys.h:318
kBucket_pt
kBucket * kBucket_pt
Definition ring.h:26
rIsSyzIndexRing
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition ring.h:726
pShallowCopyDeleteProc
poly(* pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r, omBin dest_bin)
returns a poly from dest_r which is a ShallowCopy of s_p from source_r assumes that source_r->N == de...
Definition ring.h:45
rField_is_Ring
#define rField_is_Ring(R)
Definition ring.h:491
p_mFirstVblock
int p_mFirstVblock(poly p, const ring ri)
Definition shiftop.cc:478
shiftop.h
kStrategy
skStrategy * kStrategy
Definition structs.h:54
normalize
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
Definition syz3.cc:1027