Re: [PPL-devel] integer versus rational solutions

On Wed, 8 Jul 2009, Michael Classen wrote:
HTH. Let me know if you have further queries wrt this domain, we will glad to help.
Pat
Hi Pat,
I basically just want to know if I can get correct integer results when using this combination of datatypes. I want to use operations like union, intersection, projection, basically most standard operations you want to use on polytopes.
Yes. These are already available in the latest release, but the best version of the product domain is in the products branch of the GIT repository. I would recommend you to use that if possible.
Sorry, I did not reply sooner to your previous email. I did try and see what could be done to help solve the problem you described. (i.e., transforming a grid x polyhedron product to one where the grid is the integer lattice). In fact, I have a proposal for adding a method to the product domain that I hope would be sufficient for what you need while, from the point of view of the PPL, fits into the existing structures. In particular, I am believe that the implementation work would be small!
That is: In the product domain, (assuming for this explanation that the first domain is a grid and the second a C polyhedron) there would be a method such as:
bool Partially_Reduced_Product<Grid, C_Polyhedron, R> ::affine_lattice_transform(const Grid& gr1)
that assigns to *this = <gr, ph> the product <gr1, ph1> such that there is an affine function (ie a sequence of affine image mappings) T, T(gr) = gr1 and T(ph) = ph1.
If there is no invertible affine function T such that T(gr) = gr1, then the method could return false and otherwise true.
If you call the method with gr1 = integral lattice, and gr as a full dimensional discrete grid you will get the polyhedron transformed to one where the integral points correspond to the grid points and you can use whatever tools you like to count the number of integer points. By calling the same method with this* = <gr1, ph1> with the argument gr, you will be able to invert the operation.
I can try and implement something like this next week (while away at a conference) as I think this would be useful anyway for other applications.
Best wishes, Pat
participants (1)
-
P M Hill