evalue.c: reorder_terms: fix typo
[barvinok.git] / polyhedron_sample.c
blob442beecc09bef6baed9c60993dc7f3550168191b
1 #include <barvinok/options.h>
2 #include <barvinok/sample.h>
3 #include "config.h"
4 #include "argp.h"
5 #include "progname.h"
7 int main(int argc, char **argv)
9 Matrix *M;
10 Polyhedron *P;
11 Vector *sample;
12 struct barvinok_options *bv_options = barvinok_options_new_with_defaults();
14 set_program_name(argv[0]);
15 argp_parse(&barvinok_argp, argc, argv, 0, 0, bv_options);
17 M = Matrix_Read();
18 P = Constraints2Polyhedron(M, bv_options->MaxRays);
19 Matrix_Free(M);
21 sample = Polyhedron_Sample(P, bv_options);
22 if (sample) {
23 assert(in_domain(P, sample->p));
24 Vector_Print(stdout, P_VALUE_FMT, sample);
25 Vector_Free(sample);
28 Polyhedron_Free(P);
29 barvinok_options_free(bv_options);