source: git/libpolys/polys/matpol.h @ 42e2db

fieker-DuValspielwiese
Last change on this file since 42e2db was 42e2db, checked in by Hans Schoenemann <hannes@…>, 5 years ago
remove mp_New (->mpNew)
  • Property mode set to 100644
File size: 3.4 KB
Line 
1#ifndef MATPOL_H
2#define MATPOL_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/*
7* ABSTRACT
8*/
9
10#include "polys/monomials/ring.h"
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
14class 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  #define MATELEM(mat,i,j) ((mat)->m)[MATCOLS((mat)) * ((i)-1) + (j)-1]
29};
30
31typedef ip_smatrix *       matrix;
32
33matrix mpNew(int r, int c);
34
35void   mp_Delete(matrix* a, const ring r);
36matrix mp_Copy(const matrix a, const ring rSrc, const ring rDst);
37
38matrix mp_Copy(matrix a, const ring r);
39
40matrix mp_InitP(int r, int c, poly p, const ring R);
41matrix mp_InitI(int r, int c, int v, const ring R);
42matrix mp_MultI(matrix a, int f, const ring r);
43matrix mp_MultP(matrix a, poly p, const ring r);
44matrix pMultMp(poly p, matrix a, const ring r);
45matrix mp_Add(matrix a, matrix b, const ring r);
46matrix mp_Sub(matrix a, matrix b, const ring r);
47matrix mp_Mult(matrix a, matrix b, const ring r);
48matrix mp_Transp(matrix a, const ring r);
49BOOLEAN mp_Equal(matrix a, matrix b, const ring r);
50poly mp_Trace ( matrix a, const ring r);
51poly TraceOfProd ( matrix a, matrix b, int n, const ring r);
52
53matrix mp_Wedge(matrix a, int ar, const ring r);
54
55// BOOLEAN mpJacobi(leftv res,leftv a);
56// BOOLEAN mpKoszul(leftv res,leftv b/*in*/, leftv c/*ip*/, leftv id=NULL);
57
58poly mp_DetBareiss (matrix a, const ring r);
59
60//matrix mp_Homogen(matrix a, int v, const ring r);
61
62void   mp_Monomials(matrix c, int r, int var, matrix m, const ring R);
63
64/// corresponds to Maple's coeffs:
65/// var has to be the number of a variable
66matrix mp_Coeffs(ideal I, int var, const ring r);
67
68matrix mp_CoeffProc (poly f, poly vars, const ring r);
69matrix mp_CoeffProcId (ideal I, poly vars, const ring R);
70/// corresponds to Macauley's coef:
71/// the exponent vector of vars has to contain the variables, eg 'xy';
72/// then the poly f is searched for monomials in x and y, these monimials
73/// are written to the first row of the matrix co.
74/// the second row of co contains the respective factors in f.
75/// Thus f = sum co[1,i]*co[2,i], i = 1..cols, rows equals 2.
76void mp_Coef2(poly v, poly vars, matrix *c, matrix *m, const ring r);
77
78/// for minors with Bareiss
79void mp_RecMin(int, ideal, int &, matrix, int, int, poly, ideal, const ring);
80void mp_MinorToResult(ideal, int &, matrix, int, int, ideal, const ring);
81
82BOOLEAN mp_IsDiagUnit(matrix U, const ring r);
83
84/// set spaces to zero by default
85void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces);
86
87char * iiStringMatrix(matrix im, int dim, const ring r, char ch=',');
88
89extern omBin ip_smatrix_bin;
90
91int mp_Compare(matrix a, matrix b, const ring r);
92
93// -------------------------------------------------------
94ideal sm_Add(ideal a, ideal b, const ring R);
95ideal sm_Sub(ideal a, ideal b, const ring R);
96ideal sm_Mult(ideal a, ideal b, const ring R);
97ideal sm_Flatten(ideal a, const ring R);
98ideal sm_UnFlatten(ideal a, int col, const ring R);
99poly sm_Trace ( ideal a, const ring R);
100int sm_Compare(ideal a, ideal b, const ring R);
101BOOLEAN sm_Equal(ideal a, ideal b, const ring R);
102ideal sm_Tensor(ideal A, ideal B, const ring r);
103
104#define SMATELEM(A,i,j,R) p_Vec2Poly(A->m[j],i+1,R)
105
106#endif/* MATPOL_H */
Note: See TracBrowser for help on using the repository browser.