matpol.h
Go to the documentation of this file.
1 #ifndef MATPOL_H
2 #define MATPOL_H
3 /****************************************
4 * Computer Algebra System SINGULAR *
5 ****************************************/
6 /*
7 * ABSTRACT
8 */
9 
10 // #include <kernel/structs.h>
11 #include <polys/monomials/ring.h>
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
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 
32 typedef ip_smatrix * matrix;
33 
34 matrix mpNew(int r, int c);
35 static inline matrix mp_New(int r, int c){ return mpNew(r,c); }
36 
37 // matrix mpCopy(matrix a);
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 
57 // poly mp_Det (matrix m, const ring r);
58 matrix mp_Wedge(matrix a, int ar, const ring r);
59 
60 // BOOLEAN mpJacobi(leftv res,leftv a);
61 // BOOLEAN mpKoszul(leftv res,leftv b/*in*/, leftv c/*ip*/, leftv id=NULL);
62 
63 poly mp_DetBareiss (matrix a, const ring r);
64 
65 //matrix mp_Homogen(matrix a, int v, const ring r);
66 
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);
81 
82 /// for minors with Bareiss
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);
85 
86 BOOLEAN mp_IsDiagUnit(matrix U, const ring r);
87 
88 /// set spaces to zero by default
89 void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces);
90 
91 char * iiStringMatrix(matrix im, int dim, const ring r, char ch=',');
92 
93 extern omBin ip_smatrix_bin;
94 
95 #endif/* MATPOL_H */
int & rows()
Definition: matpol.h:24
matrix mp_Sub(matrix a, matrix b, const ring r)
Definition: matpol.cc:207
const poly a
Definition: syzextra.cc:212
omBin_t * omBin
Definition: omStructs.h:12
matrix mp_MultP(matrix a, poly p, const ring r)
multiply a matrix &#39;a&#39; by a poly &#39;p&#39;, destroy the args
Definition: matpol.cc:159
matrix pMultMp(poly p, matrix a, const ring r)
Definition: matpol.cc:176
int ncols
Definition: matpol.h:22
return P p
Definition: myNF.cc:203
void mp_Delete(matrix *a, const ring r)
Definition: matpol.cc:785
void mp_RecMin(int, ideal, int &, matrix, int, int, poly, ideal, const ring)
for minors with Bareiss
Definition: matpol.cc:1508
void mp_MinorToResult(ideal, int &, matrix, int, int, ideal, const ring)
entries of a are minors and go to result (only if not in R)
Definition: matpol.cc:1412
void mp_Monomials(matrix c, int r, int var, matrix m, const ring R)
Definition: matpol.cc:377
BOOLEAN mp_IsDiagUnit(matrix U, const ring r)
Definition: matpol.cc:721
matrix mp_InitI(int r, int c, int v, const ring R)
make it a v * unit matrix
Definition: matpol.cc:140
omBin ip_smatrix_bin
matrix mp_CoeffProc(poly f, poly vars, const ring r)
Definition: matpol.cc:414
poly * m
Definition: matpol.h:19
const ring r
Definition: syzextra.cc:208
void mp_Coef2(poly v, poly vars, matrix *c, matrix *m, const ring r)
corresponds to Macauley&#39;s coef: the exponent vector of vars has to contain the variables, eg &#39;xy&#39;; then the poly f is searched for monomials in x and y, these monimials are written to the first row of the matrix co. the second row of co contains the respective factors in f. Thus f = sum co[1,i]*co[2,i], i = 1..cols, rows equals 2.
Definition: matpol.cc:516
int nrows
Definition: matpol.h:21
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
Definition: matpol.cc:739
matrix mp_Mult(matrix a, matrix b, const ring r)
Definition: matpol.cc:224
const ring R
Definition: DebugPrint.cc:36
matrix mp_Transp(matrix a, const ring r)
Definition: matpol.cc:268
int dim(ideal I, ring r)
FILE * f
Definition: checklibs.c:7
BOOLEAN mp_Equal(matrix a, matrix b, const ring r)
Definition: matpol.cc:579
matrix mp_Wedge(matrix a, int ar, const ring r)
Definition: matpol.cc:1656
static matrix mp_New(int r, int c)
Definition: matpol.h:35
poly mp_DetBareiss(matrix a, const ring r)
returns the determinant of the matrix m; uses Bareiss algorithm
Definition: matpol.cc:1581
matrix mp_Copy(const matrix a, const ring rSrc, const ring rDst)
copies matrix a from rSrc into rDst
Definition: matpol.cc:96
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
int & cols()
Definition: matpol.h:25
char * iiStringMatrix(matrix im, int dim, const ring r, char ch=',')
Definition: matpol.cc:760
matrix mp_MultI(matrix a, int f, const ring r)
c = f*a
Definition: matpol.cc:146
poly TraceOfProd(matrix a, matrix b, int n, const ring r)
Definition: matpol.cc:303
matrix mp_Add(matrix a, matrix b, const ring r)
Definition: matpol.cc:190
matrix mp_InitP(int r, int c, poly p, const ring R)
make it a p * unit matrix
Definition: matpol.cc:124
matrix mp_Coeffs(ideal I, int var, const ring r)
corresponds to Maple&#39;s coeffs: var has to be the number of a variable
Definition: matpol.cc:327
polyrec * poly
Definition: hilb.h:10
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:48
int BOOLEAN
Definition: auxiliary.h:131
const poly b
Definition: syzextra.cc:213
poly mp_Trace(matrix a, const ring r)
Definition: matpol.cc:289
ip_smatrix * matrix
Definition: matpol.h:32
long rank
Definition: matpol.h:20