8#ifndef __BM_MATRIX_ADDON_H__
9#define __BM_MATRIX_ADDON_H__
15#define show_matrix(M) \
19 Matrix_Print(stderr, P_VALUE_FMT, (M)); \
28#define ensureMatrix(M, r, c) \
31 M = Matrix_Alloc(r, c); \
33 assert(M->NbRows >= r && M->NbColumns >= c); \
73 Matrix *Victim,
unsigned int victim_row,
74 unsigned int var_to_elim);
83#define Constraints_compressLastVars(a, b) mpolyhedron_compress_last_vars(a, b)
90#define Constraints_eliminateFirstVars(a, b) \
91 mpolyhedron_eliminate_first_variables(a, b)
95 unsigned int nbR,
unsigned int nbC,
Matrix **sub);
107 unsigned int nbR,
unsigned int nbC,
Matrix *M2,
108 unsigned int sr2,
unsigned int sc2);
void mpolyhedron_deflate(Matrix *polyh, unsigned int nb_parms)
deflates a polyhedron (represented as a matrix) P, so that the apx of its Ehrhart Polynomial is a low...
void split_constraints(Matrix const *M, Matrix **Eqs, Matrix **Ineqs)
splits a matrix of constraints M into a matrix of equalities Eqs and a matrix of inequalities Ineqs a...
void mpolyhedron_compress_last_vars(Matrix *M, Matrix *compression)
compress the last vars/pars of the polyhedron M expressed as a polylib matrix
Matrix * Identity_Matrix(unsigned int dim)
unsigned int mpolyhedron_eliminate_first_variables(Matrix *Eqs, Matrix *Ineqs)
use a set of m equalities Eqs to eliminate m variables in the polyhedron Ineqs represented as a matri...
void eliminate_var_with_constr(Matrix *Eliminator, unsigned int eliminator_row, Matrix *Victim, unsigned int victim_row, unsigned int var_to_elim)
use an eliminator row to eliminate a variable in a victim row (without changing the sign of the victi...
void Matrix_clone(Matrix *M, Matrix **Cl)
Cloning function.
void constraintsView_Free(Matrix *M)
"Frees" a view of the constraints of a polyhedron
void mpolyhedron_inflate(Matrix *polyh, unsigned int nb_parms)
inflates a polyhedron (represented as a matrix) P, so that the apx of its Ehrhart Polynomial is an up...
void Matrix_copySubMatrix(Matrix *M1, unsigned int sr1, unsigned int sc1, unsigned int nbR, unsigned int nbC, Matrix *M2, unsigned int sr2, unsigned int sc2)
Copies a contiguous submatrix of M1 into M2, at the indicated position.
void Matrix_oppose(Matrix *M)
given a matrix M into -M
void mpolyhedron_simplify(Matrix *polyh)
simplify a matrix seen as a polyhedron, by dividing its rows by the gcd of their elements.
void Matrix_identity(unsigned int dim, Matrix **I)
returns the dim-dimensional identity matrix.
void mtransformation_inverse(Matrix *transf, Matrix **inv, Value *g)
given a n x n integer transformation matrix transf, compute its inverse M/g, where M is a nxn integer...
void Matrix_subMatrix(Matrix *M, unsigned int sr, unsigned int sc, unsigned int nbR, unsigned int nbC, Matrix **sub)
returns a contiguous submatrix of a matrix.
Matrix * constraintsView(Polyhedron *P)
Creates a view of the constraints of a polyhedron as a Matrix *.