[35aab3] | 1 | #ifndef MATPOL_H |
---|
| 2 | #define MATPOL_H |
---|
| 3 | /**************************************** |
---|
| 4 | * Computer Algebra System SINGULAR * |
---|
| 5 | ****************************************/ |
---|
[52e2f6] | 6 | /* $Id: matpol.h,v 1.2 2008-06-10 10:17:32 motsak Exp $ */ |
---|
[35aab3] | 7 | /* |
---|
| 8 | * ABSTRACT |
---|
| 9 | */ |
---|
| 10 | #include "structs.h" |
---|
| 11 | |
---|
| 12 | // THIS IS REALLY DIRTY: ip_smatrix HAS TO BE IDENTICAL TO ip_sideal |
---|
| 13 | // SO, DON'T CHANGE THE DECLARATION OF ip_smatrix |
---|
| 14 | class ip_smatrix |
---|
| 15 | { |
---|
| 16 | public: |
---|
| 17 | |
---|
| 18 | poly *m; |
---|
| 19 | long rank; |
---|
| 20 | int nrows; |
---|
| 21 | int ncols; |
---|
| 22 | |
---|
| 23 | inline int& rows() { return nrows; } |
---|
| 24 | inline int& cols() { return ncols; } |
---|
| 25 | |
---|
| 26 | #define MATROWS(i) ((i)->nrows) |
---|
| 27 | #define MATCOLS(i) ((i)->ncols) |
---|
| 28 | #define MATELEM(mat,i,j) ((mat)->m)[MATCOLS((mat)) * ((i)-1) + (j)-1] |
---|
| 29 | }; |
---|
| 30 | |
---|
| 31 | matrix mpNew(int r, int c); |
---|
[52e2f6] | 32 | matrix mpCopy(matrix a); |
---|
| 33 | void mpDelete(matrix* a, const ring r = currRing); |
---|
| 34 | matrix mpCopy(const matrix a, const ring rSrc, const ring rDst = currRing); |
---|
[35aab3] | 35 | matrix mpInitP(int r, int c, poly p); |
---|
| 36 | matrix mpInitI(int r, int c, int v); |
---|
| 37 | matrix mpMultI(matrix a, int f); |
---|
| 38 | matrix mpMultP(matrix a, poly p); |
---|
| 39 | matrix mpAdd(matrix a, matrix b); |
---|
| 40 | matrix mpSub(matrix a, matrix b); |
---|
| 41 | matrix mpMult(matrix a, matrix b); |
---|
| 42 | matrix mpTransp(matrix a); |
---|
| 43 | BOOLEAN mpEqual(matrix a, matrix b); |
---|
| 44 | poly mpTrace ( matrix a); |
---|
| 45 | poly TraceOfProd ( matrix a, matrix b, int n); |
---|
| 46 | |
---|
| 47 | poly mpDet (matrix m); |
---|
| 48 | matrix mpWedge(matrix a, int ar); |
---|
| 49 | BOOLEAN mpJacobi(leftv res,leftv a); |
---|
| 50 | BOOLEAN mpKoszul(leftv res,leftv b/*in*/, leftv c/*ip*/, leftv id=NULL); |
---|
| 51 | poly mpDetBareiss (matrix a); |
---|
| 52 | |
---|
| 53 | //matrix mpHomogen(matrix a, int v); |
---|
| 54 | |
---|
| 55 | void mpMonomials(matrix c, int r, int var, matrix m); |
---|
| 56 | matrix mpCoeffs(ideal I, int var); |
---|
| 57 | /* corresponds to Maple's coeffs: |
---|
| 58 | *var has to be the number of a variable |
---|
| 59 | */ |
---|
| 60 | |
---|
| 61 | matrix mpCoeffProc (poly f, poly vars); |
---|
| 62 | /* corresponds to Macauley's coef: |
---|
| 63 | the exponent vector of vars has to contain the variables, eg 'xy'; |
---|
| 64 | then the poly f is searched for monomials in x and y, these monimials |
---|
| 65 | are written to the first row of the matrix co. |
---|
| 66 | the second row of co contains the respective factors in f. |
---|
| 67 | Thus f = sum co[1,i]*co[2,i], i = 1..cols, rows equals 2. */ |
---|
| 68 | void mpCoef2(poly v, poly vars, matrix *c, matrix *m); |
---|
| 69 | /* for minors with Bareiss */ |
---|
| 70 | void mpRecMin(int, ideal, int &, matrix, int, int, poly, ideal); |
---|
| 71 | void mpMinorToResult(ideal, int &, matrix, int, int, ideal); |
---|
| 72 | |
---|
| 73 | BOOLEAN mpIsDiagUnit(matrix U); |
---|
| 74 | void iiWriteMatrix(matrix im, const char *n, int dim,int spaces=0); |
---|
| 75 | char * iiStringMatrix(matrix im, int dim,char ch=','); |
---|
| 76 | |
---|
| 77 | extern omBin ip_smatrix_bin; |
---|
| 78 | #endif |
---|