[35aab3] | 1 | #ifndef MATPOL_H |
---|
| 2 | #define MATPOL_H |
---|
| 3 | /**************************************** |
---|
| 4 | * Computer Algebra System SINGULAR * |
---|
| 5 | ****************************************/ |
---|
[341696] | 6 | /* $Id$ */ |
---|
[35aab3] | 7 | /* |
---|
| 8 | * ABSTRACT |
---|
| 9 | */ |
---|
[028192] | 10 | |
---|
| 11 | // #include <kernel/structs.h> |
---|
| 12 | #include <polys/monomials/ring.h> |
---|
[35aab3] | 13 | |
---|
| 14 | // THIS IS REALLY DIRTY: ip_smatrix HAS TO BE IDENTICAL TO ip_sideal |
---|
| 15 | // SO, DON'T CHANGE THE DECLARATION OF ip_smatrix |
---|
| 16 | class ip_smatrix |
---|
| 17 | { |
---|
| 18 | public: |
---|
| 19 | |
---|
| 20 | poly *m; |
---|
| 21 | long rank; |
---|
| 22 | int nrows; |
---|
| 23 | int ncols; |
---|
| 24 | |
---|
| 25 | inline int& rows() { return nrows; } |
---|
| 26 | inline int& cols() { return ncols; } |
---|
| 27 | |
---|
| 28 | #define MATROWS(i) ((i)->nrows) |
---|
| 29 | #define MATCOLS(i) ((i)->ncols) |
---|
| 30 | #define MATELEM(mat,i,j) ((mat)->m)[MATCOLS((mat)) * ((i)-1) + (j)-1] |
---|
| 31 | }; |
---|
| 32 | |
---|
[7829fb] | 33 | typedef ip_smatrix * matrix; |
---|
| 34 | |
---|
[35aab3] | 35 | matrix mpNew(int r, int c); |
---|
[0a3a629] | 36 | static inline matrix mp_New(int r, int c){ return mpNew(r,c); } |
---|
| 37 | |
---|
[40d0649] | 38 | // matrix mpCopy(matrix a); |
---|
[0a3a629] | 39 | void mp_Delete(matrix* a, const ring r); |
---|
| 40 | matrix mp_Copy(const matrix a, const ring rSrc, const ring rDst); |
---|
| 41 | |
---|
| 42 | matrix mp_Copy(matrix a, const ring r); |
---|
| 43 | // static inline matrix mp_Copy(matrix a, const ring r){ return mp_Copy(a, r, r); } |
---|
| 44 | |
---|
| 45 | matrix mp_InitP(int r, int c, poly p, const ring R); |
---|
| 46 | matrix mp_InitI(int r, int c, int v, const ring R); |
---|
| 47 | matrix mp_MultI(matrix a, int f, const ring r); |
---|
| 48 | matrix mp_MultP(matrix a, poly p, const ring r); |
---|
| 49 | matrix pMultMp(poly p, matrix a, const ring r); |
---|
| 50 | matrix mp_Add(matrix a, matrix b, const ring r); |
---|
| 51 | matrix mp_Sub(matrix a, matrix b, const ring r); |
---|
| 52 | matrix mp_Mult(matrix a, matrix b, const ring r); |
---|
| 53 | matrix mp_Transp(matrix a, const ring r); |
---|
| 54 | BOOLEAN mp_Equal(matrix a, matrix b, const ring r); |
---|
| 55 | poly mp_Trace ( matrix a, const ring r); |
---|
| 56 | poly TraceOfProd ( matrix a, matrix b, int n, const ring r); |
---|
| 57 | |
---|
[2fce0e] | 58 | // poly mp_Det (matrix m, const ring r); |
---|
[0a3a629] | 59 | matrix mp_Wedge(matrix a, int ar, const ring r); |
---|
| 60 | |
---|
[028192] | 61 | // BOOLEAN mpJacobi(leftv res,leftv a); |
---|
| 62 | // BOOLEAN mpKoszul(leftv res,leftv b/*in*/, leftv c/*ip*/, leftv id=NULL); |
---|
[2fce0e] | 63 | |
---|
[441a2e] | 64 | poly mp_DetBareiss (matrix a, const ring r); |
---|
[35aab3] | 65 | |
---|
[0a3a629] | 66 | //matrix mp_Homogen(matrix a, int v, const ring r); |
---|
[35aab3] | 67 | |
---|
[0a3a629] | 68 | void mp_Monomials(matrix c, int r, int var, matrix m, const ring R); |
---|
| 69 | |
---|
| 70 | /// corresponds to Maple's coeffs: |
---|
| 71 | /// var has to be the number of a variable |
---|
| 72 | matrix mp_Coeffs(ideal I, int var, const ring r); |
---|
| 73 | |
---|
| 74 | matrix mp_CoeffProc (poly f, poly vars, const ring r); |
---|
| 75 | /// corresponds to Macauley's coef: |
---|
| 76 | /// the exponent vector of vars has to contain the variables, eg 'xy'; |
---|
| 77 | /// then the poly f is searched for monomials in x and y, these monimials |
---|
| 78 | /// are written to the first row of the matrix co. |
---|
| 79 | /// the second row of co contains the respective factors in f. |
---|
| 80 | /// Thus f = sum co[1,i]*co[2,i], i = 1..cols, rows equals 2. |
---|
| 81 | void mp_Coef2(poly v, poly vars, matrix *c, matrix *m, const ring r); |
---|
[35aab3] | 82 | |
---|
[0a3a629] | 83 | /// for minors with Bareiss |
---|
[d16ea9] | 84 | void mp_RecMin(int, ideal, int &, matrix, int, int, poly, ideal, const ring); |
---|
| 85 | void mp_MinorToResult(ideal, int &, matrix, int, int, ideal, const ring); |
---|
[0a3a629] | 86 | |
---|
| 87 | BOOLEAN mp_IsDiagUnit(matrix U, const ring r); |
---|
[845729b] | 88 | |
---|
[fc2746] | 89 | /// set spaces to zero by default |
---|
| 90 | void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces); |
---|
| 91 | |
---|
[0a3a629] | 92 | char * iiStringMatrix(matrix im, int dim, const ring r, char ch=','); |
---|
[35aab3] | 93 | |
---|
| 94 | extern omBin ip_smatrix_bin; |
---|
[0a3a629] | 95 | |
---|
[441a2e] | 96 | #endif/* MATPOL_H */ |
---|