00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __BM_MATRIX_ADDON_H__
00011 #define __BM_MATRIX_ADDON_H__
00012
00013 #include<polylib/polylib.h>
00014 #include<assert.h>
00015
00016
00017 #define show_matrix(M) { printf(#M"= \n"); \
00018 if (M!=NULL) { \
00019 Matrix_Print(stderr,P_VALUE_FMT,(M));} \
00020 else {printf("<NULL>\n");} \
00021 }
00022
00023
00024
00025
00026 #define ensureMatrix(M, r, c) { if (M==NULL) M = Matrix_Alloc(r,c); \
00027 else assert (M->NbRows>=r && M->NbColumns>=c); \
00028 }
00029
00030
00031 Matrix * constraintsView(Polyhedron * P);
00032
00033
00034 void constraintsView_Free(Matrix * M);
00035
00036
00037
00038 void split_constraints(Matrix const * M, Matrix ** Eqs, Matrix **Ineqs);
00039
00040
00041 Matrix * Identity_Matrix(unsigned int dim);
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
00095 void Matrix_copySubMatrix(Matrix *M1,
00096 unsigned int sr1, unsigned int sc1,
00097 unsigned int nbR, unsigned int nbC,
00098 Matrix * M2,
00099 unsigned int sr2, unsigned int sc2);
00100
00101
00102
00103
00104 void Matrix_oppose(Matrix * M);
00105
00106 #endif