#include <assert.h>
-#include <isl_stream.h>
+#include <isl/stream.h>
#include <isl_polynomial_private.h>
#include <isl_scan.h>
+#include <isl/options.h>
struct bound_options {
struct isl_options *isl;
int continue_on_error;
};
-struct isl_arg bound_options_arg[] = {
-ISL_ARG_CHILD(struct bound_options, isl, "isl", isl_options_arg, "isl options")
+ISL_ARGS_START(struct bound_options, bound_options_args)
+ISL_ARG_CHILD(struct bound_options, isl, "isl", &isl_options_args,
+ "isl options")
ISL_ARG_BOOL(struct bound_options, verify, 'T', "verify", 0, NULL)
ISL_ARG_BOOL(struct bound_options, print_all, 'A', "print-all", 0, NULL)
ISL_ARG_BOOL(struct bound_options, continue_on_error, '\0', "continue-on-error", 0, NULL)
-ISL_ARG_END
-};
+ISL_ARGS_END
-ISL_ARG_DEF(bound_options, struct bound_options, bound_options_arg)
+ISL_ARG_DEF(bound_options, struct bound_options, bound_options_args)
static __isl_give isl_set *set_bounds(__isl_take isl_set *set)
{
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;
int bounded;
int sign;
int ok;
- int cst;
FILE *out = vpb->options->print_all ? stdout : stderr;
vpb->n--;
else
opt = isl_pw_qpolynomial_fold_min(isl_pw_qpolynomial_fold_copy(pwf));
+ nvar = isl_set_dim(dom, isl_dim_set);
+ opt = isl_qpolynomial_project_domain_on_params(opt);
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
int i, r, n;
dom = isl_pw_qpolynomial_fold_domain(isl_pw_qpolynomial_fold_copy(pwf));
- context = isl_set_remove_dims(isl_set_copy(dom), isl_dim_set,
- 0, isl_set_dim(dom, isl_dim_set));
+ context = isl_set_params(isl_set_copy(dom));
context = isl_set_remove_divs(context);
context = set_bounds(context);
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;
assert(options);
argc = bound_options_parse(options, argc, argv, ISL_ARG_ALL);
- ctx = isl_ctx_alloc_with_options(bound_options_arg, options);
+ ctx = isl_ctx_alloc_with_options(&bound_options_args, 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);
isl_pw_qpolynomial_fold_free(pwf);
}
+error:
isl_stream_free(s);
isl_ctx_free(ctx);