barvinok 0.41.5
[barvinok.git] / remove_redundant_equalities.c
blob22c2c97aa336d3172fc99f7bd81bb145a39a626d
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 const char **param_name;
25 int i;
26 struct barvinok_options *options = barvinok_options_new_with_defaults();
28 M = Matrix_Read();
29 A = Constraints2Polyhedron(M, options->MaxRays);
30 Matrix_Free(M);
31 M = Matrix_Read();
32 C = Constraints2Polyhedron(M, options->MaxRays);
33 Matrix_Free(M);
34 param_name = Read_ParamNames(stdin, C->Dimension);
35 A = remove_equalities_p(A, A->Dimension-C->Dimension, 0, options->MaxRays);
36 dump_polytope(A);
37 puts("");
38 dump_polytope(C);
39 puts("");
40 for (i = 0; i < C->Dimension; ++i)
41 printf("%s ", param_name[i]);
42 puts("");
43 Free_ParamNames(param_name, C->Dimension);
44 Polyhedron_Free(A);
45 Polyhedron_Free(C);
46 barvinok_options_free(options);
47 return 0;