66 if ((f2!=0.0) && (f2<f1))
87 q1 = &(a->
m)[(lr-1)*a->
ncols];
115 for (i=
rVar(R);i>0;i--)
144 a2 = &a2[a->
ncols*(lr-1)];
145 for (j=lc-1; j>=0; j--)
158 poly* a1 = &a2[pos-1];
263 if ((k > 0) && (k <= n))
277 for (i=k+1; i<=
n; i++)
291 for (j=i-1; j>=1; j--)
299 c =
n_Div(ONE, d, R);
309 for (i=1; i<=n-1; i++)
392 for (i=
a_m-1; i>=0; i--)
396 for (j=
a_n-1; j>=0; j--)
417 for (k=
a_m*
a_n-1; k>=0; k--)
454 poly piv, elim, q1, q2, *ap, *
a;
459 for(i=
s_m-1; i>=0; i--)
466 for (j=
s_n-1; j>=0; j--)
480 else if (a[jj] !=
NULL)
484 if ((q2!=
NULL) && div)
492 for (j=
s_n-1; j>=0; j--)
514 int i,
j, iopt, jopt;
515 float sum, f1, f2, fo,
r, ro, lp;
528 for(i=
s_m; i>=0; i--)
552 for(i=
s_m; i>=0; i--)
554 for(i=
s_m; i>=0; i--)
558 for(j=
s_n; j>=0; j--)
565 f1 = ro * (dc[
j]-lp);
568 f2 = lp * (sum - ro - dc[
j]);
596 float sum, f1, f2, fo,
r, ro, lp;
630 for(j=
s_m; j>=0; j--)
634 for(j=
s_n; j>=0; j--)
641 f1 = ro * (dc[
j]-lp);
644 f2 = lp * (sum - ro - dc[
j]);
668 for (i=v->
rows()-1; i>=0; i--)
680 for (i=
a_m-1; i>=
k; i--)
687 while (
qrow[i2] != i) i2++;
701 for (j=
a_n-1; j>=
k; j--)
708 while (
qcol[j2] != j) j2++;
724 for (k=
a_m-1; k>=0; k--)
qrow[k] = k;
725 for (k=
a_n-1; k>=0; k--)
qcol[k] = k;
744 for (i=
s_m; i>=0; i--)
748 for(j=
s_n; j>=0; j--)
764 for (j=
s_n; j>=0; j--)
768 for(i=
s_m; i>=0; i--)
785 for (j=
a_n-1; j>= 0; j--)
800 for (i=0; i<
k; i+=
a_n)
841 while ((s > 0) && ((*z)[s] >= (*z)[s+1]));
852 while (((*z)[k] != (*z)[s]) && (k!=s));
855 for (i=s+1; i <=
max; i++)
866 while (((*z)[k] != (*z)[i]) && (k != i));
875 while ((s > 0) && ((*z)[s] > (*z)[s+1]));
877 for (i=1; i<
max; i++)
878 for (k=i+1; k<=
max; k++)
879 if ((*z)[k] < (*z)[i])
892 memset(&z,0,(n+2)*
sizeof(
int));
894 for (i=1; i <=
n; i++)
897 for (i=1; i<=
n; i++)
907 for (i = 1; i <=
n; i++)
922 poly piv, elim, q1, q2, *ap, *
a, *q;
925 ap = &b[r*a0->
ncols];
927 for(j=c-1; j>=0; j--)
929 for(i=r-1; i>=0; i--)
936 for (j=c-1; j>=0; j--)
941 q1 =
SM_MULT(a[j], piv, div, R);
944 q2 =
SM_MULT(ap[j], elim, div, R);
948 else if (ap[j] !=
NULL)
949 q1 =
SM_MULT(ap[j], elim, div, R);
960 for (j=c-1; j>=0; j--)
964 q1 =
SM_MULT(a[j], piv, div, R);
int status int void size_t count
static void mp_PartClean(matrix, int, int, const ring)
const CanonicalForm int s
static int mpNextperm(perm *z, int max)
static void mp_SwapCol(matrix, int, int, int, const ring)
static void mp_SwapRow(matrix, int, int, int, const ring)
poly mp_Det(matrix m, const ring R)
poly mp_Trace(matrix a, const ring R)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
#define omFreeSize(addr, size)
const CanonicalForm CFMap CFMap int &both_non_zero int n
static short rVar(const ring r)
#define rVar(r) (r->N)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
static int mp_PivRow(matrix, int, int, const ring)
void mpColWeight(float *)
void mpRowWeight(float *)
static void mpSwapRow(matrix a, int pos, int lr, int lc)
void mpSetElem(poly, int, int)
int mpPivotBareiss(row_col_weight *)
poly p_Sub(poly p1, poly p2, const ring r)
static poly p_Copy(poly p, const ring r)
returns a copy of p
void mpToIntvec(intvec *)
for(int i=0;i< R->ExpL_Size;i++) Print("%09lx "
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
static int max(int a, int b)
static poly p_Insert(poly p1, poly p2, const ring)
static int mp_PrepareRow(matrix, int, int, const ring)
static poly pp_Mult_qq(poly p, poly q, const ring r)
int mpPivotRow(row_col_weight *, int)
static poly minuscopy(poly p, const ring)
static poly p_Mult_nn(poly p, number n, const ring r)
static int mp_PivBar(matrix, int, int, const ring)
static float mp_PolyWeight(poly, const ring)
matrix mpNew(int r, int c)
create a r x c zero-matrix
static void p_Delete(poly *p, const ring r)
static void mpSwapCol(matrix a, int pos, int lr, int lc)
const Variable & v
< [in] a sqrfree bivariate poly
matrix mp_Mult(matrix a, matrix b, const ring R)
static void mp_ElimBar(matrix, matrix, poly, int, int, const ring)
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...
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
static void mpReplace(int j, int n, int &sign, int *perm)
perform replacement for pivot strategy in Bareiss algorithm change sign of determinant ...
static poly p_Neg(poly p, const ring r)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
poly TraceOfProd(matrix a, matrix b, int n, const ring R)
static poly p_Add_q(poly p, poly q, const ring r)
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...
static poly mp_Leibnitz(matrix a, const ring)
static poly p_Mult_q(poly p, poly q, const ring r)
void Werror(const char *fmt,...)
static int mp_PreparePiv(matrix, int, int, const ring)
#define MATELEM(mat, i, j)