source: git/libpolys/polys/matpol.h @ 975db18

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