32static poly
mp_Exdiv ( poly
m, poly d, poly vars,
const ring);
33static poly
mp_Select (poly fro, poly what,
const ring);
34static poly
mp_SelectId (ideal I, poly what,
const ring
R);
45 size_t s=((size_t)r)*((size_t)c)*
sizeof(poly);
64 for (
long i=(
long)
m*(
long)n-1;
i>=0;
i--)
87 for (
i=
m*n-1;
i>=0;
i--)
109 int i=
si_min(r,c), n = c*(
i-1)+
i-1, inc = c+1;
134 for (
k=
m*n-1;
k>0;
k--)
146 for (
k=
m*n-1;
k>0;
k--)
163 for (
k=
m*n-1;
k>0;
k--)
175 if ((n !=
b->nrows) || (
m !=
b->ncols))
184 for (
k=
m*n-1;
k>=0;
k--)
192 if ((n !=
b->nrows) || (
m !=
b->ncols))
201 for (
k=
m*n-1;
k>=0;
k--)
554static poly
mp_Exdiv ( poly
m, poly d, poly vars,
const ring
R)
688 if (p1==
NULL)
return p2;
689 if (p2==
NULL)
return p1;
802 for (
i=lr-1;
i>=0;
i--)
833 for (
i=0;
i<=ii;
i++)
835 for (
j=0;
j<=jj;
j++)
838 Print(
"%-*.*s",spaces,spaces,
" ");
840 else if (
dim == 1)
Print(
"%s[%u]=",n,
j+1);
869 s[strlen(
s)- (
dim > 1 ? 2 : 1)]=
'\0';
1056 for (
j=
a_n-1;
j>= 0;
j--)
1106 while (
qcol[j2] !=
j) j2++;
1127 while (
qrow[i2] !=
i) i2++;
1155 int i,
j, iopt, jopt;
1156 float sum, f1, f2, fo, r, ro, lp;
1157 float *dr = C->
wrow, *dc = C->
wcol;
1206 f1 = ro * (dc[
j]-lp);
1209 f2 = lp * (sum - ro - dc[
j]);
1239 poly piv, elim, q1, q2, *
ap, *a;
1265 else if (a[jj] !=
NULL)
1303 for (
i=r->N;
i>0;
i--)
1335 for (
i=lr-1;
i>=0;
i--)
1344 if ((f2!=0.0) && (f2<f1))
1359 poly* a1 = &a2[a->
ncols*(pos-1)];
1361 a2 = &a2[a->
ncols*(lr-1)];
1362 for (
j=
lc-1;
j>=0;
j--)
1395 q1 = &(a->
m)[(lr-1)*a->
ncols];
1396 for (
j=
lc-1;
j>=0;
j--)
1417 poly* a1 = &a2[pos-1];
1445 poly *
b = a0->
m, *
x = re->
m;
1446 poly piv, elim, q1, *
ap, *a, *q;
1451 for(
j=c-1;
j>=0;
j--)
1453 for(
i=r-1;
i>=0;
i--)
1460 for (
j=c-1;
j>=0;
j--)
1484 for (
j=c-1;
j>=0;
j--)
1501 ideal
R,
const ring)
1509 for (
i=r-1;
i>=0;
i--)
1518 for (
i=r-1;
i>=0;
i--)
1597 poly barDiv, ideal
R,
const ring r)
1600 int kr=lr-1,kc=
lc-1;
1747 int *rowchoise,*colchoise;
1756 rowchoise=(
int *)
omAlloc(ar*
sizeof(
int));
1757 colchoise=(
int *)
omAlloc(ar*
sizeof(
int));
1768 for (
i=1;
i<=ar;
i++)
1770 for (
j=1;
j<=ar;
j++)
1786 for (
i=1;
i<=ar;
i++)
1801 for(
int j=0;
j<q;
j++)
1832 poly *a=(poly*)
omAlloc(
m*
sizeof(poly));
1833 for(
int i=0;
i<n;
i++)
1835 memset(a,0,
m*
sizeof(poly));
1837 for(
int j=0;
j<
m;
j++)
1928 if (
i==0)
res->m[0]=
p;
1942 ||((a->rank % col)!=0))
1944 Werror(
"wrong format: %d x %d for unflatten",(
int)a->rank,
IDELEMS(a));
1947 int row=a->rank/col;
1955 int r=
comp%row;
if (r==0) r=row;
1972 for (
i=0;
i<=n;
i++)
1981 if ((a->rank)<(
b->rank))
return -1;
1982 else if ((a->rank)<(
b->rank))
return 1;
2044 for (
int i = n-1;
i >= 0;
i--)
2052 for (
int i = n-1;
i >=0;
i--)
2054 for (
int j =
i+1;
j < n;
j++)
2082 for (
int i = n-1;
i >0;
i--)
2129 if (strcmp(
s,
"Mu")==0)
return DetMu;
2131 WarnS(
"unknown method for det");
2155 WerrorS(
"unknown algorithm for det");
static int si_max(const int a, const int b)
static int si_min(const int a, const int b)
poly singclap_det(const matrix m, const ring s)
int mpPivotRow(row_col_weight *, int)
void mpSetElem(poly, int, int)
int mpPivotBareiss(row_col_weight *)
void mpColWeight(float *)
void mpToIntvec(intvec *)
void mpRowWeight(float *)
static FORCE_INLINE int n_Size(number n, const coeffs r)
return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used fo...
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
for(j=0;j< factors.length();j++)
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
void WerrorS(const char *s)
void idGetNextChoise(int r, int end, BOOLEAN *endch, int *choise)
ideal id_Copy(ideal h1, const ring r)
copy an ideal
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
void idInitChoise(int r, int beg, int end, BOOLEAN *endch, int *choise)
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
matrix mp_Wedge(matrix a, int ar, const ring R)
static poly mp_SelectId(ideal I, poly what, const ring R)
static void mp_PartClean(matrix a, int lr, int lc, const ring R)
matrix mp_Transp(matrix a, const ring R)
ideal sm_Tensor(ideal A, ideal B, const ring r)
static ideal sm_MultAndShift(poly f, ideal B, int s, const ring r)
ideal sm_UnFlatten(ideal a, int col, const ring R)
int sm_Compare(ideal a, ideal b, const ring R)
ideal sm_Add(ideal a, ideal b, const ring R)
static poly mp_Exdiv(poly m, poly d, poly vars, const ring)
poly sm_Trace(ideal a, const ring R)
matrix mp_CoeffProc(poly f, poly vars, const ring R)
matrix pMultMp(poly p, matrix a, const ring R)
void mp_Delete(matrix *a, const ring r)
void mp_Monomials(matrix c, int r, int var, matrix m, const ring R)
static matrix mu(matrix A, const ring R)
DetVariant mp_GetAlgorithmDet(matrix m, const ring r)
static float mp_PolyWeight(poly p, const ring r)
static int mp_PivRow(matrix a, int lr, int lc, const ring r)
matrix mp_InitI(int r, int c, int v, const ring R)
make it a v * unit matrix
static void mpSwapCol(matrix a, int pos, int lr, int lc)
matrix mp_CoeffProcId(ideal I, poly vars, const ring R)
poly sm_Det(ideal a, const ring r, DetVariant d)
static poly p_Insert(poly p1, poly p2, const ring R)
static int mp_PrepareRow(matrix a, int lr, int lc, const ring R)
matrix mp_MultI(matrix a, long f, const ring R)
c = f*a
ideal sm_Sub(ideal a, ideal b, const ring R)
ideal sm_Mult(ideal a, ideal b, const ring R)
static void mpFinalClean(matrix a)
matrix mp_Sub(matrix a, matrix b, const ring R)
poly mp_Det(matrix a, const ring r, DetVariant d)
matrix mpNew(int r, int c)
create a r x c zero-matrix
int mp_Compare(matrix a, matrix b, const ring R)
poly TraceOfProd(matrix a, matrix b, int n, const ring R)
BOOLEAN sm_Equal(ideal a, ideal b, const ring R)
static void mp_ElimBar(matrix a0, matrix re, poly div, int lr, int lc, const ring R)
static void mpReplace(int j, int n, int &sign, int *perm)
matrix mp_Mult(matrix a, matrix b, const ring R)
BOOLEAN mp_Equal(matrix a, matrix b, const ring R)
matrix mp_Coeffs(ideal I, int var, const ring R)
corresponds to Maple's coeffs: var has to be the number of a variable
void mp_Coef2(poly v, poly mon, matrix *c, matrix *m, const ring R)
corresponds to Macauley's coef: the exponent vector of vars has to contain the variables,...
matrix mp_MultP(matrix a, poly p, const ring R)
multiply a matrix 'a' by a poly 'p', destroy the args
char * iiStringMatrix(matrix im, int dim, const ring r, char ch)
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
matrix mp_Add(matrix a, matrix b, const ring R)
matrix mp_InitP(int r, int c, poly p, const ring R)
make it a p * unit matrix
static poly mp_Select(poly fro, poly what, const ring)
static int mp_PreparePiv(matrix a, int lr, int lc, const ring r)
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
poly mp_DetMu(matrix A, const ring R)
static void sm_AddSubMat(ideal res, ideal sm, int col, const ring r)
void mp_MinorToResult(ideal result, int &elems, matrix a, int r, int c, ideal R, const ring)
entries of a are minors and go to result (only if not in R)
ideal sm_Flatten(ideal a, const ring R)
void mp_RecMin(int ar, ideal result, int &elems, matrix a, int lr, int lc, poly barDiv, ideal R, const ring r)
produces recursively the ideal of all arxar-minors of a
static int mp_PivBar(matrix a, int lr, int lc, const ring r)
static void mpSwapRow(matrix a, int pos, int lr, int lc)
poly mp_DetBareiss(matrix a, const ring r)
returns the determinant of the matrix m; uses Bareiss algorithm
poly mp_Trace(matrix a, const ring R)
#define MATELEM(mat, i, j)
1-based access to matrix
#define MATELEM0(mat, i, j)
0-based access to matrix
#define SMATELEM(A, i, j, R)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
#define __p_GetComp(p, r)
#define omFreeSize(addr, size)
#define omFreeBin(addr, bin)
#define omfreeSize(addr, size)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
void p_Vec2Polys(poly v, poly **p, int *len, const ring r)
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
void p_Normalize(poly p, const ring r)
int p_Compare(const poly a, const poly b, const ring R)
poly p_Sub(poly p1, poly p2, const ring r)
void pEnlargeSet(poly **p, int l, int increment)
void p_Vec2Array(poly v, poly *p, int len, const ring r)
vector to already allocated array (len>=p_MaxComp(v,r))
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
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 void p_LmDelete(poly p, const ring r)
static poly p_Mult_q(poly p, poly q, const ring r)
static int p_Cmp(poly p1, poly p2, ring r)
void p_String0(poly p, ring lmRing, ring tailRing)
print p according to ShortOut in lmRing & tailRing
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 unsigned long p_SetComp(poly p, unsigned long c, ring r)
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)
void p_Write0(poly p, ring lmRing, ring tailRing)
static poly pp_Mult_qq(poly p, poly q, const ring r)
static BOOLEAN p_IsUnit(const poly p, const ring r)
static poly p_Copy(poly p, const ring r)
returns a copy of p
poly prCopyR_NoSort(poly p, ring src_r, ring dest_r)
void StringSetS(const char *st)
void StringAppendS(const char *st)
void Werror(const char *fmt,...)
static BOOLEAN rField_is_Zp(const ring r)
static BOOLEAN rField_is_Q(const ring r)
static short rVar(const ring r)
#define rVar(r) (r->N)
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
int status int void size_t count
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
matrix id_Module2Matrix(ideal mod, const ring R)
ideal id_Matrix2Module(matrix mat, const ring R)
converts mat to module, destroys mat
poly sm_MultDiv(poly a, poly b, const poly c, const ring R)
poly sm_CallDet(ideal I, const ring R)
void sm_SpecialPolyDiv(poly a, poly b, const ring R)