34# define PLURAL_INTERNAL_DECLARATIONS
53static poly ggnc_pp_Mult_mm(
const poly
p,
const poly
m,
const ring r)
61 PrintS(
"VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ggnc_pp_Mult_mm(p, m) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ");
75 poly pMonom = pMultiplier->
LM(
m, r);
88 PrintS(
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ");
96static poly ggnc_p_Mult_mm(poly
p,
const poly
m,
const ring r)
107 PrintS(
"VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ggnc_p_Mult_mm(p, m) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ");
124 poly pMonom = pMultiplier->
LM(
m, r);
137 PrintS(
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ");
146static poly ggnc_p_mm_Mult(poly
p,
const poly
m,
const ring r)
160 PrintS(
"VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ggnc_p_mm_Mult(p,m) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ");
175 poly pMonom = pMultiplier->
LM(
m, r);
188 PrintS(
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ");
195static poly ggnc_pp_mm_Mult(
const poly
p,
const poly
m,
const ring r)
208 PrintS(
"VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ggnc_pp_mm_Mult(m, p) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ");
223 poly pMonom = pMultiplier->
LM(
m, r);
236 PrintS(
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ");
243static void ggnc_p_ProcsSet(ring rGR,
p_Procs_s* p_Procs)
246 PrintS(
"|ggnc_p_ProcsSet()");
253 p_Procs->p_Mult_mm = rGR->p_Procs->p_Mult_mm = ggnc_p_Mult_mm;
254 p_Procs->pp_Mult_mm = rGR->p_Procs->pp_Mult_mm = ggnc_pp_Mult_mm;
256 p_Procs->p_Minus_mm_Mult_qq = rGR->p_Procs->p_Minus_mm_Mult_qq =
NULL;
259 rGR->p_Procs->p_mm_Mult = ggnc_p_mm_Mult;
260 rGR->p_Procs->pp_mm_Mult = ggnc_pp_mm_Mult;
269 PrintS(
"ncInitSpecialPairMultiplication(ring), ring: \n");
280 if( r->GetNC()->GetGlobalMultiplier() !=
NULL )
282 WarnS(
"Already defined!");
288 ggnc_p_ProcsSet(r, r->p_Procs);
297 PrintS(
"CGlobalMultiplier::CGlobalMultiplier(ring)!");
309 PrintS(
"CGlobalMultiplier::~CGlobalMultiplier()!");
329 PrintS(
"CGlobalMultiplier::MultiplyEE(expLeft, expRight)!");
354 while( (
i <
j) && !((ej != 0) && (ei != 0)) )
365 PrintS(
"<CGlobalMultiplier::MultiplyEE>");
369 Print(
"ei: %d, ej: %d", ei, ej);
382 product =
p_Head(expRight, r);
430 PrintS(
"<CGlobalMultiplier::MultiplyEE> ==> ");
434 Print(
"ei: %d, ej: %d", ei, ej);
442 while( (product !=
NULL) && !((
i ==
NVars()) && (
j == 1)) )
451 while( (ei == 0) && (
i <
NVars()) )
462 while( (ej == 0) && (1 <
j) )
471 PrintS(
"<CGlobalMultiplier::MultiplyEE> ==> ");
475 Print(
"ei: %d, ej: %d", ei, ej);
495 PrintS(
"CGlobalMultiplier::MultiplyME(monom, expR)!");
508 PrintS(
"CGlobalMultiplier::MultiplyEM(expL, monom)!");
526 Print(
"CCommutativeSpecialPairMultiplier::CCommutativeSpecialPairMultiplier(ring, i: %d, j: %d)!",
i,
j);
535 PrintS(
"CCommutativeSpecialPairMultiplier::~CCommutativeSpecialPairMultiplier()");
544 Print(
"CCommutativeSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!",
GetJ(), expLeft,
GetI(), expRight);
558 Print(
"CAntiCommutativeSpecialPairMultiplier::CAntiCommutativeSpecialPairMultiplier(ring, i: %d, j: %d)!",
i,
j);
567 PrintS(
"CAntiCommutativeSpecialPairMultiplier::~CAntiCommutativeSpecialPairMultiplier()");
576 Print(
"CAntiCommutativeSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!",
GetJ(), expLeft,
GetI(), expRight);
590 Print(
"CQuasiCommutativeSpecialPairMultiplier::CQuasiCommutativeSpecialPairMultiplier(ring, i: %d, j: %d, q)!",
i,
j);
601 PrintS(
"CQuasiCommutativeSpecialPairMultiplier::~CQuasiCommutativeSpecialPairMultiplier()");
610 Print(
"CQuasiCommutativeSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!",
GetJ(), expLeft,
GetI(), expRight);
625 Print(
"CWeylSpecialPairMultiplier::CWeylSpecialPairMultiplier(ring, i: %d, j: %d, g)!",
i,
j);
636 PrintS(
"CWeylSpecialPairMultiplier::~CWeylSpecialPairMultiplier()");
645 Print(
"CWeylSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!",
GetJ(), expLeft,
GetI(), expRight);
653 assume( expLeft*expRight > 0 );
663 Print(
"CHWeylSpecialPairMultiplier::CHWeylSpecialPairMultiplier(ring, i: %d, j: %d, k: %d)!",
i,
j,
k);
672 PrintS(
"CHWeylSpecialPairMultiplier::~CHWeylSpecialPairMultiplier()");
681 Print(
"CHWeylSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!",
GetJ(), expLeft,
GetI(), expRight);
689 assume( expLeft*expRight > 0 );
700 Print(
"CShiftSpecialPairMultiplier::CShiftSpecialPairMultiplier(ring, i: %d, j: %d, s: %d, c)!",
i,
j,
s);
710 PrintS(
"CShiftSpecialPairMultiplier::~CShiftSpecialPairMultiplier()");
719 Print(
"CShiftSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!",
GetJ(), expLeft,
GetI(), expRight);
724 assume( expLeft*expRight > 0 );
742 Print(
"CExternalSpecialPairMultiplier::CExternalSpecialPairMultiplier(ring, i: %d, j: %d, type: %d, c)!",
i,
j, (
int)type);
751 PrintS(
"CExternalSpecialPairMultiplier::~CExternalSpecialPairMultiplier()");
760 Print(
"CExternalSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!",
GetJ(), expLeft,
GetI(), expRight);
765 assume( expLeft*expRight > 0 );
781 Print(
"AnalyzePair(ring, i: %d, j: %d)!",
i,
j);
806 const poly d =
GetD(r,
i,
j);
835 PrintS(
"CPowerMultiplier::CPowerMultiplier(ring)!");
850 PrintS(
"CPowerMultiplier::~CPowerMultiplier()!");
862 const int j = expRight.
Var;
863 const int n = expRight.
Power;
868 Print(
"CPowerMultiplier::MultiplyME(monom * var(%d)^{%d})!",
j, n);
882 while((
v >
j) && (e == 0))
915 PrintS(
"CPowerMultiplier::MultiplyME() ===> ");
929 const int j = expLeft.
Var;
930 const int n = expLeft.
Power;
933 Print(
"CPowerMultiplier::MultiplyEM(var(%d)^{%d} * monom)!",
j, n);
947 while((
v <
j) && (e == 0))
980 PrintS(
"CPowerMultiplier::MultiplyEM() ===> ");
994 PrintS(
"CPowerMultiplier::MultiplyEE)!");
998 const int i = expRight.
Var,
j = expLeft.
Var;
999 const int ei = expRight.
Power, ej = expLeft.
Power;
1002 Print(
"Input: var(%d)^{%d} * var(%d)^{%d}",
j, ej,
i, ei);
1017 poly product =
p_One(r);
1033 if( pSpecialMultiplier !=
NULL )
1039 return pSpecialMultiplier->
MultiplyEE(ej, ei);
1045 WerrorS(
"Sorry the general case is not implemented this way yet!!!");
1064 Print(
"CSpecialPairMultiplier::CSpecialPairMultiplier(ring, i: %d, j: %d)!",
i,
j);
1077 PrintS(
"CSpecialPairMultiplier::~CSpecialPairMultiplier()!");
1088 Print(
"CSpecialPairMultiplier::MultiplyME(monom, var(%d)^{%d})!",
GetI(), expRight);
1100 Print(
"CSpecialPairMultiplier::MultiplyEM(var(%d)^{%d}, monom)!",
GetJ(), expLeft);
const CanonicalForm CFMap CFMap & N
CAntiCommutativeSpecialPairMultiplier(ring r, int i, int j)
virtual poly MultiplyEE(const int expLeft, const int expRight)
virtual ~CAntiCommutativeSpecialPairMultiplier()
virtual ~CCommutativeSpecialPairMultiplier()
CCommutativeSpecialPairMultiplier(ring r, int i, int j)
virtual poly MultiplyEE(const int expLeft, const int expRight)
virtual poly MultiplyEE(const int expLeft, const int expRight)
virtual ~CExternalSpecialPairMultiplier()
CExternalSpecialPairMultiplier(ring r, int i, int j, Enum_ncSAType type)
poly MultiplyPEDestroy(poly pPoly, const CExponent expRight)
poly MultiplyEPDestroy(const CExponent expLeft, poly pPoly)
virtual poly MultiplyME(const poly pMonom, const CExponent expRight)
CPowerMultiplier * m_powers
poly MultiplyEP(const CExponent expLeft, const poly pPoly)
virtual poly MultiplyEE(const CExponent expLeft, const CExponent expRight)
poly MultiplyPE(const poly pPoly, const CExponent expRight)
CGlobalMultiplier(ring r)
const CFormulaPowerMultiplier * m_RingFormulaMultiplier
virtual poly MultiplyEM(const CExponent expLeft, const poly pMonom)
virtual ~CGlobalMultiplier()
virtual poly MultiplyEE(const int expLeft, const int expRight)
CHWeylSpecialPairMultiplier(ring r, int i, int j, int k)
virtual ~CHWeylSpecialPairMultiplier()
poly LM(const poly pTerm, const ring r, int i=1) const
virtual ~CPowerMultiplier()
virtual poly MultiplyEE(const CExponent expLeft, const CExponent expRight)
virtual poly MultiplyME(const poly pMonom, const CExponent expRight)
virtual poly MultiplyEM(const CExponent expLeft, const poly pMonom)
CSpecialPairMultiplier * GetPair(int i, int j) const
poly MultiplyPEDestroy(poly pPoly, const CExponent expRight)
poly MultiplyEPDestroy(const CExponent expLeft, poly pPoly)
CSpecialPairMultiplier ** m_specialpairs
CQuasiCommutativeSpecialPairMultiplier(ring r, int i, int j, number q)
virtual ~CQuasiCommutativeSpecialPairMultiplier()
virtual poly MultiplyEE(const int expLeft, const int expRight)
CShiftSpecialPairMultiplier(ring r, int i, int j, int s, number c)
virtual poly MultiplyEE(const int expLeft, const int expRight)
virtual ~CShiftSpecialPairMultiplier()
CSpecialPairMultiplier(ring r, int i, int j)
virtual poly MultiplyEM(const CExponent expLeft, const poly pMonom)
virtual poly MultiplyME(const poly pMonom, const CExponent expRight)
virtual ~CSpecialPairMultiplier()
virtual poly MultiplyEE(const CExponent expLeft, const CExponent expRight)=0
virtual poly MultiplyEE(const int expLeft, const int expRight)
CWeylSpecialPairMultiplier(ring r, int i, int j, number g)
virtual ~CWeylSpecialPairMultiplier()
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
void WerrorS(const char *s)
static bool rIsSCA(const ring r)
static poly GetD(const ring r, int i, int j)
static poly GetC(const ring r, int i, int j)
CSpecialPairMultiplier * AnalyzePair(const ring r, int i, int j)
BOOLEAN ncInitSpecialPairMultiplication(ring r)
#define omFreeSize(addr, size)
int p_IsPurePower(const poly p, const ring r)
return i, if head depends only on var(i)
#define __pp_Mult_nn(p, n, r)
void p_Write(poly p, ring lmRing, ring tailRing)
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
static void p_Setm(poly p, const ring r)
static poly p_Head(const poly p, const ring r)
copy the (leading) term of p
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
static BOOLEAN p_IsConstant(const poly p, const ring r)
static void p_Delete(poly *p, const ring r)
#define __p_Mult_nn(p, n, r)
void PrintS(const char *s)
void rWrite(ring r, BOOLEAN details)
struct p_Procs_s p_Procs_s
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!