My Project
Loading...
Searching...
No Matches
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
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
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 /// 1-based access to matrix
29 #define MATELEM(mat,i,j) ((mat)->m)[(long)MATCOLS((mat)) * (long)((i)-1) + (long)(j)-1]
30 /// 0-based access to matrix
31 #define MATELEM0(mat,i,j) ((mat)->m)[(long)MATCOLS((mat)) * (long)(i) + (long)(j)]
32};
33
35{
41};
42
44
45matrix mpNew(int r, int c);
46#define mp_New(r,c,R) mpNew(r,c)
47
48void mp_Delete(matrix* a, const ring r);
49matrix mp_Copy(const matrix a, const ring rSrc, const ring rDst);
50
51matrix mp_Copy(matrix a, const ring r);
52
53matrix mp_InitP(int r, int c, poly p, const ring R);
54matrix mp_InitI(int r, int c, int v, const ring R);
55matrix mp_MultI(matrix a, long f, const ring r);
56matrix mp_MultP(matrix a, poly p, const ring r);
57matrix pMultMp(poly p, matrix a, const ring r);
58matrix mp_Add(matrix a, matrix b, const ring r);
59matrix mp_Sub(matrix a, matrix b, const ring r);
60matrix mp_Mult(matrix a, matrix b, const ring r);
61matrix mp_Transp(matrix a, const ring r);
62BOOLEAN mp_Equal(matrix a, matrix b, const ring r);
63poly mp_Trace ( matrix a, const ring r);
64poly TraceOfProd ( matrix a, matrix b, int n, const ring r);
65
66matrix mp_Wedge(matrix a, int ar, const ring r);
67
68// BOOLEAN mpJacobi(leftv res,leftv a);
69// BOOLEAN mpKoszul(leftv res,leftv b/*in*/, leftv c/*ip*/, leftv id=NULL);
70
71poly mp_Det(matrix a, const ring r, DetVariant d=DetDefault);
72poly mp_DetBareiss (matrix a, const ring r);
73poly mp_DetMu(matrix A, const ring R);
74
75
76//matrix mp_Homogen(matrix a, int v, const ring r);
77
78void mp_Monomials(matrix c, int r, int var, matrix m, const ring R);
79
80/// corresponds to Maple's coeffs:
81/// var has to be the number of a variable
82matrix mp_Coeffs(ideal I, int var, const ring r);
83
84matrix mp_CoeffProc (poly f, poly vars, const ring r);
85matrix mp_CoeffProcId (ideal I, poly vars, const ring R);
86/// corresponds to Macauley's coef:
87/// the exponent vector of vars has to contain the variables, eg 'xy';
88/// then the poly f is searched for monomials in x and y, these monimials
89/// are written to the first row of the matrix co.
90/// the second row of co contains the respective factors in f.
91/// Thus f = sum co[1,i]*co[2,i], i = 1..cols, rows equals 2.
92void mp_Coef2(poly v, poly vars, matrix *c, matrix *m, const ring r);
93
94/// for minors with Bareiss
95void mp_RecMin(int, ideal, int &, matrix, int, int, poly, ideal, const ring);
96void mp_MinorToResult(ideal, int &, matrix, int, int, ideal, const ring);
97
98BOOLEAN mp_IsDiagUnit(matrix U, const ring r);
99
100/// set spaces to zero by default
101void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces);
102
103char * iiStringMatrix(matrix im, int dim, const ring r, char ch=',');
104
106
107int mp_Compare(matrix a, matrix b, const ring r);
108
109// -------------------------------------------------------
110ideal sm_Add(ideal a, ideal b, const ring R);
111ideal sm_Sub(ideal a, ideal b, const ring R);
112ideal sm_Mult(ideal a, ideal b, const ring R);
113ideal sm_Flatten(ideal a, const ring R);
114ideal sm_UnFlatten(ideal a, int col, const ring R);
115poly sm_Trace ( ideal a, const ring R);
116int sm_Compare(ideal a, ideal b, const ring R);
117BOOLEAN sm_Equal(ideal a, ideal b, const ring R);
118ideal sm_Tensor(ideal A, ideal B, const ring r);
119poly sm_Det(ideal I, const ring, DetVariant d=DetDefault);
121DetVariant mp_GetAlgorithmDet(const char *s);
122
123#define SMATELEM(A,i,j,R) p_Vec2Poly(A->m[j],i+1,R)
124
125#endif/* MATPOL_H */
int BOOLEAN
Definition: auxiliary.h:87
int m
Definition: cfEzgcd.cc:128
int p
Definition: cfModGcd.cc:4078
CanonicalForm b
Definition: cfModGcd.cc:4103
FILE * f
Definition: checklibs.c:9
int nrows
Definition: matpol.h:20
long rank
Definition: matpol.h:19
int ncols
Definition: matpol.h:21
poly * m
Definition: matpol.h:18
int & cols()
Definition: matpol.h:24
int & rows()
Definition: matpol.h:23
const CanonicalForm int s
Definition: facAbsFact.cc:51
b *CanonicalForm B
Definition: facBivar.cc:52
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:39
#define EXTERN_VAR
Definition: globaldefs.h:6
EXTERN_VAR omBin ip_smatrix_bin
Definition: matpol.h:105
ip_smatrix * matrix
Definition: matpol.h:43
matrix pMultMp(poly p, matrix a, const ring r)
Definition: matpol.cc:158
ideal sm_Tensor(ideal A, ideal B, const ring r)
Definition: matpol.cc:1824
ideal sm_UnFlatten(ideal a, int col, const ring R)
Definition: matpol.cc:1939
int sm_Compare(ideal a, ideal b, const ring R)
Definition: matpol.cc:1977
ideal sm_Add(ideal a, ideal b, const ring R)
Definition: matpol.cc:1864
poly sm_Trace(ideal a, const ring R)
Definition: matpol.cc:1966
matrix mp_MultP(matrix a, poly p, const ring r)
multiply a matrix 'a' by a poly 'p', destroy the args
Definition: matpol.cc:141
matrix mp_Copy(const matrix a, const ring rSrc, const ring rDst)
copies matrix a from rSrc into rDst
Definition: matpol.cc:78
BOOLEAN mp_IsDiagUnit(matrix U, const ring r)
Definition: matpol.cc:809
matrix mp_MultI(matrix a, long f, const ring r)
c = f*a
Definition: matpol.cc:128
void mp_Delete(matrix *a, const ring r)
Definition: matpol.cc:873
matrix mp_CoeffProc(poly f, poly vars, const ring r)
Definition: matpol.cc:392
void mp_Monomials(matrix c, int r, int var, matrix m, const ring R)
Definition: matpol.cc:355
matrix mp_Coeffs(ideal I, int var, const ring r)
corresponds to Maple's coeffs: var has to be the number of a variable
Definition: matpol.cc:306
DetVariant mp_GetAlgorithmDet(matrix m, const ring r)
Definition: matpol.cc:2105
matrix mp_Add(matrix a, matrix b, const ring r)
Definition: matpol.cc:172
int mp_Compare(matrix a, matrix b, const ring r)
Definition: matpol.cc:636
void mp_RecMin(int, ideal, int &, matrix, int, int, poly, ideal, const ring)
for minors with Bareiss
Definition: matpol.cc:1596
matrix mp_InitI(int r, int c, int v, const ring R)
make it a v * unit matrix
Definition: matpol.cc:122
matrix mp_CoeffProcId(ideal I, poly vars, const ring R)
Definition: matpol.cc:469
matrix mp_Transp(matrix a, const ring r)
Definition: matpol.cc:247
ideal sm_Sub(ideal a, ideal b, const ring R)
Definition: matpol.cc:1874
ideal sm_Mult(ideal a, ideal b, const ring R)
Definition: matpol.cc:1884
poly mp_Trace(matrix a, const ring r)
Definition: matpol.cc:268
poly mp_Det(matrix a, const ring r, DetVariant d=DetDefault)
Definition: matpol.cc:2136
poly sm_Det(ideal I, const ring, DetVariant d=DetDefault)
Definition: matpol.cc:2160
matrix mp_Mult(matrix a, matrix b, const ring r)
Definition: matpol.cc:206
matrix mp_Sub(matrix a, matrix b, const ring r)
Definition: matpol.cc:189
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:37
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:1500
BOOLEAN sm_Equal(ideal a, ideal b, const ring R)
Definition: matpol.cc:1996
BOOLEAN mp_Equal(matrix a, matrix b, const ring r)
Definition: matpol.cc:655
void mp_Coef2(poly v, poly vars, matrix *c, matrix *m, const ring r)
corresponds to Macauley's coef: the exponent vector of vars has to contain the variables,...
Definition: matpol.cc:574
char * iiStringMatrix(matrix im, int dim, const ring r, char ch=',')
Definition: matpol.cc:848
matrix mp_InitP(int r, int c, poly p, const ring R)
make it a p * unit matrix
Definition: matpol.cc:106
poly TraceOfProd(matrix a, matrix b, int n, const ring r)
Definition: matpol.cc:282
DetVariant
Definition: matpol.h:35
@ DetFactory
Definition: matpol.h:40
@ DetBareiss
Definition: matpol.h:37
@ DetDefault
Definition: matpol.h:36
@ DetSBareiss
Definition: matpol.h:38
@ DetMu
Definition: matpol.h:39
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
Definition: matpol.cc:827
poly mp_DetMu(matrix A, const ring R)
Definition: matpol.cc:2063
ideal sm_Flatten(ideal a, const ring R)
Definition: matpol.cc:1919
matrix mp_Wedge(matrix a, int ar, const ring r)
Definition: matpol.cc:1744
poly mp_DetBareiss(matrix a, const ring r)
returns the determinant of the matrix m; uses Bareiss algorithm
Definition: matpol.cc:1669
omBin_t * omBin
Definition: omStructs.h:12
#define R
Definition: sirandom.c:27
#define A
Definition: sirandom.c:24
int dim(ideal I, ring r)