1 | #ifndef MATPOL_H |
---|
2 | #define MATPOL_H |
---|
3 | /**************************************** |
---|
4 | * Computer Algebra System SINGULAR * |
---|
5 | ****************************************/ |
---|
6 | /* |
---|
7 | * ABSTRACT |
---|
8 | */ |
---|
9 | #include "structs.h" |
---|
10 | |
---|
11 | class ip_smatrix |
---|
12 | { |
---|
13 | public: |
---|
14 | |
---|
15 | poly *m; |
---|
16 | long rank; |
---|
17 | int nrows; |
---|
18 | int ncols; |
---|
19 | |
---|
20 | inline int& rows() { return nrows; } |
---|
21 | inline int& cols() { return ncols; } |
---|
22 | |
---|
23 | #define MATROWS(i) ((i)->nrows) |
---|
24 | #define MATCOLS(i) ((i)->ncols) |
---|
25 | #define MATELEM(mat,i,j) ((mat)->m)[MATCOLS((mat)) * ((i)-1) + (j)-1] |
---|
26 | }; |
---|
27 | |
---|
28 | #ifdef MDEBUG |
---|
29 | matrix mpDBNew(int r, int c, char *f, int l); |
---|
30 | #define mpNew(A,B) mpDBNew(A,B,__FILE__,__LINE__) |
---|
31 | #else |
---|
32 | matrix mpNew(int r, int c); |
---|
33 | #endif |
---|
34 | matrix mpCopy (matrix a); |
---|
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 | matrix mpBareiss (matrix a, BOOLEAN diagonal); |
---|
48 | poly mpDet (matrix m); |
---|
49 | matrix mpWedge(matrix a, int ar); |
---|
50 | BOOLEAN mpJacobi(leftv res,leftv a); |
---|
51 | BOOLEAN mpKoszul(leftv res,leftv b/*in*/, leftv c/*ip*/, leftv id=NULL); |
---|
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 | |
---|
70 | #endif |
---|