isl_basic_map_detect_equalities: explicitly keep track of any equalities found
commiteea1e6f375d9b1354891bc2f3ea904fef7742207
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 13 Aug 2009 14:01:56 +0000 (13 16:01 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 13 Aug 2009 14:01:56 +0000 (13 16:01 +0200)
tree6716d606c7ecb7ee2ae792c6c77ae55868013d8e
parent8e5e655cb2857d9bd98541379cf2db8c73676deb
isl_basic_map_detect_equalities: explicitly keep track of any equalities found

The way extend_affine_hull works is that it starts off from an
under-approximation of the affine hull and then extends it with
each extra point found outside of the current approximation.
The affine hull is then determined by the equalities that remain.

However, during the computation, we may find an equality in
the current approximation such that there is no point in the set
outside of this equality.  If the approximation is later extended
with a point found outside some other equality, then this first
equality would get tested again.  If this is a difficult computation,
then we needlessly go through it again.

By explicitly storing the equality that we have detected in the set,
this computation becomes trivial, to there is no real harm in doing
again.  An alternative would be to keep track of all equalities found
in some additional data structure, but adding it to the original set
seems preferable since it may also simplify tests for points outside
other equalities.

Perhaps the calling convention should be changed such that
extend_affine_hull would return the original set intersected
with its affine hull, rather than the affine hull itself.
isl_affine_hull.c