4 #include "isl_piplib.h"
5 #include "isl_sample_piplib.h"
7 struct isl_vec *isl_pip_basic_set_sample(struct isl_basic_set *bset)
9 PipOptions *options = NULL;
10 PipMatrix *domain = NULL;
12 struct isl_vec *vec = NULL;
19 isl_assert(ctx, isl_basic_set_n_param(bset) == 0, goto error);
20 isl_assert(ctx, bset->n_div == 0, goto error);
21 dim = isl_basic_set_n_dim(bset);
22 domain = isl_basic_map_to_pip((struct isl_basic_map *)bset, 0, 0, 0);
26 options = pip_options_init();
29 sol = pip_solve(domain, NULL, -1, options);
33 vec = isl_vec_alloc(ctx, 0);
37 vec = isl_vec_alloc(ctx, 1 + dim);
40 isl_int_set_si(vec->block.data[0], 1);
41 for (i = 0, l = sol->list; l && i < dim; ++i, l = l->next) {
42 isl_seq_cpy_from_pip(&vec->block.data[1+i],
43 &l->vector->the_vector[0], 1);
44 isl_assert(ctx, !entier_zero_p(l->vector->the_deno[0]),
47 isl_assert(ctx, i == dim, goto error);
51 pip_options_free(options);
52 pip_matrix_free(domain);
54 isl_basic_set_free(bset);
58 isl_basic_set_free(bset);
62 pip_matrix_free(domain);