add isl_union_pw_aff_{min,max}_val
commitf998a8add6da22b03e417baf6ba4ab2a8c182d3c
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Thu, 21 Jun 2018 13:54:21 +0000 (21 15:54 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Thu, 28 Jun 2018 12:51:27 +0000 (28 14:51 +0200)
tree8eec30fcc8dd3d1cec4936f33d8cdcc3284ccc55
parent5c31a00f7b2adc7dbc756655bac4c82be2fe418f
add isl_union_pw_aff_{min,max}_val

The function isl_union_pw_aff_min_val performs an operation
that is similar to that of isl_union_set_min_multi_union_pw_aff.
In fact, it performs the same operation that is performed
on each of the base expressions in the isl_multi_union_pw_aff
argument.  However, the interface chosen for isl_union_pw_aff_min_val
is different from that of isl_union_set_min_multi_union_pw_aff.
In particular, it only takes a single argument.
It is not clear why isl_union_set_min_multi_union_pw_aff takes
an explicit domain argument since an isl_multi_union_pw_aff
already has a definition domain.  In fact, each base expression
has its own definition domain.  The extra argument may have
been introduced in analogy with the functions taking an isl_aff
function, but an isl_aff is always total, so there it makes
sense for the user to need to specify a domain.
Taking only a single argument should be more convenient and
less confusing.  A further restriction of the domain can
always be achieved by intersecting the domain prior
to the call to isl_union_pw_aff_min_val.
This should not have a dramatic effect on the performance,
since isl_union_set_min_multi_union_pw_aff also performs
this intersection, be it that it does so in pieces and that
the intersected pieces do not need to be kept throughout the call.

The function isl_union_pw_aff_max_val performs
the same operation but computes the maximum instead of the minimum.

The functions take their argument rather than keeping it
like isl_set_min_val does because most operations that return
a new object take their arguments.
The "val" suffix reflects the fact that an isl_val
is returned, emphasizing that the result is not a parametric
expression computed over the domain, but a fixed value
computed over all possible parameter values.

It would have been possible to implement these functions
in terms of the original internals of isl_union_set_min_multi_union_pw_aff,
but the modified internals will also be useful
for implementing isl_multi_union_pw_aff_{min,max}_multi_val,
which cannot easily be implemented in terms of
isl_union_set_min_multi_union_pw_aff.

Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
doc/user.pod
include/isl/ilp.h
isl_ilp.c