options.c: avoid calling isl_alloc_type without valid isl_ctx
[barvinok.git] / remove_redundant_equalities.c
bloba678f1ba4c5aed7a071150d44dc55c97d17b2957
1 #include <barvinok/options.h>
2 #include <barvinok/evalue.h>
3 #include <barvinok/util.h>
4 #include "config.h"
6 void dump_polytope(Polyhedron *P)
8 int i, j;
9 unsigned nr, nc;
11 fprintf(stdout, "%d %d\n", nr=P->NbConstraints, nc=P->Dimension+2);
12 for (i=0; i < nr; i++) {
13 for (j=0; j < nc; j++) {
14 value_print(stdout," "P_VALUE_FMT" ", P->Constraint[i][j]);
16 fprintf(stdout, "\n");
20 int main(int argc, char **argv)
22 Polyhedron *A, *C;
23 Matrix *M;
24 Enumeration *en;
25 const char **param_name;
26 int i;
27 struct barvinok_options *options = barvinok_options_new_with_defaults();
29 M = Matrix_Read();
30 A = Constraints2Polyhedron(M, options->MaxRays);
31 Matrix_Free(M);
32 M = Matrix_Read();
33 C = Constraints2Polyhedron(M, options->MaxRays);
34 Matrix_Free(M);
35 param_name = Read_ParamNames(stdin, C->Dimension);
36 A = remove_equalities_p(A, A->Dimension-C->Dimension, 0, options->MaxRays);
37 dump_polytope(A);
38 puts("");
39 dump_polytope(C);
40 puts("");
41 for (i = 0; i < C->Dimension; ++i)
42 printf("%s ", param_name[i]);
43 puts("");
44 Free_ParamNames(param_name, C->Dimension);
45 Polyhedron_Free(A);
46 Polyhedron_Free(C);
47 barvinok_options_free(options);
48 return 0;