barvinok_enumerate_with_options: handle context constraints on 0D input
commit843883c52c160fb3b2fa128b30ec025da443ee14
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 22 Jun 2014 07:10:20 +0000 (22 09:10 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 22 Jun 2014 07:10:20 +0000 (22 09:10 +0200)
treefc9e1f5542baec2b754b90fc853c42e1561ccc68
parent259b33a49afe4f2236e07822e50cff72545127e0
barvinok_enumerate_with_options: handle context constraints on 0D input

When the input of the internal enumerate has the same dimension
as the context, its constraints are moved to the context while
the input itself is replaced by a universe 0D polytope, resulting
in an evalue with value 1 on the constraints moved to the context.
The original context constraints would inadvertedly get dropped,
however.  Add them back.

For example, for this input

    0 3

    1 3
    1 1 0

we would mistakenly produce

      1 >= 0

    1

instead of the correct

     P  >= 0
      1 >= 0

    1

No test case is added because the default test mechanism only
checks the results inside the context and so it would not notice
that the result also has a non-zero value outside the context.
A specialized test case does not seem worth it as this is
an obsolescent interface and the new interface does not have
this problem since it internally calls enumerate with a universe context.

Reported-by: Thomas Kahle <tomka@gentoo.org>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
barvinok.cc