1 #ifndef GRING_SA_MULT_H 2 #define GRING_SA_MULT_H 24 template <
typename CExponent>
32 CMultiplier(ring rBaseRing): m_basering(rBaseRing), m_NVars(rBaseRing->
N) {};
39 inline poly
LM(
const poly pTerm,
const ring r,
int i = 1)
const 47 inline poly
MultiplyTE(
const poly pTerm,
const CExponent expRight)
50 poly pMonom =
LM(pTerm, r);
61 inline poly
MultiplyET(
const CExponent expLeft,
const poly pTerm)
64 poly pMonom =
LM(pTerm, r);
77 virtual poly
MultiplyEE(
const CExponent expLeft,
const CExponent expRight) = 0;
80 virtual poly
MultiplyME(
const poly pMonom,
const CExponent expRight) = 0;
83 virtual poly
MultiplyEM(
const CExponent expLeft,
const poly pMonom) = 0;
108 inline int GetI()
const {
return m_i; }
109 inline int GetJ()
const {
return m_j; }
116 virtual poly
MultiplyEE(
const CExponent expLeft,
const CExponent expRight) = 0;
120 virtual poly
MultiplyME(
const poly pMonom,
const CExponent expRight);
124 virtual poly
MultiplyEM(
const CExponent expLeft,
const poly pMonom);
180 return m_specialpairs[( (
NVars() * ((
i)-1) - ((
i) * ((i)-1))/2 + (
j)-1) - (
i) )];
190 return m_specialpairs[( (
NVars() * ((
i)-1) - ((
i) * ((i)-1))/2 + (
j)-1) - (
i) )];
198 virtual poly
MultiplyEE(
const CExponent expLeft,
const CExponent expRight);
202 virtual poly
MultiplyME(
const poly pMonom,
const CExponent expRight);
206 virtual poly
MultiplyEM(
const CExponent expLeft,
const poly pMonom);
211 inline poly
MultiplyPE(
const poly pPoly,
const CExponent expRight)
216 for( poly q = pPoly; q !=
NULL; q =
pNext(q) )
223 inline poly
MultiplyEP(
const CExponent expLeft,
const poly pPoly)
228 for( poly q = pPoly; q !=
NULL; q =
pNext(q) )
284 virtual poly
MultiplyEE(
const CExponent expLeft,
const CExponent expRight);
287 virtual poly
MultiplyME(
const poly pMonom,
const CExponent expRight);
290 virtual poly
MultiplyEM(
const CExponent expLeft,
const poly pMonom);
296 inline poly
MultiplyPE(
const poly pPoly,
const CExponent expRight)
305 if( iComponentMonom!=0 )
307 for( poly q = pPoly; q !=
NULL; q =
pNext(q) )
315 Werror(
"MultiplyPE: both sides have non-zero components: %d and %d!\n", iComponent, iComponentMonom);
329 for( poly q = pPoly; q !=
NULL; q =
pNext(q) )
336 Warn(
"MultiplyPE: Multiplication in the left module from the right by component %d!\n", iComponent);
349 inline poly
MultiplyEP(
const CExponent expLeft,
const poly pPoly)
357 if( iComponentMonom!=0 )
359 for( poly q = pPoly; q !=
NULL; q =
pNext(q) )
367 Werror(
"MultiplyEP: both sides have non-zero components: %d and %d!\n", iComponent, iComponentMonom);
380 for( poly q = pPoly; q !=
NULL; q =
pNext(q) )
402 if( iComponentMonom!=0 )
412 Werror(
"MultiplyPEDestroy: both sides have non-zero components: %d and %d!\n", iComponent, iComponentMonom);
433 Warn(
"MultiplyPEDestroy: Multiplication in the left module from the right by component %d!\n", iComponent);
456 if( iComponentMonom!=0 )
466 Werror(
"MultiplyEPDestroy: both sides have non-zero components: %d and %d!\n", iComponent, iComponentMonom);
507 virtual poly
MultiplyEE(
const int expLeft,
const int expRight);
518 virtual poly
MultiplyEE(
const int expLeft,
const int expRight);
534 virtual poly
MultiplyEE(
const int expLeft,
const int expRight);
550 virtual poly
MultiplyEE(
const int expLeft,
const int expRight);
565 virtual poly
MultiplyEE(
const int expLeft,
const int expRight);
582 virtual poly
MultiplyEE(
const int expLeft,
const int expRight);
600 virtual poly
MultiplyEE(
const int expLeft,
const int expRight);
604 #endif // HAVE_PLURAL :(
const CanonicalForm int s
virtual poly MultiplyME(const poly pMonom, const CExponent expRight)=0
static poly p_LmDeleteAndNext(poly p, const ring r)
poly MultiplyTE(const poly pTerm, const CExponent expRight)
CSpecialPairMultiplier ** m_specialpairs
poly LM(const poly pTerm, const ring r, int i=1) const
virtual poly MultiplyEM(const CExponent expLeft, const poly pMonom)=0
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
poly MultiplyEPDestroy(const CExponent expLeft, poly pPoly)
#define MIN_LENGTH_BUCKET
const CFormulaPowerMultiplier * m_RingFormulaMultiplier
poly MultiplyPEDestroy(poly pPoly, const CExponent expRight)
virtual poly MultiplyEE(const CExponent expLeft, const CExponent expRight)=0
CSpecialPairMultiplier *& GetPair(int i, int j)
CMultiplier< poly > CBaseType
#define TEST_OPT_NOT_BUCKETS
CPowerMultiplier * m_powers
poly MultiplyPE(const poly pPoly, const CExponent expRight)
poly MultiplyEP(const CExponent expLeft, const poly pPoly)
poly MultiplyPEDestroy(poly pPoly, const CExponent expRight)
static void p_SetCompP(poly p, int i, ring r)
const CanonicalForm CFMap CFMap & N
CMultiplier & operator=(const CMultiplier &)
poly MultiplyEP(const CExponent expLeft, const poly pPoly)
static poly p_Mult_nn(poly p, number n, const ring r)
static unsigned pLength(poly a)
static void p_Delete(poly *p, const ring r)
CSpecialPairMultiplier * GetPair(int i, int j) const
static poly p_LmInit(poly p, const ring r)
poly MultiplyET(const CExponent expLeft, const poly pTerm)
poly MultiplyEPDestroy(const CExponent expLeft, poly pPoly)
BOOLEAN ncInitSpecialPairMultiplication(ring r)
poly MultiplyPE(const poly pPoly, const CExponent expRight)
CMultiplier(ring rBaseRing)
CPolynomialSummator: unifies bucket and polynomial summation as the later is brocken in buckets :(...
void Werror(const char *fmt,...)