source: git/libpolys/polys/matpol.h @ 0a3a629

spielwiese
Last change on this file since 0a3a629 was 0a3a629, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
FIX: fixed the matrix-related inteface: e.g. mpCopy(matrix) -> mp_Copy(matrix, const ring)
  • 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
33matrix mpNew(int r, int c);
34static inline matrix mp_New(int r, int c){ return mpNew(r,c); }
35
36// matrix mpCopy(matrix a);
37void   mp_Delete(matrix* a, const ring r);
38matrix mp_Copy(const matrix a, const ring rSrc, const ring rDst);
39
40matrix mp_Copy(matrix a, const ring r);
41// static inline matrix mp_Copy(matrix a, const ring r){ return mp_Copy(a, r, r); }
42
43matrix mp_InitP(int r, int c, poly p, const ring R);
44matrix mp_InitI(int r, int c, int v, const ring R);
45matrix mp_MultI(matrix a, int f, const ring r);
46matrix mp_MultP(matrix a, poly p, const ring r);
47matrix pMultMp(poly p, matrix a, const ring r);
48matrix mp_Add(matrix a, matrix b, const ring r);
49matrix mp_Sub(matrix a, matrix b, const ring r);
50matrix mp_Mult(matrix a, matrix b, const ring r);
51matrix mp_Transp(matrix a, const ring r);
52BOOLEAN mp_Equal(matrix a, matrix b, const ring r);
53poly mp_Trace ( matrix a, const ring r);
54poly TraceOfProd ( matrix a, matrix b, int n, const ring r);
55
56poly mp_Det (matrix m, const ring r);
57matrix mp_Wedge(matrix a, int ar, const ring r);
58
59// BOOLEAN mpJacobi(leftv res,leftv a);
60// BOOLEAN mpKoszul(leftv res,leftv b/*in*/, leftv c/*ip*/, leftv id=NULL);
61poly mp_DetBareiss (matrix a, const ring r);
62
63//matrix mp_Homogen(matrix a, int v, const ring r);
64
65void   mp_Monomials(matrix c, int r, int var, matrix m, const ring R);
66
67/// corresponds to Maple's coeffs:
68/// var has to be the number of a variable
69matrix mp_Coeffs(ideal I, int var, const ring r);
70
71matrix mp_CoeffProc (poly f, poly vars, const ring r);
72/// corresponds to Macauley's coef:
73/// the exponent vector of vars has to contain the variables, eg 'xy';
74/// then the poly f is searched for monomials in x and y, these monimials
75/// are written to the first row of the matrix co.
76/// the second row of co contains the respective factors in f.
77/// Thus f = sum co[1,i]*co[2,i], i = 1..cols, rows equals 2.
78void mp_Coef2(poly v, poly vars, matrix *c, matrix *m, const ring r);
79
80/// for minors with Bareiss
81void mp_RecMin(int, ideal, int &, matrix, int, int, poly, ideal, const ring r);
82void mp_MinorToResult(ideal, int &, matrix, int, int, ideal, const ring r);
83
84BOOLEAN mp_IsDiagUnit(matrix U, const ring r);
85void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces=0);
86char * iiStringMatrix(matrix im, int dim, const ring r, char ch=',');
87
88extern omBin ip_smatrix_bin;
89
90#endif/* MATPOL_H */
Note: See TracBrowser for help on using the repository browser.