merge check_poly from verif_ehrhart.c and lexmin.cc
[barvinok.git] / polyhedron_sample.c
blob6a4708c0da0d1e29bb83e8da9200d4acf42357cb
1 #include <barvinok/options.h>
2 #include <barvinok/sample.h>
3 #include "config.h"
5 #ifdef HAVE_GROWING_CHERNIKOVA
6 #define MAXRAYS (POL_NO_DUAL | POL_INTEGER)
7 #else
8 #define MAXRAYS 600
9 #endif
11 int main(int argc, char **argv)
13 Matrix *M;
14 Polyhedron *P;
15 Vector *sample;
16 struct barvinok_options *bv_options = barvinok_options_new_with_defaults();
18 M = Matrix_Read();
19 P = Constraints2Polyhedron(M, bv_options->MaxRays);
20 Matrix_Free(M);
22 sample = Polyhedron_Sample(P, bv_options);
23 if (sample) {
24 assert(in_domain(P, sample->p));
25 Vector_Print(stdout, P_VALUE_FMT, sample);
26 Vector_Free(sample);
29 Polyhedron_Free(P);
30 barvinok_options_free(bv_options);