#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)
{
unsigned nparam;
struct verify_point_bound *vpb = (struct verify_point_bound *) user;
isl_int t;
+ isl_ctx *ctx;
isl_pw_qpolynomial_fold *pwf;
isl_qpolynomial *bound = NULL;
isl_qpolynomial *opt = NULL;
isl_set *dom = NULL;
+ isl_printer *p;
const char *minmax;
int bounded;
int sign;
sign = -1;
}
+ ctx = isl_point_get_ctx(pnt);
+ p = isl_printer_to_file(ctx, out);
+
isl_int_init(t);
pwf = isl_pw_qpolynomial_fold_copy(vpb->pwf);
goto error;
if (vpb->options->print_all || !ok) {
- fprintf(out, "%s(", minmax);
+ p = isl_printer_print_str(p, minmax);
+ p = isl_printer_print_str(p, "(");
for (i = 0; i < nparam; ++i) {
if (i)
- fprintf(out, ", ");
+ p = isl_printer_print_str(p, ", ");
isl_point_get_coordinate(pnt, isl_dim_param, i, &t);
- isl_int_print(out, t, 0);
+ p = isl_printer_print_isl_int(p, t);
}
- fprintf(out, ") = ");
- isl_qpolynomial_print(bound, out, ISL_FORMAT_ISL);
- fprintf(out, ", %s = ", bounded ? "opt" : "sample");
- isl_qpolynomial_print(opt, out, ISL_FORMAT_ISL);
+ p = isl_printer_print_str(p, ") = ");
+ p = isl_printer_print_qpolynomial(p, bound);
+ p = isl_printer_print_str(p, ", ");
+ p = isl_printer_print_str(p, bounded ? "opt" : "sample");
+ p = isl_printer_print_str(p, " = ");
+ p = isl_printer_print_qpolynomial(p, opt);
if (ok)
- fprintf(out, ". OK\n");
+ p = isl_printer_print_str(p, ". OK");
else
- fprintf(out, ". NOT OK\n");
+ p = isl_printer_print_str(p, ". NOT OK");
+ p = isl_printer_end_line(p);
} else if ((vpb->n % vpb->stride) == 0) {
- printf("o");
- fflush(stdout);
+ p = isl_printer_print_str(p, "o");
+ p = isl_printer_flush(p);
}
if (0) {
isl_int_clear(t);
+ isl_printer_free(p);
+
if (!ok)
vpb->error = 1;
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);
obj = isl_stream_read_obj(s);