partition2enumeration: fix memory leak when input is zero
[barvinok.git] / polytope_volume.c
blob2c3de883c78c9dee2b7e32f133bf537522f73a5f
1 #include <barvinok/options.h>
2 #include "volume.h"
4 int main(int argc, char **argv)
6 Polyhedron *A, *C;
7 Matrix *M;
8 evalue *EP = NULL;
9 const char **param_name;
10 struct barvinok_options *bv_options = barvinok_options_new_with_defaults();
12 M = Matrix_Read();
13 A = Constraints2Polyhedron(M, bv_options->MaxRays);
14 Matrix_Free(M);
15 M = Matrix_Read();
16 C = Constraints2Polyhedron(M, bv_options->MaxRays);
17 Matrix_Free(M);
18 param_name = Read_ParamNames(stdin, C->Dimension);
20 bv_options->approx->approximation = BV_APPROX_SIGN_APPROX;
21 EP = Param_Polyhedron_Volume(A, C, bv_options);
22 print_evalue(stdout, EP, (const char **)param_name);
23 fprintf(stdout, "\n");
24 evalue_free(EP);
26 Free_ParamNames(param_name, C->Dimension);
27 Polyhedron_Free(A);
28 Polyhedron_Free(C);
29 barvinok_options_free(bv_options);
31 return 0;