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