00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __BM_MATRIX_ADDON_H__
00009 #define __BM_MATRIX_ADDON_H__
00010
00011 #include<polylib/polylib.h>
00012 #include<assert.h>
00013
00014
00015 #define show_matrix(M) { printf(#M"= \n"); \
00016 if (M!=NULL) { \
00017 Matrix_Print(stderr,P_VALUE_FMT,(M));} \
00018 else {printf("<NULL>\n");} \
00019 }
00020
00021
00022
00023
00024 #define ensureMatrix(M, r, c) { if (M==NULL) M = Matrix_Alloc(r,c); \
00025 else assert (M->NbRows>=r && M->NbColumns>=c); \
00026 }
00027
00028
00029 Matrix * constraintsView(Polyhedron * P);
00030
00031
00032 void constraintsView_Free(Matrix * M);
00033
00034
00035
00036 void split_constraints(Matrix const * M, Matrix ** Eqs, Matrix **Ineqs);
00037
00038
00039 Matrix * Identity_Matrix(unsigned int dim);
00040
00041 void Matrix_identity(unsigned int dim, Matrix **I);
00042
00043
00044
00045
00046 void mtransformation_inverse(Matrix * transf, Matrix ** inv, Value * g);
00047
00048
00049
00050 void mpolyhedron_simplify(Matrix * polyh);
00051
00052
00053
00054
00055 void mpolyhedron_inflate(Matrix * polyh, unsigned int nb_parms);
00056
00057
00058
00059
00060 void mpolyhedron_deflate(Matrix * polyh, unsigned int nb_parms);
00061
00062
00063
00064 void eliminate_var_with_constr(Matrix * Eliminator,
00065 unsigned int eliminator_row, Matrix * Victim,
00066 unsigned int victim_row,
00067 unsigned int var_to_elim);
00068
00069
00070
00071
00072
00073
00074
00075
00076 void mpolyhedron_compress_last_vars(Matrix * M, Matrix * compression);
00077 #define Constraints_compressLastVars(a, b) mpolyhedron_compress_last_vars(a, b)
00078
00079
00080
00081
00082
00083 unsigned int mpolyhedron_eliminate_first_variables(Matrix * Eqs,
00084 Matrix * Ineqs);
00085 #define Constraints_eliminateFirstVars(a,b) mpolyhedron_eliminate_first_variables(a,b)
00086
00087
00088 void Matrix_subMatrix(Matrix * M, unsigned int sr, unsigned int sc,
00089 unsigned int nbR, unsigned int nbC, Matrix ** sub);
00090
00091
00092
00093
00094 void Matrix_clone(Matrix * M, Matrix ** Cl);
00095
00096
00097
00098
00099
00100 void Matrix_copySubMatrix(Matrix *M1,
00101 unsigned int sr1, unsigned int sc1,
00102 unsigned int nbR, unsigned int nbC,
00103 Matrix * M2,
00104 unsigned int sr2, unsigned int sc2);
00105
00106
00107
00108
00109 void Matrix_oppose(Matrix * M);
00110
00111 #endif