Loading...
Searching...
No Matches
ncSAFormula.cc
Go to the documentation of this file.
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/***************************************************************
* File: ncSAFormula.cc
* Purpose: implementation of multiplication by formulas 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
#define PLURAL_INTERNAL_DECLARATIONS
#ifndef SING_NDEBUG
#define OUTPUT MYTEST
#else
#define OUTPUT 0
#endif
#include "reporter/reporter.h"
#include "coeffs/numbers.h"
#include "nc/ncSAFormula.h"
// for CFormulaPowerMultiplier
#include "monomials/ring.h"
#include "monomials/p_polys.h"
#include "nc/sca.h"
bool ncInitSpecialPowersMultiplication(ring r)
{
#if OUTPUT
PrintS("ncInitSpecialPowersMultiplication(ring), ring: \n");
rWrite(r, TRUE);
PrintLn();
#endif
assume(rIsPluralRing(r));
assume(!rIsSCA(r));
if( r->GetNC()->GetFormulaPowerMultiplier() != NULL )
{
WarnS("Already defined!");
return false;
}
r->GetNC()->GetFormulaPowerMultiplier() = new CFormulaPowerMultiplier(r);
return true;
}
// TODO: return q-coeff?
static inline BOOLEAN AreCommutingVariables(const ring r, int i, int j/*, number *qq*/)
{
#if OUTPUT
Print("AreCommutingVariables(ring, k: %d, i: %d)!\n", j, i);
#endif
assume(i != j);
assume(i > 0);
assume(i <= r->N);
assume(j > 0);
assume(j <= r->N);
const BOOLEAN reverse = (i > j);
if (reverse) { int k = j; j = i; i = k; }
assume(i < j);
{
const poly d = GetD(r, i, j);
#if OUTPUT
Print("D_{%d, %d} = ", i, j); p_Write(d, r);
#endif
if( d != NULL)
return FALSE;
}
{
const number q = p_GetCoeff(GetC(r, i, j), r);
if( !n_IsOne(q, r->cf) )
return FALSE;
}
return TRUE; // [VAR(I), VAR(J)] = 0!!
/*
if (reverse)
*qq = n_Invers(q, r);
else
*qq = n_Copy(q, r);
return TRUE;
*/
}
static inline Enum_ncSAType AnalyzePairType(const ring r, int i, int j)
{
#if OUTPUT
Print("AnalyzePair(ring, i: %d, j: %d):\n", i, j);
#endif
const int N = r->N;
assume(i < j);
assume(i > 0);
assume(j <= N);
const poly c = GetC(r, i, j);
const number q = pGetCoeff(c);
const poly d = GetD(r, i, j);
#if 0 && OUTPUT
Print("C_{%d, %d} = ", i, j); p_Write(c, r); PrintLn();
Print("D_{%d, %d} = ", i, j); p_Write(d, r);
#endif
// const number q = p_GetCoeff(c, r);
if( d == NULL)
{
if( n_IsOne(q, r->cf) ) // commutative
return _ncSA_1xy0x0y0;
if( n_IsMOne(q, r->cf) ) // anti-commutative
return _ncSA_Mxy0x0y0;
return _ncSA_Qxy0x0y0; // quasi-commutative
} else
{
if( n_IsOne(q, r->cf) ) // "Lie" case
{
if( pNext(d) == NULL ) // Our Main Special Case: d is only a term!
{
// const number g = p_GetCoeff(d, r); // not used for now
if( p_LmIsConstantComp(d, r) ) // Weyl
return _ncSA_1xy0x0yG;
const int k = p_IsPurePower(d, r); // k if not pure power
if( k > 0 ) // d = var(k)^??
{
const int exp = p_GetExp(d, k, r);
if (exp == 1)
{
if(k == i) // 2 -ubalgebra in var(i) & var(j), with linear relation...?
return _ncSA_1xyAx0y0;
if(k == j)
return _ncSA_1xy0xBy0;
} else if ( exp == 2 && k!= i && k != j) // Homogenized Weyl algebra [x, Dx] = t^2?
{
// number qi, qj;
if (AreCommutingVariables(r, k, i/*, &qi*/) && AreCommutingVariables(r, k, j/*, &qj*/) ) // [x, t] = [Dx, t] = 0?
{
const number g = pGetCoeff(d);
if (n_IsOne(g, r->cf))
return _ncSA_1xy0x0yT2; // save k!?, G = LC(d) == qi == qj == 1!!!
}
}
}
}
}
// Hmm, what about a more general case of q != 1???
}
#if OUTPUT
Print("C_{%d, %d} = ", i, j); p_Write(c, r);
Print("D_{%d, %d} = ", i, j); p_Write(d, r);
PrintS("====>>>>_ncSA_notImplemented\n");
#endif
return _ncSA_notImplemented;
}
CFormulaPowerMultiplier::CFormulaPowerMultiplier(ring r): m_NVars(r->N), m_BaseRing(r)
{
#if OUTPUT
PrintS("CFormulaPowerMultiplier::CFormulaPowerMultiplier(ring)!");
PrintLn();
#endif
m_SAPairTypes = (Enum_ncSAType*)omAlloc0( ((NVars() * (NVars()-1)) / 2) * sizeof(Enum_ncSAType) );
for( int i = 1; i < NVars(); i++ )
for( int j = i + 1; j <= NVars(); j++ )
GetPair(i, j) = AnalyzePairType(GetBasering(), i, j);
}
CFormulaPowerMultiplier::~CFormulaPowerMultiplier()
{
#if OUTPUT
PrintS("CFormulaPowerMultiplier::~CFormulaPowerMultiplier()!");
PrintLn();
#endif
omFreeSize((ADDRESS)m_SAPairTypes, ((NVars() * (NVars()-1)) / 2) * sizeof(Enum_ncSAType) );
}
///////////////////////////////////////////////////////////////////////////////////////////
static inline void CorrectPolyWRTOrdering(poly &pResult, const ring r)
{
if( pNext(pResult) != NULL )
{
const int cmp = p_LmCmp(pResult, pNext(pResult), r);
assume( cmp != 0 ); // must not be equal!!!
if( cmp != 1 ) // Wrong order!!!
pResult = pReverse(pResult); // Reverse!!!
}
p_Test(pResult, r);
}
///////////////////////////////////////////////////////////////////////////////////////////
static inline poly ncSA_1xy0x0y0(const int i, const int j, const int n, const int m, const ring r)
{
#if OUTPUT
Print("ncSA_1xy0x0y0(var(%d)^{%d}, var(%d)^{%d}, r)!\n", j, m, i, n);
#endif
poly p = p_One( r);
p_SetExp(p, j, m, r);
p_SetExp(p, i, n, r);
p_Setm(p, r);
p_Test(p, r);
return p;
} // return ncSA_1xy0x0y0(GetI(), GetJ(), expRight, expLeft, r);
///////////////////////////////////////////////////////////////////////////////////////////
static inline poly ncSA_Mxy0x0y0(const int i, const int j, const int n, const int m, const ring r)
{
#if OUTPUT
Print("ncSA_{M = -1}xy0x0y0(var(%d)^{%d}, var(%d)^{%d}, r)!\n", j, m, i, n);
#endif
const int sign = 1 - ((n & (m & 1)) << 1);
poly p = p_ISet(sign, r);
p_SetExp(p, j, m, r);
p_SetExp(p, i, n, r);
p_Setm(p, r);
p_Test(p, r);
return p;
} // return ncSA_Mxy0x0y0(GetI(), GetJ(), expRight, expLeft, r);
///////////////////////////////////////////////////////////////////////////////////////////
static inline poly ncSA_Qxy0x0y0(const int i, const int j, const int n, const int m, const number m_q, const ring r)
{
#if OUTPUT
Print("ncSA_Qxy0x0y0(var(%d)^{%d}, var(%d)^{%d}, Q, r)!\n", j, m, i, n);
#endif
int min, max;
if( n < m )
{
min = n;
max = m;
}
else
{
min = m;
max = n;
}
number qN;
if( max == 1 )
qN = n_Copy(m_q, r->cf);
else
{
number t;
n_Power(m_q, max, &t, r->cf);
if( min > 1 )
{
n_Power(t, min, &qN, r->cf);
n_Delete(&t, r->cf);
}
else
qN = t;
}
poly p = p_NSet(qN, r);
p_SetExp(p, j, m, r);
p_SetExp(p, i, n, r);
p_Setm(p, r);
p_Test(p, r);
return p;
} // return ncSA_Qxy0x0y0(GetI(), GetJ(), expRight, expLeft, m_q, r);
///////////////////////////////////////////////////////////////////////////////////////////
static inline poly ncSA_1xy0x0yG(const int i, const int j, const int n, const int m, const number m_g, const ring r)
{
#if OUTPUT
Print("ncSA_1xy0x0yG(var(%d)^{%d}, var(%d)^{%d}, G, r)!\n", j, m, i, n);
number t = n_Copy(m_g, r->cf);
PrintS("Parameter G: "); n_Write(t, r->cf);
n_Delete(&t, r->cf);
#endif
int kn = n;
int km = m;
number c = n_Init(1, r->cf);
poly p = p_One( r);
p_SetExp(p, j, km--, r); // y ^ (m-k)
p_SetExp(p, i, kn--, r); // x ^ (n-k)
p_Setm(p, r); // pResult = x^n * y^m
poly pResult = p;
poly pLast = p;
int min = si_min(m, n);
int k = 1;
for(; k < min; k++ )
{
number t = n_Init(km + 1, r->cf);
n_InpMult(t, m_g, r->cf); // t = ((m - k) + 1) * gamma
n_InpMult(c, t, r->cf); // c = c'* ((m - k) + 1) * gamma
n_Delete(&t, r->cf);
t = n_Init(kn + 1, r->cf);
n_InpMult(c, t, r->cf); // c = (c'* ((m - k) + 1) * gamma) * ((n - k) + 1)
n_Delete(&t, r->cf);
t = n_Init(k, r->cf);
c = n_Div(c, t, r->cf);
n_Delete(&t, r->cf);
// n_Normalize(c, r->cf);
t = n_Copy(c, r->cf); // not the last!
p = p_NSet(t, r);
p_SetExp(p, j, km--, r); // y ^ (m-k)
p_SetExp(p, i, kn--, r); // x ^ (n-k)
p_Setm(p, r); // pResult = x^n * y^m
pNext(pLast) = p;
pLast = p;
}
assume(k == min);
assume((km == 0) || (kn == 0) );
{
n_InpMult(c, m_g, r->cf); // c = c'* gamma
if( km > 0 )
{
number t = n_Init(km + 1, r->cf);
n_InpMult(c, t, r->cf); // c = (c'* gamma) * (m - k + 1)
n_Delete(&t, r->cf);
}
if( kn > 0 )
{
number t = n_Init(kn + 1, r->cf);
n_InpMult(c, t, r->cf); // c = (c'* gamma) * (n - k + 1)
n_Delete(&t, r->cf);
}
number t = n_Init(k, r->cf); // c = ((c'* gamma) * ((n - k + 1) * (m - k + 1))) / k;
c = n_Div(c, t, r->cf);
n_Delete(&t, r->cf);
}
p = p_NSet(c, r);
p_SetExp(p, j, km, r); // y ^ (m-k)
p_SetExp(p, i, kn, r); // x ^ (n-k)
p_Setm(p, r); //
pNext(pLast) = p;
CorrectPolyWRTOrdering(pResult, r);
return pResult;
}
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
static inline poly ncSA_1xy0x0yT2(const int i, const int j, const int n, const int m, const int m_k, const ring r)
{
#if OUTPUT
Print("ncSA_1xy0x0yT2(var(%d)^{%d}, var(%d)^{%d}, t: var(%d), r)!\n", j, m, i, n, m_k);
#endif
int kn = n;
int km = m;
// k == 0!
number c = n_Init(1, r->cf);
poly p = p_One( r );
p_SetExp(p, j, km--, r); // y ^ (m)
p_SetExp(p, i, kn--, r); // x ^ (n)
// p_SetExp(p, m_k, k << 1, r); // homogenization with var(m_k) ^ (2*k)
p_Setm(p, r); // pResult = x^n * y^m
poly pResult = p;
poly pLast = p;
int min = si_min(m, n);
int k = 1;
for(; k < min; k++ )
{
number t = n_Init(km + 1, r->cf);
// n_InpMult(t, m_g, r->cf); // t = ((m - k) + 1) * gamma
n_InpMult(c, t, r->cf); // c = c'* ((m - k) + 1) * gamma
n_Delete(&t, r->cf);
t = n_Init(kn + 1, r->cf);
n_InpMult(c, t, r->cf); // c = (c'* ((m - k) + 1) * gamma) * ((n - k) + 1)
n_Delete(&t, r->cf);
t = n_Init(k, r->cf);
c = n_Div(c, t, r->cf);
n_Delete(&t, r->cf);
// // n_Normalize(c, r);
t = n_Copy(c, r->cf); // not the last!
p = p_NSet(t, r);
p_SetExp(p, j, km--, r); // y ^ (m-k)
p_SetExp(p, i, kn--, r); // x ^ (n-k)
p_SetExp(p, m_k, k << 1, r); // homogenization with var(m_k) ^ (2*k)
p_Setm(p, r); // pResult = x^(n-k) * y^(m-k)
pNext(pLast) = p;
pLast = p;
}
assume(k == min);
assume((km == 0) || (kn == 0) );
{
// n_InpMult(c, m_g, r); // c = c'* gamma
if( km > 0 )
{
number t = n_Init(km + 1, r->cf);
n_InpMult(c, t, r->cf); // c = (c'* gamma) * (m - k + 1)
n_Delete(&t, r->cf);
}
if( kn > 0 )
{
number t = n_Init(kn + 1, r->cf);
n_InpMult(c, t, r->cf); // c = (c'* gamma) * (n - k + 1)
n_Delete(&t, r->cf);
}
number t = n_Init(k, r->cf); // c = ((c'* gamma) * ((n - k + 1) * (m - k + 1))) / k;
c = n_Div(c, t, r->cf);
n_Delete(&t, r->cf);
}
p = p_NSet(c, r);
p_SetExp(p, j, km, r); // y ^ (m-k)
p_SetExp(p, i, kn, r); // x ^ (n-k)
p_SetExp(p, m_k, k << 1, r); // homogenization with var(m_k) ^ (2*k)
p_Setm(p, r); //
pNext(pLast) = p;
CorrectPolyWRTOrdering(pResult, r);
return pResult;
}
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
static inline poly ncSA_ShiftAx(int i, int j, int n, int m, const number m_shiftCoef, const ring r)
{
// Char == 0, otherwise - problem!
int k = m; // to 0
number c = n_Init(1, r->cf); // k = m, C_k = 1
poly p = p_One( r);
p_SetExp(p, j, k, r); // Y^{k}
p_SetExp(p, i, n, r);
p_Setm(p, r); // pResult = C_k * x^n * y^k, k == m
poly pResult = p;
poly pLast = p;
number nn = n_Init(n, r->cf); // number(n)!
n_InpMult(nn, m_shiftCoef, r->cf); // nn = (alpha*n)
--k;
int mk = 1; // mk = (m - k)
for(; k > 0; k-- )
{
number t = n_Init(k + 1, r->cf); // t = k+1
n_InpMult(c, t, r->cf); // c = c' * (k+1)
n_InpMult(c, nn, r->cf); // c = (c' * (k+1)) * (alpha * n)
n_Delete(&t, r->cf);
t = n_Init(mk++, r->cf);
c = n_Div(c, t, r->cf); // c = ((c' * (k+1)) * (alpha * n)) / (m-k);
n_Delete(&t, r->cf);
// n_Normalize(c, r->cf);
t = n_Copy(c, r->cf); // not the last!
p = p_NSet(t, r);
p_SetExp(p, j, k, r); // y^k
p_SetExp(p, i, n, r); // x^n
p_Setm(p, r); // pResult = x^n * y^m
pNext(pLast) = p;
pLast = p;
}
assume(k == 0);
{
n_InpMult(c, nn, r->cf); // c = (c' * (0+1)) * (alpha * n)
number t = n_Init(m, r->cf);
c = n_Div(c, t, r->cf); // c = ((c' * (0+1)) * (alpha * n)) / (m-0);
n_Delete(&t, r->cf);
}
n_Delete(&nn, r->cf);
p = p_NSet(c, r);
p_SetExp(p, j, k, r); // y^k
p_SetExp(p, i, n, r); // x^n
p_Setm(p, r); //
pNext(pLast) = p;
CorrectPolyWRTOrdering(pResult, r);
return pResult;
}
///////////////////////////////////////////////////////////////////////////////////////////
static inline poly ncSA_1xyAx0y0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
{
#if OUTPUT
Print("ncSA_1xyAx0y0(var(%d)^{%d}, var(%d)^{%d}, A, r)!\n", j, m, i, n);
number t = n_Copy(m_shiftCoef, r);
PrintS("Parameter A: "); n_Write(t, r);
n_Delete(&t, r);
#endif
return ncSA_ShiftAx(i, j, n, m, m_shiftCoef, r);
}
///////////////////////////////////////////////////////////////////////////////////////////
static inline poly ncSA_1xy0xBy0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
{
#if OUTPUT
Print("ncSA_1xy0xBy0(var(%d)^{%d}, var(%d)^{%d}, B, r)!\n", j, m, i, n);
number t = n_Copy(m_shiftCoef, r);
PrintS("Parameter B: "); n_Write(t, r);
n_Delete(&t, r);
#endif
return ncSA_ShiftAx(j, i, m, n, m_shiftCoef, r);
}
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
static inline poly ncSA_Multiply( Enum_ncSAType type, const int i, const int j, const int n, const int m, const ring r)
{
#if OUTPUT
Print("ncSA_Multiply(type: %d, ring, (var(%d)^{%d} * var(%d)^{%d}, r)!\n", (int)type, j, m, i, n);
#endif
assume( type != _ncSA_notImplemented );
assume( (n > 0) && (m > 0) );
if( type == _ncSA_1xy0x0y0 )
return ::ncSA_1xy0x0y0(i, j, n, m, r);
if( type == _ncSA_Mxy0x0y0 )
return ::ncSA_Mxy0x0y0(i, j, n, m, r);
if( type == _ncSA_Qxy0x0y0 )
{
const number q = p_GetCoeff(GetC(r, i, j), r);
return ::ncSA_Qxy0x0y0(i, j, n, m, q, r);
}
const poly d = GetD(r, i, j);
const number g = p_GetCoeff(d, r);
if( type == _ncSA_1xy0x0yG ) // Weyl
return ::ncSA_1xy0x0yG(i, j, n, m, g, r);
if( type == _ncSA_1xy0x0yT2 ) // Homogeneous Weyl...
return ::ncSA_1xy0x0yT2(i, j, n, m, p_IsPurePower(d, r), r);
if( type == _ncSA_1xyAx0y0 ) // Shift 1
return ::ncSA_1xyAx0y0(i, j, n, m, g, r);
if( type == _ncSA_1xy0xBy0 ) // Shift 2
return ::ncSA_1xy0xBy0(i, j, n, m, g, r);
assume( type == _ncSA_notImplemented );
return NULL;
}
poly CFormulaPowerMultiplier::Multiply( Enum_ncSAType type, const int i, const int j, const int n, const int m, const ring r)
{
return ncSA_Multiply( type, i, j, n, m, r);
}
Enum_ncSAType CFormulaPowerMultiplier::AnalyzePair(const ring r, int i, int j)
{
return ::AnalyzePairType( r, i, j);
}
poly CFormulaPowerMultiplier::Multiply( int i, int j, const int n, const int m)
{
return ncSA_Multiply( GetPair(i, j), i, j, n, m, GetBasering());
}
poly CFormulaPowerMultiplier::ncSA_1xy0x0y0(const int i, const int j, const int n, const int m, const ring r)
{
return ::ncSA_1xy0x0y0(i, j, n, m, r);
}
poly CFormulaPowerMultiplier::ncSA_Mxy0x0y0(const int i, const int j, const int n, const int m, const ring r)
{
return ::ncSA_Mxy0x0y0(i, j, n, m, r);
}
poly CFormulaPowerMultiplier::ncSA_Qxy0x0y0(const int i, const int j, const int n, const int m, const number m_q, const ring r)
{
return ::ncSA_Qxy0x0y0(i, j, n, m, m_q, r);
}
poly CFormulaPowerMultiplier::ncSA_1xy0x0yG(const int i, const int j, const int n, const int m, const number m_g, const ring r)
{
return ::ncSA_1xy0x0yG(i, j, n, m, m_g, r);
}
poly CFormulaPowerMultiplier::ncSA_1xy0x0yT2(const int i, const int j, const int n, const int m, const int k, const ring r)
{
return ::ncSA_1xy0x0yT2(i, j, n, m, k, r);
}
poly CFormulaPowerMultiplier::ncSA_1xyAx0y0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
{
return ::ncSA_1xyAx0y0(i, j, n, m, m_shiftCoef, r);
}
poly CFormulaPowerMultiplier::ncSA_1xy0xBy0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
{
return ::ncSA_1xy0xBy0(i, j, n, m, m_shiftCoef, r);
}
#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
si_min
static int si_min(const int a, const int b)
Definition auxiliary.h:126
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
CFormulaPowerMultiplier
Definition ncSAFormula.h:28
CFormulaPowerMultiplier::NVars
int NVars() const
Definition ncSAFormula.h:38
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::m_BaseRing
const ring m_BaseRing
Definition ncSAFormula.h:33
CFormulaPowerMultiplier::~CFormulaPowerMultiplier
virtual ~CFormulaPowerMultiplier()
Definition ncSAFormula.cc:233
CFormulaPowerMultiplier::m_NVars
const int m_NVars
Definition ncSAFormula.h:32
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::GetBasering
ring GetBasering() const
Definition ncSAFormula.h:39
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::m_SAPairTypes
Enum_ncSAType * m_SAPairTypes
Definition ncSAFormula.h:30
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::CFormulaPowerMultiplier
CFormulaPowerMultiplier()
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::GetPair
Enum_ncSAType GetPair(int i, int j) const
Definition ncSAFormula.h:44
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
n_Copy
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition coeffs.h:457
n_IsMOne
static FORCE_INLINE BOOLEAN n_IsMOne(number n, const coeffs r)
TRUE iff 'n' represents the additive inverse of the one element, i.e. -1.
Definition coeffs.h:478
n_Power
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
Definition coeffs.h:635
n_Div
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
Definition coeffs.h:618
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:461
n_Write
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition coeffs.h:594
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition coeffs.h:541
n_InpMult
static FORCE_INLINE void n_InpMult(number &a, number b, const coeffs r)
multiplication of 'a' and 'b'; replacement of 'a' by the product a*b
Definition coeffs.h:644
n_IsOne
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition coeffs.h:474
Print
#define Print
Definition emacs.cc:80
WarnS
#define WarnS
Definition emacs.cc:78
j
int j
Definition facHensel.cc:110
reverse
CanonicalForm reverse(const CanonicalForm &F, int d)
Definition facMul.cc:3240
min
static int min(int a, int b)
Definition fast_mult.cc:268
max
static int max(int a, int b)
Definition fast_mult.cc:264
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
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
exp
gmp_float exp(const gmp_float &a)
Definition mpr_complex.cc:349
ncSA_Mxy0x0y0
static poly ncSA_Mxy0x0y0(const int i, const int j, const int n, const int m, const ring r)
Definition ncSAFormula.cc:276
ncSA_Multiply
static poly ncSA_Multiply(Enum_ncSAType type, const int i, const int j, const int n, const int m, const ring r)
Definition ncSAFormula.cc:654
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:637
ncSA_1xy0x0yT2
static poly ncSA_1xy0x0yT2(const int i, const int j, const int n, const int m, const int m_k, const ring r)
Definition ncSAFormula.cc:443
CorrectPolyWRTOrdering
static void CorrectPolyWRTOrdering(poly &pResult, const ring r)
Definition ncSAFormula.cc:247
ncInitSpecialPowersMultiplication
bool ncInitSpecialPowersMultiplication(ring r)
Definition ncSAFormula.cc:50
ncSA_1xy0x0y0
static poly ncSA_1xy0x0y0(const int i, const int j, const int n, const int m, const ring r)
Definition ncSAFormula.cc:259
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:625
ncSA_ShiftAx
static poly ncSA_ShiftAx(int i, int j, int n, int m, const number m_shiftCoef, const ring r)
Definition ncSAFormula.cc:548
AnalyzePairType
static Enum_ncSAType AnalyzePairType(const ring r, int i, int j)
Definition ncSAFormula.cc:133
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:295
AreCommutingVariables
static BOOLEAN AreCommutingVariables(const ring r, int i, int j)
Definition ncSAFormula.cc:82
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:344
ncSAFormula.h
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
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
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_ISet
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition p_polys.cc:1298
p_One
poly p_One(const ring r)
Definition p_polys.cc:1314
p_NSet
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition p_polys.cc:1474
p_polys.h
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
pReverse
static poly pReverse(poly p)
Definition p_polys.h:337
p_LmIsConstantComp
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
Definition p_polys.h:1008
p_LmCmp
static int p_LmCmp(poly p, poly q, const ring r)
Definition p_polys.h:1601
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_Test
#define p_Test(p, r)
Definition p_polys.h:161
pLast
static poly pLast(poly a, int &length)
returns the length of a polynomial (numbers of monomials) respect syzComp
Definition polys.h:406
PrintS
void PrintS(const char *s)
Definition reporter.cc:288
PrintLn
void PrintLn()
Definition reporter.cc:314
reporter.h
rWrite
void rWrite(ring r, BOOLEAN details)
Definition ring.cc:227
sign
static int sign(int x)
Definition ring.cc:3504
ring.h
rIsPluralRing
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition ring.h:406
sca.h