29#define PLURAL_INTERNAL_DECLARATIONS
94 for(
REGISTER short j = iLastAltVar;
j >= iFirstAltVar;
j-- )
122 return(1 - (
tpower << 1) );
145 for(
REGISTER unsigned int j = iLastAltVar;
j >= iFirstAltVar;
j-- )
209 for(
REGISTER unsigned int j = iLastAltVar;
j >= iFirstAltVar;
j-- )
274 for(
REGISTER unsigned int j = iLastAltVar;
j >= iFirstAltVar;
j-- )
418 dReportError(
"sca_p_Mult_mm: Multiplication in the left module from the right");
498 dReportError(
"sca_pp_Mult_mm: Multiplication in the left module from the right");
608 dReportError(
"sca_pp_mm_Mult: Multiplication in the left module from the right!");
685 dReportError(
"sca_p_mm_Mult: Multiplication in the left module from the right!");
720 PrintS(
"pPoly is wrong!");
754 dReportError(
"sca_SPoly: different non-zero components!\n");
843 dReportError(
"sca_ReduceSpoly: different non-zero components!");
924#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
925 PrintS(
"sca_SetupQuotient(rGR, rG, bCopy)");
951 PrintS(
"sca_SetupQuotient: qring?\n");
958 PrintS(
"sca_SetupQuotient: qideal!!!\n");
974 PrintS(
"sca_SetupQuotient: AltVars?!\n");
977 for(
int i = 1;
i <
N;
i++)
979 for(
int j =
i + 1;
j <=
N;
j++)
983#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
984 Print(
"Nonzero D[%d, %d]\n",
i,
j);
1004#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1005 Print(
"Wrong Coeff at: [%d, %d]\n",
i,
j);
1013#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1020 if (
N>1)
return false;
1024 for(
int i = 1;
i <
N;
i++)
1026 for(
int j =
i + 1;
j <=
N;
j++)
1035#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1036 Print(
"Wrong Coeff at: [%d, %d]\n",
i,
j);
1045#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1046 Print(
"Wrong Coeff at: [%d, %d]\n",
i,
j);
1054#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1073#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1074 PrintS(
"Analyzing quotient ideal:\n");
1091#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1092 Print(
"AltVars!?: [%d, %d]\n",
b, e);
1097 if( (
i <
b) || (
i > e) )
1114#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1125#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1128 PrintS(
"tempSCAQuotient: \n");
1140 rGR->GetNC()->SCAQuotient() =
NULL;
1147#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1148 PrintS(
"SCAQuotient: \n");
1165 const int N =
rGR->N;
1183 rGR->GetNC()->SCAQuotient() =
NULL;
1185 rGR->GetNC()->SCAQuotient() =
tempQ;
1278 const unsigned int N = r->N;
1288 assume( (
unsigned int)
wx->rows() >=
N );
1289 assume( (
unsigned int)
wy->rows() >=
N );
1294 for(
int i =
N;
i > 0;
i--)
1297 x += d * (*wx)[
i-1];
1298 y += d * (*wy)[
i-1];
1346 if ( (
x !=
ddx) || (
y !=
ddy) )
return false;
1362 if (
id ==
NULL)
return true;
1366 if (
iSize == 0)
return true;
1371 for(
int i =
iSize - 1; (
i >= 0 ) &&
b;
i--)
1383 const unsigned int N = r->N;
1411 const unsigned int N = r->N;
1438 const short iFirstAltVar,
const short iLastAltVar,
1443 assume( (iFirstAltVar >= 1) && (iLastAltVar <=
rVar(r)) && (iFirstAltVar <= iLastAltVar) );
1446 PrintS(
"m_KillSquares, m = ");
1453 for(
short k = iFirstAltVar;
k <= iLastAltVar;
k++)
1464 const short iFirstAltVar,
const short iLastAltVar,
1473 PrintS(
"p_KillSquares, p = ");
1505 PrintS(
"p_KillSquares => ");
1519 const short iFirstAltVar,
const short iLastAltVar,
1522 if (
id ==
NULL)
return id;
1524 assume( (iFirstAltVar >= 1) && (iLastAltVar <=
rVar(r)) && (iFirstAltVar <= iLastAltVar) );
1528 if (
iSize == 0)
return id;
1533 PrintS(
"<id_KillSquares>\n");
1536 for (
unsigned int i = 0;
i <
IDELEMS(
id);
i++)
1538 Print(
"; id[%d] = ",
i+1);
1554 PrintS(
"<id_KillSquares>\n");
1556 PrintS(
"ideal temp: \n");
1559 Print(
"; temp[%d] = ",
i+1);
1565 PrintS(
"</id_KillSquares>\n");
static int si_max(const int a, const int b)
void * cast_A_to_vptr(A a)
static int si_min(const int a, const int b)
const CanonicalForm CFMap CFMap & N
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ,...
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.
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
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...
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
const CanonicalForm int const CFList const Variable & y
const Variable & v
< [in] a sqrfree bivariate poly
EXTERN_VAR BBA_Proc sca_mora
EXTERN_VAR BBA_Proc sca_bba
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
static bool rIsSCA(const ring r)
void nc_p_ProcsSet(ring rGR, p_Procs_s *p_Procs)
static nc_type & ncRingType(nc_struct *p)
static poly sca_mm_Mult_m(const poly pMonomMM, poly pMonomM, const ring rRing)
void sca_p_ProcsSet(ring rGR, p_Procs_s *p_Procs)
bool sca_SetupQuotient(ring rGR, ring rG, bool bCopy)
static poly m_KillSquares(const poly m, const short iFirstAltVar, const short iLastAltVar, const ring r)
static poly sca_xi_Mult_pp(short i, const poly pPoly, const ring rRing)
static void m_GetBiDegree(const poly m, const intvec *wx, const intvec *wy, const intvec *wCx, const intvec *wCy, int &dx, int &dy, const ring r)
ideal id_KillSquares(const ideal id, const short iFirstAltVar, const short iLastAltVar, const ring r, const bool bSkipZeroes)
static poly sca_xi_Mult_mm(short i, const poly pMonom, const ring rRing)
static poly sca_p_mm_Mult(poly pPoly, const poly pMonom, const ring rRing)
poly p_KillSquares(const poly p, const short iFirstAltVar, const short iLastAltVar, const ring r)
poly sca_pp_Mult_mm(const poly pPoly, const poly pMonom, const ring rRing, poly &)
bool p_IsBiHomogeneous(const poly p, const intvec *wx, const intvec *wy, const intvec *wCx, const intvec *wCy, int &dx, int &dy, const ring r)
poly sca_p_Mult_mm(poly pPoly, const poly pMonom, const ring rRing)
intvec * ivGetSCAXVarWeights(const ring r)
static int sca_Sign_mm_Mult_mm(const poly pMonomM, const poly pMonomMM, const ring rRing)
poly sca_pp_Mult_xi_pp(short i, const poly pPoly, const ring rRing)
intvec * ivGetSCAYVarWeights(const ring r)
poly sca_ReduceSpoly(const poly p1, poly p2, const ring r)
static poly sca_mm_Mult_mm(poly pMonom1, const poly pMonom2, const ring rRing)
static poly sca_m_Mult_mm(poly pMonomM, const poly pMonomMM, const ring rRing)
bool sca_Force(ring rGR, int b, int e)
poly sca_SPoly(const poly p1, const poly p2, const ring r)
bool id_IsBiHomogeneous(const ideal id, const intvec *wx, const intvec *wy, const intvec *wCx, const intvec *wCy, const ring r)
static poly sca_pp_mm_Mult(const poly pPoly, const poly pMonom, const ring rRing)
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
#define MATELEM(mat, i, j)
1-based access to matrix
int dReportError(const char *fmt,...)
#define p_SetCoeff0(p, n, r)
#define p_AllocBin(p, bin, r)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
STATIC_VAR p_Procs_s * _p_procs
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
poly p_Cleardenom(poly p, const ring r)
void p_Lcm(const poly a, const poly b, poly m, const ring r)
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
static void p_ExpVectorAdd(poly p1, poly p2, const ring r)
static poly p_LmInit(poly p, const ring 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_ExpVectorDiff(poly pr, poly p1, poly p2, const ring r)
static void p_Setm(poly p, const ring r)
static number p_SetCoeff(poly p, number n, 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 poly p_Mult_nn(poly p, number n, const ring r)
static void p_Delete(poly *p, const ring r)
static poly pp_Mult_qq(poly p, poly q, const ring r)
static poly p_LmDeleteAndNext(poly p, const ring r)
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
void PrintS(const char *s)
void Werror(const char *fmt,...)
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!
static short rVar(const ring r)
#define rVar(r) (r->N)
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
static short scaLastAltVar(ring r)
static short scaFirstAltVar(ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size