15#define SHIFT_MULT_COMPAT_MODE
17#ifdef SHIFT_MULT_DEBUG
23#ifdef SHIFT_MULT_DEBUG
34 int lV =
ri->isLPring;
36#ifdef SHIFT_MULT_COMPAT_MODE
77#ifdef SHIFT_MULT_COMPAT_MODE
81#ifdef SHIFT_MULT_DEBUG
91#ifdef SHIFT_MULT_DEBUG
100 int lV =
ri->isLPring;
102#ifdef SHIFT_MULT_COMPAT_MODE
135#ifdef SHIFT_MULT_COMPAT_MODE
138#ifdef SHIFT_MULT_DEBUG
147#ifdef SHIFT_MULT_DEBUG
158 int lV =
ri->isLPring;
160#ifdef SHIFT_MULT_COMPAT_MODE
200#ifdef SHIFT_MULT_COMPAT_MODE
204#ifdef SHIFT_MULT_DEBUG
214#ifdef SHIFT_MULT_DEBUG
223 int lV =
ri->isLPring;
225#ifdef SHIFT_MULT_COMPAT_MODE
258#ifdef SHIFT_MULT_COMPAT_MODE
261#ifdef SHIFT_MULT_DEBUG
270#ifdef SHIFT_MULT_DEBUG
280#ifdef SHIFT_MULT_DEBUG
290 WarnS(
"\n** pp_Mult_mm_Noether is not supported yet by Letterplace. Ignoring spNoether and using pp_Mult_mm. This might lead to unexpected behavior.");
315 WarnS(
"\n** pp_Mult_Coeff_mm_DivSelectMult is not supported yet by Letterplace. This might lead to unexpected behavior.");
320 WarnS(
"\n** pp_Mult_Coeff_mm_DivSelect is not supported yet by Letterplace. This might lead to unexpected behavior.");
331 int lV =
ri->isLPring;
335 if (shift == 0)
return;
366 int lV =
ri->isLPring;
444 int lV =
ri->isLPring;
447 while ( (!
expV[
j]) && (
j>=1) )
j--;
501 int lV =
ri->isLPring;
512#ifdef SHIFT_MULT_DEBUG
520 Werror(
"degree bound of Letterplace ring is %d, but at least %d is needed for this multiplication",
ri->N/
ri->isLPring,
last/
ri->isLPring);
531#ifdef SHIFT_MULT_DEBUG
540#ifdef SHIFT_MULT_DEBUG
548 Werror(
"degree bound of Letterplace ring is %d, but at least %d is needed for this multiplication",
ri->N/
ri->isLPring,
last/
ri->isLPring);
567#ifdef SHIFT_MULT_DEBUG
583 for (
int i = 0;
i <=
ri->N; ++
i)
590 if (
i %
ri->isLPring == 0 &&
i !=
ri->N)
604 int lV = r->isLPring;
613 for(
int i =
split + 1;
i <= r->N;
i++)
636 int lV = r->isLPring;
658 if (
p ==
NULL)
return 0;
661 int lV = r->isLPring;
682 for(
i = 0;
i <=
s;
i++)
713 int lV = r->isLPring;
719 int *e = (
int *)
omAlloc((r->N+1)*
sizeof(
int));
731 if (e[
i])
B[
j] =
B[
j]+1;
798#ifdef SHIFT_MULT_COMPAT_MODE
819 #ifdef SHIFT_MULT_COMPAT_MODE
826#ifdef SHIFT_MULT_COMPAT_MODE
849 for (
int i = (pos-1) * r->isLPring + 1;
i <= pos * r->isLPring;
i++) {
868 int lV = r->isLPring;
980 WerrorS(
"weights must be positive");
996 WerrorS(
"weights must be positive");
1005 WerrorS(
"ordering (a(..),lp/rp not implemented for Letterplace rings");
1008 int ** wvhdl=(
int**)
omAlloc0((r->N+3)*
sizeof(
int*));
1016 for(
int i=0;
i<r->N;
i++)
1023 for(
int j=0;
j<d;
j++)
1027 wvhdl[
i+
p][
j*r->N+
i]=1;
1029 wvhdl[
i+
p][(
j+1)*r->N-
i-1]=1;
1032 ord[r->N+
p]=r->order[
p];
1037 if (
p==1) ord[0]=r->order[0];
1038 else if (
p==0) ord[r->N+1]=r->order[1];
1041 WerrorS(
"ordering not implemented for Letterplace rings");
1048 default:
WerrorS(
"ordering not implemented for Letterplace rings");
1052 char **names=(
char**)
omAlloc(
R->N*
sizeof(
char*));
1053 for(
int b=0;
b<d;
b++)
1055 for(
int i=r->N-1;
i>=0;
i--)
static int si_max(const int a, const int b)
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 BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
static CFList split(const CanonicalForm &F, const int m, const Variable &x)
void WerrorS(const char *s)
#define pIfThen1(cond, check)
#define p_LmCheckPolyRing1(p, 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
#define omFreeSize(addr, size)
#define p_MemCopy_LengthGeneral(d, s, length)
poly p_Head0(const poly p, const ring r)
like p_Head, but allow NULL coeff
static poly p_Neg(poly p, const ring r)
static int pLength(poly a)
static poly p_Add_q(poly p, poly q, const ring r)
static poly p_Mult_q(poly p, poly q, const ring r)
static void p_LmDelete0(poly p, const ring r)
static void p_SetExpV(poly p, int *ev, const ring r)
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 unsigned long p_SetComp(poly p, unsigned long c, ring r)
static void p_Setm(poly p, const ring r)
static number p_SetCoeff(poly p, number n, ring r)
static BOOLEAN p_LmIsConstantComp(const 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 poly p_GetExp_k_n(poly p, int l, int k, const ring r)
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
static void p_Delete(poly *p, const ring r)
static void p_GetExpV(poly p, int *ev, const ring r)
static poly p_Copy(poly p, const ring r)
returns a copy of p
static long p_Totaldegree(poly p, const ring r)
void p_wrp(poly p, ring lmRing, ring tailRing)
Compatibility layer for legacy polynomial operations (over currRing)
void StringSetS(const char *st)
void StringAppendS(const char *st)
void PrintS(const char *s)
void Werror(const char *fmt,...)
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
void rDelete(ring r)
unconditionally deletes fields in r
ring rPlusVar(const ring r, char *v, int left)
K[x],"y" -> K[x,y] resp. K[y,x].
BOOLEAN _p_LPLmDivisibleByNoComp(poly a, poly b, const ring r)
void p_LPExpVprepend(int *m1ExpV, int *m2ExpV, int m1Length, int m2Length, const ring ri)
void p_LPshift(poly p, int sh, const ring ri)
BOOLEAN p_LPLmDivisibleBy(poly a, poly b, const ring r)
poly shift_pp_Mult_Coeff_mm_DivSelect_STUB(poly, const poly, int &, const ring)
int p_mFirstVblock(poly p, const ring ri)
int p_mLastVblock(poly p, const ring ri)
int id_IsInV(ideal I, const ring r)
poly shift_p_Minus_mm_Mult_qq(poly p, poly m, poly q, int &Shorter, const poly, const ring ri)
void p_mLPunshift(poly m, const ring ri)
int p_IsInV(poly p, const ring r)
BOOLEAN _p_mLPNCGenValid(poly p, const ring r)
poly shift_pp_mm_Mult(poly p, const poly m, const ring ri)
void p_LPunshift(poly p, const ring ri)
poly shift_pp_Mult_mm_Noether_STUB(poly p, const poly m, const poly, int &ll, const ring ri)
poly shift_p_mm_Mult(poly p, const poly m, const ring ri)
poly p_mLPSubst(poly m, int n, poly e, const ring r)
poly shift_p_Mult_mm(poly p, const poly m, const ring ri)
poly shift_pp_Mult_mm(poly p, const poly m, const ring ri)
BOOLEAN p_LPDivisibleBy(poly a, poly b, const ring r)
int p_GetNCGen(poly p, const ring r)
char * LPExpVString(int *expV, ring ri)
void WriteLPExpV(int *expV, ring ri)
int p_FirstVblock(poly p, const ring r)
int p_LastVblock(poly p, const ring r)
ring freeAlgebra(ring r, int d, int ncGenCount)
create the letterplace ring corresponding to r up to degree d
poly p_LPVarAt(poly p, int pos, const ring r)
void p_LPExpVappend(int *m1ExpV, int *m2ExpV, int m1Length, int m2Length, const ring ri)
int p_mIsInV(poly p, const ring r)
void k_SplitFrame(poly &m1, poly &m2, int at, const ring r)
void p_mLPshift(poly m, int sh, const ring ri)
poly shift_pp_Mult_Coeff_mm_DivSelectMult_STUB(poly, const poly, const poly, const poly, int &, const ring)
poly p_LPSubst(poly p, int n, poly e, const ring r)
static BOOLEAN freeAlgebra_weights(const ring old_ring, ring new_ring, int p, int d)
substitute weights from orderings a,wp,Wp by d copies of it at position p