test: initialize nbMat
[barvinok.git] / remove_redundant_equalities.c
blob9c1d2a256715b1bb1350bde1b2948140b736afb1
1 #include <barvinok/evalue.h>
2 #include <barvinok/util.h>
3 #include "config.h"
5 #ifdef HAVE_GROWING_CHERNIKOVA
6 #define MAXRAYS 0
7 #else
8 #define MAXRAYS 600
9 #endif
11 void dump_polytope(Polyhedron *P)
13 int i, j;
14 unsigned nr, nc;
16 fprintf(stdout, "%d %d\n", nr=P->NbConstraints, nc=P->Dimension+2);
17 for (i=0; i < nr; i++) {
18 for (j=0; j < nc; j++) {
19 value_print(stdout," "P_VALUE_FMT" ", P->Constraint[i][j]);
21 fprintf(stdout, "\n");
25 int main(int argc, char **argv)
27 Polyhedron *A, *C;
28 Matrix *M;
29 Enumeration *en;
30 char **param_name;
31 int i;
33 M = Matrix_Read();
34 A = Constraints2Polyhedron(M, MAXRAYS);
35 Matrix_Free(M);
36 M = Matrix_Read();
37 C = Constraints2Polyhedron(M, MAXRAYS);
38 Matrix_Free(M);
39 param_name = Read_ParamNames(stdin, C->Dimension);
40 A = remove_equalities_p(A, A->Dimension-C->Dimension, 0);
41 dump_polytope(A);
42 puts("");
43 dump_polytope(C);
44 puts("");
45 for (i = 0; i < C->Dimension; ++i)
46 printf("%s ", param_name[i]);
47 puts("");
48 Free_ParamNames(param_name, C->Dimension);
49 Polyhedron_Free(A);
50 Polyhedron_Free(C);
51 return 0;