Loading...
Searching...
No Matches
ncSAMult.cc
Go to the documentation of this file.
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/***************************************************************
* File: ncSAMult.cc
* Purpose: implementation of multiplication in simple NC subalgebras
* Author: motsak
* Created:
*******************************************************************/
#define MYTEST 0
#if MYTEST
#define OM_CHECK 4
#define OM_TRACK 5
// these settings must be before "mod2.h" in order to work!!!
#endif
#include "misc/auxiliary.h"
#ifdef HAVE_PLURAL
#ifndef SING_NDEBUG
#define OUTPUT MYTEST
#else
#define OUTPUT 0
#endif
# define PLURAL_INTERNAL_DECLARATIONS
#include "nc/nc.h"
#include "nc/sca.h"
#include "misc/options.h"
#include "coeffs/numbers.h"
#include "monomials/ring.h"
#include "monomials/p_polys.h"
#include "nc/ncSAMult.h" // for CMultiplier etc classes
// #include "nc/sca.h" // for SCA
namespace
{
// poly functions defined in p_Procs: ;
static poly ggnc_pp_Mult_mm(const poly p, const poly m, const ring r)
{
if( (p == NULL) || (m == NULL) )
return NULL;
assume( (p != NULL) && (m != NULL) && (r != NULL) );
#if OUTPUT
PrintS("VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ggnc_pp_Mult_mm(p, m) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ");
PrintLn();
PrintS("p: "); p_Write(p, r);
PrintS("m: "); p_Write(m, r);
#endif
poly pResult;
if (p_IsConstant(m, r))
pResult = __pp_Mult_nn(p, p_GetCoeff(m,r),r);
else
{
CGlobalMultiplier* const pMultiplier = r->GetNC()->GetGlobalMultiplier();
assume( pMultiplier != NULL );
poly pMonom = pMultiplier->LM(m, r);
pResult = pMultiplier->MultiplyPE(p, pMonom);
p_Delete(&pMonom, r);
p_Test(pResult, r);
pResult = __p_Mult_nn(pResult, p_GetCoeff(m, r), r);
}
#if OUTPUT
p_Test(pResult, r);
PrintS("ggnc_pp_Mult_mm(p, m) => "); p_Write(pResult, r);
PrintS("p: "); p_Write(p, r);
PrintS("m: "); p_Write(m, r);
PrintS("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ");
PrintLn();
#endif
return pResult;
}
static poly ggnc_p_Mult_mm(poly p, const poly m, const ring r)
{
if( (p == NULL) || (m == NULL) )
{
p_Delete(&p, r);
return NULL;
}
assume( (p != NULL) && (m != NULL) && (r != NULL) );
#if OUTPUT
PrintS("VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ggnc_p_Mult_mm(p, m) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ");
PrintLn();
PrintS("p: ");
p_Write(p, r);
PrintS("m: ");
p_Write(m, r);
#endif
poly pResult;
if (p_IsConstant(m, r))
pResult = __p_Mult_nn(p, p_GetCoeff(m,r),r);
else
{
CGlobalMultiplier* const pMultiplier = r->GetNC()->GetGlobalMultiplier();
assume( pMultiplier != NULL );
poly pMonom = pMultiplier->LM(m, r);
pResult = pMultiplier->MultiplyPEDestroy(p, pMonom);
p_Delete(&pMonom, r);
p_Test(pResult, r);
pResult = __p_Mult_nn(pResult, p_GetCoeff(m, r), r);
}
#if OUTPUT
p_Test(pResult, r);
PrintS("ggnc_p_Mult_mm(p, m) => "); p_Write(pResult, r);
// PrintS("p: "); p_Write(p, r);
PrintS("m: "); p_Write(m, r);
PrintS("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ");
PrintLn();
#endif
return pResult;
}
/* m*p */
static poly ggnc_p_mm_Mult(poly p, const poly m, const ring r)
{
if( (p == NULL) || (m == NULL) )
{
p_Delete(&p, r);
return NULL;
}
assume( (p != NULL) && (m != NULL) && (r != NULL) );
p_Test(m, r);
p_Test(p, r);
#if OUTPUT
PrintS("VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ggnc_p_mm_Mult(p,m) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ");
PrintLn();
PrintS("m: "); p_Write(m, r);
PrintS("p: "); p_Write(p, r);
#endif
poly pResult;
if (p_IsConstant(m, r))
pResult = __p_Mult_nn(p, p_GetCoeff(m,r),r);
else
{
CGlobalMultiplier* const pMultiplier = r->GetNC()->GetGlobalMultiplier();
assume( pMultiplier != NULL );
poly pMonom = pMultiplier->LM(m, r);
pResult = pMultiplier->MultiplyEPDestroy(pMonom, p);
p_Delete(&pMonom, r);
p_Test(pResult, r);
pResult = __p_Mult_nn(pResult, p_GetCoeff(m, r), r);
}
#if OUTPUT
p_Test(pResult, r);
PrintS("ggnc_p_mm_Mult(p,m) => "); p_Write(pResult, r);
// PrintS("p: "); p_Write(p, r);
PrintS("m: "); p_Write(m, r);
PrintS("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ");
PrintLn();
#endif
return pResult;
}
static poly ggnc_pp_mm_Mult(const poly p, const poly m, const ring r)
{
if( (p == NULL) || (m == NULL) )
{
return NULL;
}
assume( (p != NULL) && (m != NULL) && (r != NULL) );
p_Test(m, r);
p_Test(p, r);
#if OUTPUT
PrintS("VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ggnc_pp_mm_Mult(m, p) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ");
PrintLn();
PrintS("m: "); p_Write(m, r);
PrintS("p: "); p_Write(p, r);
#endif
poly pResult;
if (p_IsConstant(m, r))
pResult = __pp_Mult_nn(p, p_GetCoeff(m,r),r);
else
{
CGlobalMultiplier* const pMultiplier = r->GetNC()->GetGlobalMultiplier();
assume( pMultiplier != NULL );
poly pMonom = pMultiplier->LM(m, r);
pResult = pMultiplier->MultiplyEP(pMonom, p);
p_Delete(&pMonom, r);
p_Test(pResult, r);
pResult = __p_Mult_nn(pResult, p_GetCoeff(m, r), r);
}
#if OUTPUT
p_Test(pResult, r);
PrintS("ggnc_pp_mm_Mult(m, p) => "); p_Write(pResult, r);
PrintS("p: "); p_Write(p, r);
PrintS("m: "); p_Write(m, r);
PrintS("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ");
PrintLn();
#endif
return pResult;
}
static void ggnc_p_ProcsSet(ring rGR, p_Procs_s* p_Procs)
{
#if OUTPUT
PrintS("|ggnc_p_ProcsSet()");
PrintLn();
#endif
assume( p_Procs != NULL );
// "commutative"
p_Procs->p_Mult_mm = rGR->p_Procs->p_Mult_mm = ggnc_p_Mult_mm;
p_Procs->pp_Mult_mm = rGR->p_Procs->pp_Mult_mm = ggnc_pp_Mult_mm;
p_Procs->p_Minus_mm_Mult_qq = rGR->p_Procs->p_Minus_mm_Mult_qq = NULL;
// non-commutaitve multiplication by monomial from the left
rGR->p_Procs->p_mm_Mult = ggnc_p_mm_Mult;
rGR->p_Procs->pp_mm_Mult = ggnc_pp_mm_Mult;
}
}
BOOLEAN ncInitSpecialPairMultiplication(ring r)
{
#if OUTPUT
PrintS("ncInitSpecialPairMultiplication(ring), ring: \n");
rWrite(r, TRUE);
PrintLn();
#endif
if(!rIsPluralRing(r))// ; // :(((
return TRUE;
if(rIsSCA(r))
return TRUE;
if( r->GetNC()->GetGlobalMultiplier() != NULL )
{
WarnS("Already defined!");
return TRUE;
}
r->GetNC()->GetGlobalMultiplier() = new CGlobalMultiplier(r);
ggnc_p_ProcsSet(r, r->p_Procs);
return FALSE; // ok!
}
CGlobalMultiplier::CGlobalMultiplier(ring r):
CMultiplier<poly>(r), m_RingFormulaMultiplier(GetFormulaPowerMultiplier(r))
{
#if OUTPUT
PrintS("CGlobalMultiplier::CGlobalMultiplier(ring)!");
PrintLn();
#endif
// m_cache = new CGlobalCacheHash(r);
m_powers = new CPowerMultiplier(r);
}
CGlobalMultiplier::~CGlobalMultiplier()
{
#if OUTPUT
PrintS("CGlobalMultiplier::~CGlobalMultiplier()!");
PrintLn();
#endif
// delete m_cache;
delete m_powers;
// we cannot delete m_RingFormulaMultiplier as it belongs to the ring!
}
// Exponent * Exponent
// TODO: handle components!!!
poly CGlobalMultiplier::MultiplyEE(const CGlobalMultiplier::CExponent expLeft, const CGlobalMultiplier::CExponent expRight)
{
const ring r = GetBasering();
#if OUTPUT
PrintS("CGlobalMultiplier::MultiplyEE(expLeft, expRight)!");
PrintLn();
PrintS("expL: "); p_Write(expLeft, GetBasering());
PrintS("expR: "); p_Write(expRight, GetBasering());
#endif
// CCacheHash<poly>::CCacheItem* pLookup;
//
// int b = m_cache->LookupEE(expLeft, expRight, pLookup);
// // TODO!!!
//
// // up to now:
// assume( b == -1 );
// TODO: use PowerMultiplier!!!!
poly product = NULL;
const int N = NVars();
int j = N;
int i = 1;
int ej = p_GetExp(expLeft, j, r);
int ei = p_GetExp(expRight, i, r);
while( (i < j) && !((ej != 0) && (ei != 0)) )
{
if( ei == 0 )
ei = p_GetExp(expRight, ++i, r);
if( ej == 0 )
ej = p_GetExp(expLeft, --j, r);
}
#if OUTPUT
PrintS("<CGlobalMultiplier::MultiplyEE>");
PrintLn();
Print("i: %d, j: %d", i, j);
PrintLn();
Print("ei: %d, ej: %d", ei, ej);
PrintLn();
#endif
// | expLeft | * | expRight |
// |<<<< ej 0..0| , |0..0 ei >>>>|
// |<<<< j <<<N| , |1>>> i >>>>|
if( i >= j ) // BUG here!!!???
{
// either i == j or i = j + 1 => commutative multiple!
// TODO: it can be done more efficiently! ()
product = p_Head(expRight, r);
// | expLeft | * | expRight |
// |<<<< ej 0....0| , |0..00 ei >>>>|
// |<<<< j i <<<N| , |1>>>j i >>>>|
if(i > j)
{
--i;
ei = 0;
}
if( i == j )
{
if( ej != 0 )
p_SetExp(product, i, ei + ej, r);
}
--i;
for(; i > 0; --i)
{
const int e = p_GetExp(expLeft, i, r);
if( e > 0 )
p_SetExp(product, i, e, r);
}
p_Setm(product, r);
} else
{ // i < j, ei != 0, ej != 0
Enum_ncSAType PairType = _ncSA_notImplemented;
if( m_RingFormulaMultiplier != NULL )
PairType = m_RingFormulaMultiplier->GetPair(i, j);
if( PairType == _ncSA_notImplemented )
product = m_powers->MultiplyEE( CPower(j, ej), CPower(i, ei) );
// return ggnc_uu_Mult_ww_vert(i, a, j, b, r);
else
// return m_RingFormulaMultiplier->Multiply(j, i, b, a);
product = CFormulaPowerMultiplier::Multiply( PairType, i, j, ei, ej, GetBasering());
#if OUTPUT
PrintS("<CGlobalMultiplier::MultiplyEE> ==> ");
PrintLn();
Print("i: %d, j: %d", i, j);
PrintLn();
Print("ei: %d, ej: %d", ei, ej);
PrintLn();
PrintS("<product>: "); p_Write(product, GetBasering());
#endif
// TODO: Choose some multiplication strategy!!!
while( (product != NULL) && !((i == NVars()) && (j == 1)) )
{
// make some choice here!:
if( i < NVars() )
{
ei = p_GetExp(expRight, ++i, r);
while( (ei == 0) && (i < NVars()) )
ei = p_GetExp(expRight, ++i, r);
if( ei != 0 )
product = m_powers->MultiplyPEDestroy(product, CPower(i, ei));
}
if( j > 1 )
{
ej = p_GetExp(expLeft, --j, r);
while( (ej == 0) && (1 < j) )
ej = p_GetExp(expLeft, --j, r);
if( ej != 0 )
product = m_powers->MultiplyEPDestroy(CPower(j, ej), product);
}
#if OUTPUT
PrintS("<CGlobalMultiplier::MultiplyEE> ==> ");
PrintLn();
Print("i: %d, j: %d", i, j);
PrintLn();
Print("ei: %d, ej: %d", ei, ej);
PrintLn();
PrintS("<product>: "); p_Write(product, GetBasering());
#endif
}
}
// // TODO!
//
// m_cache->StoreEE( expLeft, expRight, product);
// // up to now:
return product;
}
// Monom * Exponent
poly CGlobalMultiplier::MultiplyME(const poly pMonom, const CGlobalMultiplier::CExponent expRight)
{
#if OUTPUT
PrintS("CGlobalMultiplier::MultiplyME(monom, expR)!");
PrintLn();
PrintS("Monom: "); p_Write(pMonom, GetBasering());
PrintS("expR: "); p_Write(expRight, GetBasering());
#endif
return MultiplyEE(pMonom, expRight);
}
// Exponent * Monom
poly CGlobalMultiplier::MultiplyEM(const CGlobalMultiplier::CExponent expLeft, const poly pMonom)
{
#if OUTPUT
PrintS("CGlobalMultiplier::MultiplyEM(expL, monom)!");
PrintLn();
PrintS("expL: "); p_Write(expLeft, GetBasering());
PrintS("Monom: "); p_Write(pMonom, GetBasering());
#endif
return MultiplyEE(expLeft, pMonom);
}
///////////////////////////////////////////////////////////////////////////////////////////
CCommutativeSpecialPairMultiplier::CCommutativeSpecialPairMultiplier(ring r, int i, int j):
CSpecialPairMultiplier(r, i, j)
{
#if OUTPUT
Print("CCommutativeSpecialPairMultiplier::CCommutativeSpecialPairMultiplier(ring, i: %d, j: %d)!", i, j);
PrintLn();
#endif
}
CCommutativeSpecialPairMultiplier::~CCommutativeSpecialPairMultiplier()
{
#if OUTPUT
PrintS("CCommutativeSpecialPairMultiplier::~CCommutativeSpecialPairMultiplier()");
PrintLn();
#endif
}
// Exponent * Exponent
poly CCommutativeSpecialPairMultiplier::MultiplyEE(const int expLeft, const int expRight)
{
#if OUTPUT
Print("CCommutativeSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!", GetJ(), expLeft, GetI(), expRight);
PrintLn();
#endif
const ring r = GetBasering();
return CFormulaPowerMultiplier::ncSA_1xy0x0y0(GetI(), GetJ(), expRight, expLeft, r);
}
///////////////////////////////////////////////////////////////////////////////////////////
CAntiCommutativeSpecialPairMultiplier::CAntiCommutativeSpecialPairMultiplier(ring r, int i, int j):
CSpecialPairMultiplier(r, i, j)
{
#if OUTPUT
Print("CAntiCommutativeSpecialPairMultiplier::CAntiCommutativeSpecialPairMultiplier(ring, i: %d, j: %d)!", i, j);
PrintLn();
#endif
}
CAntiCommutativeSpecialPairMultiplier::~CAntiCommutativeSpecialPairMultiplier()
{
#if OUTPUT
PrintS("CAntiCommutativeSpecialPairMultiplier::~CAntiCommutativeSpecialPairMultiplier()");
PrintLn();
#endif
}
// Exponent * Exponent
poly CAntiCommutativeSpecialPairMultiplier::MultiplyEE(const int expLeft, const int expRight)
{
#if OUTPUT
Print("CAntiCommutativeSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!", GetJ(), expLeft, GetI(), expRight);
PrintLn();
#endif
const ring r = GetBasering();
return CFormulaPowerMultiplier::ncSA_Mxy0x0y0(GetI(), GetJ(), expRight, expLeft, r);
}
///////////////////////////////////////////////////////////////////////////////////////////
CQuasiCommutativeSpecialPairMultiplier::CQuasiCommutativeSpecialPairMultiplier(ring r, int i, int j, number q):
CSpecialPairMultiplier(r, i, j), m_q(q)
{
#if OUTPUT
Print("CQuasiCommutativeSpecialPairMultiplier::CQuasiCommutativeSpecialPairMultiplier(ring, i: %d, j: %d, q)!", i, j);
PrintLn();
PrintS("Parameter q: ");
n_Write(q, r);
#endif
}
CQuasiCommutativeSpecialPairMultiplier::~CQuasiCommutativeSpecialPairMultiplier()
{
#if OUTPUT
PrintS("CQuasiCommutativeSpecialPairMultiplier::~CQuasiCommutativeSpecialPairMultiplier()");
PrintLn();
#endif
}
// Exponent * Exponent
poly CQuasiCommutativeSpecialPairMultiplier::MultiplyEE(const int expLeft, const int expRight)
{
#if OUTPUT
Print("CQuasiCommutativeSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!", GetJ(), expLeft, GetI(), expRight);
PrintLn();
#endif
const ring r = GetBasering();
return CFormulaPowerMultiplier::ncSA_Qxy0x0y0(GetI(), GetJ(), expRight, expLeft, m_q, r);
}
///////////////////////////////////////////////////////////////////////////////////////////
CWeylSpecialPairMultiplier::CWeylSpecialPairMultiplier(ring r, int i, int j, number g):
CSpecialPairMultiplier(r, i, j), m_g(g)
{
#if OUTPUT
Print("CWeylSpecialPairMultiplier::CWeylSpecialPairMultiplier(ring, i: %d, j: %d, g)!", i, j);
PrintLn();
PrintS("Parameter g: ");
n_Write(g, r);
#endif
}
CWeylSpecialPairMultiplier::~CWeylSpecialPairMultiplier()
{
#if OUTPUT
PrintS("CWeylSpecialPairMultiplier::~CWeylSpecialPairMultiplier()");
PrintLn();
#endif
}
// Exponent * Exponent
poly CWeylSpecialPairMultiplier::MultiplyEE(const int expLeft, const int expRight)
{
#if OUTPUT
Print("CWeylSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!", GetJ(), expLeft, GetI(), expRight);
PrintLn();
#endif
// Char == 0, otherwise - problem!
const ring r = GetBasering();
assume( expLeft*expRight > 0 );
return CFormulaPowerMultiplier::ncSA_1xy0x0yG(GetI(), GetJ(), expRight, expLeft, m_g, r);
}
///////////////////////////////////////////////////////////////////////////////////////////
CHWeylSpecialPairMultiplier::CHWeylSpecialPairMultiplier(ring r, int i, int j, int k):
CSpecialPairMultiplier(r, i, j), m_k(k)
{
#if OUTPUT
Print("CHWeylSpecialPairMultiplier::CHWeylSpecialPairMultiplier(ring, i: %d, j: %d, k: %d)!", i, j, k);
PrintLn();
#endif
}
CHWeylSpecialPairMultiplier::~CHWeylSpecialPairMultiplier()
{
#if OUTPUT
PrintS("CHWeylSpecialPairMultiplier::~CHWeylSpecialPairMultiplier()");
PrintLn();
#endif
}
// Exponent * Exponent
poly CHWeylSpecialPairMultiplier::MultiplyEE(const int expLeft, const int expRight)
{
#if OUTPUT
Print("CHWeylSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!", GetJ(), expLeft, GetI(), expRight);
PrintLn();
#endif
// Char == 0, otherwise - problem!
const ring r = GetBasering();
assume( expLeft*expRight > 0 );
return CFormulaPowerMultiplier::ncSA_1xy0x0yT2(GetI(), GetJ(), expRight, expLeft, m_k, r);
}
///////////////////////////////////////////////////////////////////////////////////////////
CShiftSpecialPairMultiplier::CShiftSpecialPairMultiplier(ring r, int i, int j, int s, number c):
CSpecialPairMultiplier(r, i, j), m_shiftCoef(c), m_shiftVar(s)
{
#if OUTPUT
Print("CShiftSpecialPairMultiplier::CShiftSpecialPairMultiplier(ring, i: %d, j: %d, s: %d, c)!", i, j, s);
PrintLn();
PrintS("Parameter c: "); n_Write(c, r);
#endif
}
CShiftSpecialPairMultiplier::~CShiftSpecialPairMultiplier()
{
#if OUTPUT
PrintS("CShiftSpecialPairMultiplier::~CShiftSpecialPairMultiplier()");
PrintLn();
#endif
}
// Exponent * Exponent
poly CShiftSpecialPairMultiplier::MultiplyEE(const int expLeft, const int expRight)
{
#if OUTPUT
Print("CShiftSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!", GetJ(), expLeft, GetI(), expRight);
PrintLn();
#endif
// Char == 0, otherwise - problem!
assume( expLeft*expRight > 0 );
const ring r = GetBasering();
if( m_shiftVar != GetI() ) // YX = XY + b*Y?
return CFormulaPowerMultiplier::ncSA_1xy0xBy0(GetI(), GetJ(), expRight, expLeft, m_shiftCoef, r); // case: (1, 0, beta, 0, 0)
else
return CFormulaPowerMultiplier::ncSA_1xyAx0y0(GetI(), GetJ(), expRight, expLeft, m_shiftCoef, r); // case: (1, alpha, 0, 0)
}
///////////////////////////////////////////////////////////////////////////////////////////
CExternalSpecialPairMultiplier::CExternalSpecialPairMultiplier(ring r, int i, int j, Enum_ncSAType type):
CSpecialPairMultiplier(r, i, j), m_ncSAtype(type)
{
#if OUTPUT
Print("CExternalSpecialPairMultiplier::CExternalSpecialPairMultiplier(ring, i: %d, j: %d, type: %d, c)!", i, j, (int)type);
PrintLn();
#endif
}
CExternalSpecialPairMultiplier::~CExternalSpecialPairMultiplier()
{
#if OUTPUT
PrintS("CExternalSpecialPairMultiplier::~CExternalSpecialPairMultiplier()");
PrintLn();
#endif
}
// Exponent * Exponent
poly CExternalSpecialPairMultiplier::MultiplyEE(const int expLeft, const int expRight)
{
#if OUTPUT
Print("CExternalSpecialPairMultiplier::MultiplyEE(var(%d)^{%d}, var(%d)^{%d})!", GetJ(), expLeft, GetI(), expRight);
PrintLn();
#endif
// Char == 0, otherwise - problem!
assume( expLeft*expRight > 0 );
const ring r = GetBasering();
return CFormulaPowerMultiplier::Multiply(m_ncSAtype, GetI(), GetJ(), expRight, expLeft, r);
}
///////////////////////////////////////////////////////////////////////////////////////////
// factory method!
CSpecialPairMultiplier* AnalyzePair(const ring r, int i, int j)
{
#if OUTPUT
Print("AnalyzePair(ring, i: %d, j: %d)!", i, j);
PrintLn();
#endif
Enum_ncSAType type = CFormulaPowerMultiplier::AnalyzePair(r, i, j);
if( type == _ncSA_notImplemented ) return NULL;
// last possibility:
return new CExternalSpecialPairMultiplier(r, i, j, type); // For tests!
if( type == _ncSA_1xy0x0y0 )
return new CCommutativeSpecialPairMultiplier(r, i, j);
if( type == _ncSA_Mxy0x0y0 )
return new CAntiCommutativeSpecialPairMultiplier(r, i, j);
if( type == _ncSA_Qxy0x0y0 )
{
const number q = p_GetCoeff(GetC(r, i, j), r);
return new CQuasiCommutativeSpecialPairMultiplier(r, i, j, q);
}
const poly d = GetD(r, i, j);
assume( d != NULL );
assume( pNext(d) == NULL );
const number g = p_GetCoeff(d, r);
if( type == _ncSA_1xy0x0yG ) // Weyl
return new CWeylSpecialPairMultiplier(r, i, j, g);
if( type == _ncSA_1xyAx0y0 ) // Shift 1
return new CShiftSpecialPairMultiplier(r, i, j, i, g);
if( type == _ncSA_1xy0xBy0 ) // Shift 2
return new CShiftSpecialPairMultiplier(r, i, j, j, g);
if( type == _ncSA_1xy0x0yT2 ) // simple homogenized Weyl algebra
return new CHWeylSpecialPairMultiplier(r, i, j, p_IsPurePower(d, r));
}
CPowerMultiplier::CPowerMultiplier(ring r): CMultiplier<CPower>(r)
{
#if OUTPUT
PrintS("CPowerMultiplier::CPowerMultiplier(ring)!");
PrintLn();
#endif
m_specialpairs = (CSpecialPairMultiplier**)omAlloc0( ((NVars() * (NVars()-1)) / 2) * sizeof(CSpecialPairMultiplier*) );
for( int i = 1; i < NVars(); i++ )
for( int j = i + 1; j <= NVars(); j++ )
GetPair(i, j) = AnalyzePair(GetBasering(), i, j); // factory method!
}
CPowerMultiplier::~CPowerMultiplier()
{
#if OUTPUT
PrintS("CPowerMultiplier::~CPowerMultiplier()!");
PrintLn();
#endif
omFreeSize((ADDRESS)m_specialpairs, ((NVars() * (NVars()-1)) / 2) * sizeof(CSpecialPairMultiplier*) );
}
// Monom * Exponent
// pMonom may NOT be of the form: var(j)^{n}!
poly CPowerMultiplier::MultiplyME(const poly pMonom, const CExponent expRight)
{
const int j = expRight.Var;
const int n = expRight.Power;
const ring r = GetBasering();
#if OUTPUT
Print("CPowerMultiplier::MultiplyME(monom * var(%d)^{%d})!", j, n);
PrintLn();
PrintS("Monom: "); p_Write(pMonom, r);
#endif
assume( (j > 0) && (j <= NVars()));
if( n == 0 )
return p_Head(pMonom, r); // Copy?!?
int v = NVars();
int e = p_GetExp(pMonom, v, r);
while((v > j) && (e == 0))
e = p_GetExp(pMonom, --v, r);
// TODO: review this!
if( v == j )
{
poly p = p_Head(pMonom, r);
p_SetExp(p, v, e + n, r);
p_Setm(p, r);
return p;
}
assume( v > j );
assume( e > 0 );
// And now the General Case: v > j!
poly p = MultiplyEE( CPower(v, e), expRight ); // Easy way!
--v;
while(v > 0)
{
e = p_GetExp(pMonom, v, GetBasering());
if( e > 0 )
p = MultiplyEPDestroy(CPower(v, e), p);
--v;
}
#if OUTPUT
PrintS("CPowerMultiplier::MultiplyME() ===> ");
p_Write(p, GetBasering());
#endif
return p;
}
// Exponent * Monom
// pMonom may NOT be of the form: var(i)^{m}!
poly CPowerMultiplier::MultiplyEM(const CExponent expLeft, const poly pMonom)
{
const ring r = GetBasering();
// TODO: as above! (difference due to Left/Right semmantics!)
const int j = expLeft.Var;
const int n = expLeft.Power;
#if OUTPUT
Print("CPowerMultiplier::MultiplyEM(var(%d)^{%d} * monom)!", j, n);
PrintLn();
PrintS("Monom: "); p_Write(pMonom, r);
#endif
assume( (j > 0) && (j <= NVars()));
if( n == 0 )
return p_Head(pMonom, r); // Copy?!?
int v = 1; // NVars();
int e = p_GetExp(pMonom, v, r);
while((v < j) && (e == 0))
e = p_GetExp(pMonom, ++v, r);
if( v == j )
{
poly p = p_Head(pMonom, r);
p_SetExp(p, j, e + n, r);
p_Setm(p, r);
return p;
}
assume( v < j );
assume( e > 0 );
// And now the General Case: v > j!
poly p = MultiplyEE( expLeft, CPower(v, e) ); // Easy way!
++v;
while(v <= NVars())
{
e = p_GetExp(pMonom, v, r);
if( e > 0 )
p = MultiplyPEDestroy(p, CPower(v, e));
++v;
}
#if OUTPUT
PrintS("CPowerMultiplier::MultiplyEM() ===> ");
p_Write(p, r);
#endif
return p;
}
// Exponent * Exponent
// Computes: var(j)^{expLeft} * var(i)^{expRight}
poly CPowerMultiplier::MultiplyEE(const CExponent expLeft, const CExponent expRight)
{
#if OUTPUT
PrintS("CPowerMultiplier::MultiplyEE)!");
PrintLn();
#endif
const int i = expRight.Var, j = expLeft.Var;
const int ei = expRight.Power, ej = expLeft.Power;
#if OUTPUT
Print("Input: var(%d)^{%d} * var(%d)^{%d}", j, ej, i, ei);
PrintLn();
#endif
assume(1 <= i);
assume(j <= NVars());
assume(1 <= j);
assume(i <= NVars());
assume(ei > 0);
assume(ej > 0);
if( i >= j )
{
const ring r = GetBasering();
poly product = p_One(r);
p_SetExp(product, j, ej, r);
p_SetExp(product, i, ei, r);
p_Setm(product, r);
return product;
} else
{
assume(i < j);
// No Cache Lookup!? :(
CSpecialPairMultiplier* pSpecialMultiplier = GetPair(i, j);
// Special case?
if( pSpecialMultiplier != NULL )
{
assume( pSpecialMultiplier->GetI() == i );
assume( pSpecialMultiplier->GetJ() == j );
assume( pSpecialMultiplier->GetBasering() == GetBasering() );
return pSpecialMultiplier->MultiplyEE(ej, ei);
} else
{
// Perform general NC Multiplication:
// TODO
WerrorS("Sorry the general case is not implemented this way yet!!!");
assume(0);
// poly product = NULL;
}
}
return NULL;
}
CSpecialPairMultiplier::CSpecialPairMultiplier(ring r, int i, int j):
CMultiplier<int>(r), m_i(i), m_j(j)
{
#if OUTPUT
Print("CSpecialPairMultiplier::CSpecialPairMultiplier(ring, i: %d, j: %d)!", i, j);
PrintLn();
#endif
assume(i < j);
assume(i > 0);
assume(j <= NVars());
}
CSpecialPairMultiplier::~CSpecialPairMultiplier()
{
#if OUTPUT
PrintS("CSpecialPairMultiplier::~CSpecialPairMultiplier()!");
PrintLn();
#endif
}
// Monom * Exponent
poly CSpecialPairMultiplier::MultiplyME(const poly pMonom, const CExponent expRight)
{
#if OUTPUT
Print("CSpecialPairMultiplier::MultiplyME(monom, var(%d)^{%d})!", GetI(), expRight);
PrintLn();
PrintS("Monom: "); p_Write(pMonom, GetBasering());
#endif
return MultiplyEE(p_GetExp(pMonom, GetJ(), GetBasering()), expRight);
}
// Exponent * Monom
poly CSpecialPairMultiplier::MultiplyEM(const CExponent expLeft, const poly pMonom)
{
#if OUTPUT
Print("CSpecialPairMultiplier::MultiplyEM(var(%d)^{%d}, monom)!", GetJ(), expLeft);
PrintLn();
PrintS("Monom: "); p_Write(pMonom, GetBasering());
#endif
return MultiplyEE(expLeft, p_GetExp(pMonom, GetI(), GetBasering()));
}
template class CMultiplier<CPower>;
template class CMultiplier<int>;
template class CMultiplier<spolyrec*>;
#endif
auxiliary.h
All the auxiliary stuff.
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
N
const CanonicalForm CFMap CFMap & N
Definition cfEzgcd.cc:56
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
k
int k
Definition cfEzgcd.cc:99
p
int p
Definition cfModGcd.cc:4086
g
g
Definition cfModGcd.cc:4098
CAntiCommutativeSpecialPairMultiplier
Definition ncSAMult.h:512
CAntiCommutativeSpecialPairMultiplier::CAntiCommutativeSpecialPairMultiplier
CAntiCommutativeSpecialPairMultiplier(ring r, int i, int j)
Definition ncSAMult.cc:554
CAntiCommutativeSpecialPairMultiplier::MultiplyEE
virtual poly MultiplyEE(const int expLeft, const int expRight)
Definition ncSAMult.cc:573
CAntiCommutativeSpecialPairMultiplier::~CAntiCommutativeSpecialPairMultiplier
virtual ~CAntiCommutativeSpecialPairMultiplier()
Definition ncSAMult.cc:564
CCommutativeSpecialPairMultiplier
Definition ncSAMult.h:501
CCommutativeSpecialPairMultiplier::~CCommutativeSpecialPairMultiplier
virtual ~CCommutativeSpecialPairMultiplier()
Definition ncSAMult.cc:532
CCommutativeSpecialPairMultiplier::CCommutativeSpecialPairMultiplier
CCommutativeSpecialPairMultiplier(ring r, int i, int j)
Definition ncSAMult.cc:522
CCommutativeSpecialPairMultiplier::MultiplyEE
virtual poly MultiplyEE(const int expLeft, const int expRight)
Definition ncSAMult.cc:541
CExternalSpecialPairMultiplier
Definition ncSAMult.h:592
CExternalSpecialPairMultiplier::m_ncSAtype
Enum_ncSAType m_ncSAtype
Definition ncSAMult.h:594
CExternalSpecialPairMultiplier::MultiplyEE
virtual poly MultiplyEE(const int expLeft, const int expRight)
Definition ncSAMult.cc:757
CExternalSpecialPairMultiplier::~CExternalSpecialPairMultiplier
virtual ~CExternalSpecialPairMultiplier()
Definition ncSAMult.cc:748
CExternalSpecialPairMultiplier::CExternalSpecialPairMultiplier
CExternalSpecialPairMultiplier(ring r, int i, int j, Enum_ncSAType type)
Definition ncSAMult.cc:738
CFormulaPowerMultiplier::ncSA_1xy0x0yT2
static poly ncSA_1xy0x0yT2(const int i, const int j, const int n, const int m, const int k, const ring r)
Definition ncSAFormula.cc:735
CFormulaPowerMultiplier::ncSA_1xyAx0y0
static poly ncSA_1xyAx0y0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
Definition ncSAFormula.cc:740
CFormulaPowerMultiplier::AnalyzePair
static Enum_ncSAType AnalyzePair(const ring r, int i, int j)
Definition ncSAFormula.cc:702
CFormulaPowerMultiplier::ncSA_1xy0xBy0
static poly ncSA_1xy0xBy0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
Definition ncSAFormula.cc:745
CFormulaPowerMultiplier::ncSA_Qxy0x0y0
static poly ncSA_Qxy0x0y0(const int i, const int j, const int n, const int m, const number m_q, const ring r)
Definition ncSAFormula.cc:725
CFormulaPowerMultiplier::ncSA_1xy0x0yG
static poly ncSA_1xy0x0yG(const int i, const int j, const int n, const int m, const number m_g, const ring r)
Definition ncSAFormula.cc:730
CFormulaPowerMultiplier::ncSA_1xy0x0y0
static poly ncSA_1xy0x0y0(const int i, const int j, const int n, const int m, const ring r)
Definition ncSAFormula.cc:715
CFormulaPowerMultiplier::ncSA_Mxy0x0y0
static poly ncSA_Mxy0x0y0(const int i, const int j, const int n, const int m, const ring r)
Definition ncSAFormula.cc:720
CFormulaPowerMultiplier::Multiply
static poly Multiply(Enum_ncSAType type, const int i, const int j, const int n, const int m, const ring r)
Definition ncSAFormula.cc:696
CGlobalMultiplier
Definition ncSAMult.h:264
CGlobalMultiplier::MultiplyPEDestroy
poly MultiplyPEDestroy(poly pPoly, const CExponent expRight)
Definition ncSAMult.h:393
CGlobalMultiplier::CExponent
poly CExponent
Definition ncSAMult.h:278
CGlobalMultiplier::MultiplyEPDestroy
poly MultiplyEPDestroy(const CExponent expLeft, poly pPoly)
Definition ncSAMult.h:447
CGlobalMultiplier::MultiplyME
virtual poly MultiplyME(const poly pMonom, const CExponent expRight)
Definition ncSAMult.cc:492
CGlobalMultiplier::m_powers
CPowerMultiplier * m_powers
Definition ncSAMult.h:267
CGlobalMultiplier::MultiplyEP
poly MultiplyEP(const CExponent expLeft, const poly pPoly)
Definition ncSAMult.h:349
CGlobalMultiplier::MultiplyEE
virtual poly MultiplyEE(const CExponent expLeft, const CExponent expRight)
Definition ncSAMult.cc:323
CGlobalMultiplier::MultiplyPE
poly MultiplyPE(const poly pPoly, const CExponent expRight)
Definition ncSAMult.h:296
CGlobalMultiplier::CGlobalMultiplier
CGlobalMultiplier(ring r)
Definition ncSAMult.cc:293
CGlobalMultiplier::m_RingFormulaMultiplier
const CFormulaPowerMultiplier * m_RingFormulaMultiplier
Definition ncSAMult.h:268
CGlobalMultiplier::MultiplyEM
virtual poly MultiplyEM(const CExponent expLeft, const poly pMonom)
Definition ncSAMult.cc:505
CGlobalMultiplier::~CGlobalMultiplier
virtual ~CGlobalMultiplier()
Definition ncSAMult.cc:306
CHWeylSpecialPairMultiplier
Definition ncSAMult.h:555
CHWeylSpecialPairMultiplier::MultiplyEE
virtual poly MultiplyEE(const int expLeft, const int expRight)
Definition ncSAMult.cc:678
CHWeylSpecialPairMultiplier::CHWeylSpecialPairMultiplier
CHWeylSpecialPairMultiplier(ring r, int i, int j, int k)
Definition ncSAMult.cc:659
CHWeylSpecialPairMultiplier::m_k
const int m_k
Definition ncSAMult.h:557
CHWeylSpecialPairMultiplier::~CHWeylSpecialPairMultiplier
virtual ~CHWeylSpecialPairMultiplier()
Definition ncSAMult.cc:669
CMultiplier
Definition ncSAMult.h:26
CMultiplier< poly >::CMultiplier
CMultiplier(ring rBaseRing)
Definition ncSAMult.h:32
CMultiplier< poly >::NVars
int NVars() const
Definition ncSAMult.h:36
CMultiplier::LM
poly LM(const poly pTerm, const ring r, int i=1) const
Definition ncSAMult.h:39
CMultiplier< poly >::GetBasering
ring GetBasering() const
Definition ncSAMult.h:35
CPowerMultiplier
Definition ncSAMult.h:164
CPowerMultiplier::CExponent
CPower CExponent
Definition ncSAMult.h:194
CPowerMultiplier::~CPowerMultiplier
virtual ~CPowerMultiplier()
Definition ncSAMult.cc:847
CPowerMultiplier::MultiplyEE
virtual poly MultiplyEE(const CExponent expLeft, const CExponent expRight)
Definition ncSAMult.cc:991
CPowerMultiplier::MultiplyME
virtual poly MultiplyME(const poly pMonom, const CExponent expRight)
Definition ncSAMult.cc:860
CPowerMultiplier::MultiplyEM
virtual poly MultiplyEM(const CExponent expLeft, const poly pMonom)
Definition ncSAMult.cc:924
CPowerMultiplier::GetPair
CSpecialPairMultiplier * GetPair(int i, int j) const
Definition ncSAMult.h:173
CPowerMultiplier::MultiplyPEDestroy
poly MultiplyPEDestroy(poly pPoly, const CExponent expRight)
Definition ncSAMult.h:235
CPowerMultiplier::MultiplyEPDestroy
poly MultiplyEPDestroy(const CExponent expLeft, poly pPoly)
Definition ncSAMult.h:247
CPowerMultiplier::m_specialpairs
CSpecialPairMultiplier ** m_specialpairs
Definition ncSAMult.h:166
CPowerMultiplier::CPowerMultiplier
CPowerMultiplier(ring r)
Definition ncSAMult.cc:832
CQuasiCommutativeSpecialPairMultiplier
Definition ncSAMult.h:524
CQuasiCommutativeSpecialPairMultiplier::m_q
const number m_q
Definition ncSAMult.h:526
CQuasiCommutativeSpecialPairMultiplier::CQuasiCommutativeSpecialPairMultiplier
CQuasiCommutativeSpecialPairMultiplier(ring r, int i, int j, number q)
Definition ncSAMult.cc:586
CQuasiCommutativeSpecialPairMultiplier::~CQuasiCommutativeSpecialPairMultiplier
virtual ~CQuasiCommutativeSpecialPairMultiplier()
Definition ncSAMult.cc:598
CQuasiCommutativeSpecialPairMultiplier::MultiplyEE
virtual poly MultiplyEE(const int expLeft, const int expRight)
Definition ncSAMult.cc:607
CShiftSpecialPairMultiplier
Definition ncSAMult.h:571
CShiftSpecialPairMultiplier::CShiftSpecialPairMultiplier
CShiftSpecialPairMultiplier(ring r, int i, int j, int s, number c)
Definition ncSAMult.cc:696
CShiftSpecialPairMultiplier::m_shiftCoef
const number m_shiftCoef
Definition ncSAMult.h:573
CShiftSpecialPairMultiplier::MultiplyEE
virtual poly MultiplyEE(const int expLeft, const int expRight)
Definition ncSAMult.cc:716
CShiftSpecialPairMultiplier::~CShiftSpecialPairMultiplier
virtual ~CShiftSpecialPairMultiplier()
Definition ncSAMult.cc:707
CShiftSpecialPairMultiplier::m_shiftVar
const int m_shiftVar
Definition ncSAMult.h:574
CSpecialPairMultiplier
Definition ncSAMult.h:94
CSpecialPairMultiplier::CExponent
int CExponent
Definition ncSAMult.h:112
CSpecialPairMultiplier::CSpecialPairMultiplier
CSpecialPairMultiplier(ring r, int i, int j)
Definition ncSAMult.cc:1060
CSpecialPairMultiplier::GetI
int GetI() const
Definition ncSAMult.h:108
CSpecialPairMultiplier::GetJ
int GetJ() const
Definition ncSAMult.h:109
CSpecialPairMultiplier::MultiplyEM
virtual poly MultiplyEM(const CExponent expLeft, const poly pMonom)
Definition ncSAMult.cc:1097
CSpecialPairMultiplier::MultiplyME
virtual poly MultiplyME(const poly pMonom, const CExponent expRight)
Definition ncSAMult.cc:1085
CSpecialPairMultiplier::m_i
int m_i
Definition ncSAMult.h:96
CSpecialPairMultiplier::~CSpecialPairMultiplier
virtual ~CSpecialPairMultiplier()
Definition ncSAMult.cc:1074
CSpecialPairMultiplier::MultiplyEE
virtual poly MultiplyEE(const CExponent expLeft, const CExponent expRight)=0
CSpecialPairMultiplier::m_j
int m_j
Definition ncSAMult.h:97
CWeylSpecialPairMultiplier
Definition ncSAMult.h:540
CWeylSpecialPairMultiplier::m_g
const number m_g
Definition ncSAMult.h:542
CWeylSpecialPairMultiplier::MultiplyEE
virtual poly MultiplyEE(const int expLeft, const int expRight)
Definition ncSAMult.cc:642
CWeylSpecialPairMultiplier::CWeylSpecialPairMultiplier
CWeylSpecialPairMultiplier(ring r, int i, int j, number g)
Definition ncSAMult.cc:621
CWeylSpecialPairMultiplier::~CWeylSpecialPairMultiplier
virtual ~CWeylSpecialPairMultiplier()
Definition ncSAMult.cc:633
n_Write
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition coeffs.h:594
Print
#define Print
Definition emacs.cc:80
WarnS
#define WarnS
Definition emacs.cc:78
s
const CanonicalForm int s
Definition facAbsFact.cc:51
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
j
int j
Definition facHensel.cc:110
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
nc.h
rIsSCA
static bool rIsSCA(const ring r)
Definition nc.h:190
GetD
static poly GetD(const ring r, int i, int j)
Definition nc.h:373
GetC
static poly GetC(const ring r, int i, int j)
Definition nc.h:362
assume
#define assume(x)
Definition mod2.h:389
pNext
#define pNext(p)
Definition monomials.h:36
p_GetCoeff
#define p_GetCoeff(p, r)
Definition monomials.h:50
GetFormulaPowerMultiplier
static CFormulaPowerMultiplier * GetFormulaPowerMultiplier(const ring r)
Definition ncSAFormula.h:93
Enum_ncSAType
Enum_ncSAType
Definition ncSAFormula.h:16
_ncSA_1xy0x0yT2
@ _ncSA_1xy0x0yT2
Definition ncSAFormula.h:24
_ncSA_Mxy0x0y0
@ _ncSA_Mxy0x0y0
Definition ncSAFormula.h:19
_ncSA_1xyAx0y0
@ _ncSA_1xyAx0y0
Definition ncSAFormula.h:21
_ncSA_1xy0x0yG
@ _ncSA_1xy0x0yG
Definition ncSAFormula.h:23
_ncSA_Qxy0x0y0
@ _ncSA_Qxy0x0y0
Definition ncSAFormula.h:20
_ncSA_notImplemented
@ _ncSA_notImplemented
Definition ncSAFormula.h:17
_ncSA_1xy0x0y0
@ _ncSA_1xy0x0y0
Definition ncSAFormula.h:18
_ncSA_1xy0xBy0
@ _ncSA_1xy0xBy0
Definition ncSAFormula.h:22
AnalyzePair
CSpecialPairMultiplier * AnalyzePair(const ring r, int i, int j)
Definition ncSAMult.cc:778
ncInitSpecialPairMultiplication
BOOLEAN ncInitSpecialPairMultiplication(ring r)
Definition ncSAMult.cc:266
ncSAMult.h
numbers.h
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211
NULL
#define NULL
Definition omList.c:12
options.h
p_IsPurePower
int p_IsPurePower(const poly p, const ring r)
return i, if head depends only on var(i)
Definition p_polys.cc:1227
p_One
poly p_One(const ring r)
Definition p_polys.cc:1314
p_polys.h
__pp_Mult_nn
#define __pp_Mult_nn(p, n, r)
Definition p_polys.h:1004
p_Write
void p_Write(poly p, ring lmRing, ring tailRing)
Definition polys0.cc:342
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_Setm
static void p_Setm(poly p, const ring r)
Definition p_polys.h:235
p_Head
static poly p_Head(const poly p, const ring r)
copy the (leading) term of p
Definition p_polys.h:862
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_IsConstant
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition p_polys.h:1985
p_Delete
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903
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
PrintS
void PrintS(const char *s)
Definition reporter.cc:288
PrintLn
void PrintLn()
Definition reporter.cc:314
rWrite
void rWrite(ring r, BOOLEAN details)
Definition ring.cc:227
ring.h
p_Procs_s
struct p_Procs_s p_Procs_s
Definition ring.h:24
rIsPluralRing
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition ring.h:406
sca.h
CPower
Definition ncSAMult.h:133
CPower::Power
int Power
Definition ncSAMult.h:135
CPower::Var
int Var
Definition ncSAMult.h:134