align parameters of arguments to binary isl_map and isl_pw_aff functions
[platform/upstream/isl.git] / bound.c
diff --git a/bound.c b/bound.c
index a326e35..f83e025 100644 (file)
--- a/bound.c
+++ b/bound.c
@@ -1,5 +1,5 @@
 #include <assert.h>
-#include <isl_stream.h>
+#include <isl/stream.h>
 #include <isl_polynomial_private.h>
 #include <isl_scan.h>
 
@@ -57,6 +57,7 @@ struct verify_point_bound {
 static int verify_point(__isl_take isl_point *pnt, void *user)
 {
        int i;
+       unsigned nvar;
        unsigned nparam;
        struct verify_point_bound *vpb = (struct verify_point_bound *) user;
        isl_int t;
@@ -68,7 +69,6 @@ static int verify_point(__isl_take isl_point *pnt, void *user)
        int bounded;
        int sign;
        int ok;
-       int cst;
        FILE *out = vpb->options->print_all ? stdout : stderr;
 
        vpb->n--;
@@ -110,8 +110,10 @@ static int verify_point(__isl_take isl_point *pnt, void *user)
        else
                opt = isl_pw_qpolynomial_fold_min(isl_pw_qpolynomial_fold_copy(pwf));
 
+       nvar = isl_set_dim(dom, isl_dim_set);
+       opt = isl_qpolynomial_drop_dims(opt, isl_dim_set, 0, nvar);
        if (vpb->exact && bounded)
-               ok = isl_qpolynomial_is_equal(opt, bound);
+               ok = isl_qpolynomial_plain_is_equal(opt, bound);
        else if (sign > 0)
                ok = isl_qpolynomial_le_cst(opt, bound);
        else
@@ -225,10 +227,10 @@ static int check_solution(__isl_take isl_pw_qpolynomial_fold *pwf,
 int main(int argc, char **argv)
 {
        isl_ctx *ctx;
-       isl_pw_qpolynomial *pwqp;
        isl_pw_qpolynomial_fold *copy;
        isl_pw_qpolynomial_fold *pwf;
        struct isl_stream *s;
+       struct isl_obj obj;
        struct bound_options *options;
        int exact;
        int r = 0;
@@ -240,8 +242,16 @@ int main(int argc, char **argv)
        ctx = isl_ctx_alloc_with_options(bound_options_arg, options);
 
        s = isl_stream_new_file(ctx, stdin);
-       pwqp = isl_stream_read_pw_qpolynomial(s);
-       pwf = isl_pw_qpolynomial_fold_from_pw_qpolynomial(isl_fold_max, pwqp);
+       obj = isl_stream_read_obj(s);
+       if (obj.type == isl_obj_pw_qpolynomial)
+               pwf = isl_pw_qpolynomial_fold_from_pw_qpolynomial(isl_fold_max,
+                                                                 obj.v);
+       else if (obj.type == isl_obj_pw_qpolynomial_fold)
+               pwf = obj.v;
+       else {
+               obj.type->free(obj.v);
+               isl_die(ctx, isl_error_invalid, "invalid input", goto error);
+       }
 
        if (options->verify)
                copy = isl_pw_qpolynomial_fold_copy(pwf);
@@ -259,6 +269,7 @@ int main(int argc, char **argv)
                isl_pw_qpolynomial_fold_free(pwf);
        }
 
+error:
        isl_stream_free(s);
 
        isl_ctx_free(ctx);