sample.c: Polyhedron_Sample: use isl_val
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 10 Apr 2013 10:22:27 +0000 (10 12:22 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 31 May 2013 08:53:20 +0000 (31 10:53 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
sample.c

index 3cf7c76..086add5 100644 (file)
--- a/sample.c
+++ b/sample.c
@@ -1,4 +1,5 @@
 #include <assert.h>
+#include <isl/val_gmp.h>
 #include <isl_set_polylib.h>
 #include <barvinok/sample.h>
 
@@ -17,17 +18,16 @@ Vector *Polyhedron_Sample(Polyhedron *P, struct barvinok_options *options)
        pnt = isl_basic_set_sample_point(bset);
 
        if (!isl_point_is_void(pnt)) {
-               isl_int v;
+               isl_val *v;
 
-               isl_int_init(v);
                sample = Vector_Alloc(1 + nvar);
                assert(sample);
                for (i = 0; i < nvar; ++i) {
-                       isl_point_get_coordinate(pnt, isl_dim_set, i, &v);
-                       isl_int_get_gmp(v, sample->p[i]);
+                       v = isl_point_get_coordinate_val(pnt, isl_dim_set, i);
+                       isl_val_get_num_gmp(v, sample->p[i]);
+                       isl_val_free(v);
                }
                value_set_si(sample->p[nvar], 1);
-               isl_int_clear(v);
        }
 
        isl_point_free(pnt);