~ubuntu-branches/ubuntu/wily/cloog/wily-proposed

« back to all changes in this revision

Viewing changes to isl/bound.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2015-04-24 15:07:57 UTC
  • mfrom: (3.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20150424150757-wumy8mdonvtgf29j
Tags: 0.18.3-1
* New upstream version.
* Update symbols file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <assert.h>
2
2
#include <isl/stream.h>
 
3
#include <isl_map_private.h>
3
4
#include <isl_polynomial_private.h>
4
5
#include <isl_scan.h>
5
6
#include <isl/options.h>
 
7
#include <isl/deprecated/point_int.h>
 
8
#include <isl/deprecated/polynomial_int.h>
6
9
 
7
10
struct bound_options {
8
11
        struct isl_options      *isl;
64
67
        isl_int t;
65
68
        isl_ctx *ctx;
66
69
        isl_pw_qpolynomial_fold *pwf;
67
 
        isl_qpolynomial *bound = NULL;
68
 
        isl_qpolynomial *opt = NULL;
 
70
        isl_val *bound = NULL;
 
71
        isl_val *opt = NULL;
69
72
        isl_set *dom = NULL;
70
73
        isl_printer *p;
71
74
        const char *minmax;
117
120
                opt = isl_pw_qpolynomial_fold_min(isl_pw_qpolynomial_fold_copy(pwf));
118
121
 
119
122
        nvar = isl_set_dim(dom, isl_dim_set);
120
 
        opt = isl_qpolynomial_project_domain_on_params(opt);
121
123
        if (vpb->exact && bounded)
122
 
                ok = isl_qpolynomial_plain_is_equal(opt, bound);
 
124
                ok = isl_val_eq(opt, bound);
123
125
        else if (sign > 0)
124
 
                ok = isl_qpolynomial_le_cst(opt, bound);
 
126
                ok = isl_val_le(opt, bound);
125
127
        else
126
 
                ok = isl_qpolynomial_le_cst(bound, opt);
 
128
                ok = isl_val_le(bound, opt);
127
129
        if (ok < 0)
128
130
                goto error;
129
131
 
137
139
                        p = isl_printer_print_isl_int(p, t);
138
140
                }
139
141
                p = isl_printer_print_str(p, ") = ");
140
 
                p = isl_printer_print_qpolynomial(p, bound);
 
142
                p = isl_printer_print_val(p, bound);
141
143
                p = isl_printer_print_str(p, ", ");
142
144
                p = isl_printer_print_str(p, bounded ? "opt" : "sample");
143
145
                p = isl_printer_print_str(p, " = ");
144
 
                p = isl_printer_print_qpolynomial(p, opt);
 
146
                p = isl_printer_print_val(p, opt);
145
147
                if (ok)
146
148
                        p = isl_printer_print_str(p, ". OK");
147
149
                else
158
160
        }
159
161
 
160
162
        isl_pw_qpolynomial_fold_free(pwf);
161
 
        isl_qpolynomial_free(bound);
162
 
        isl_qpolynomial_free(opt);
 
163
        isl_val_free(bound);
 
164
        isl_val_free(opt);
163
165
        isl_point_free(pnt);
164
166
        isl_set_free(dom);
165
167