
On Wed, 20 Jul 2005, Mario Mendez wrote:
Hi again,
I wonder if there is any way (by using the API) to discover which dimensions are equal. Right now, I inspect the constraint system looking for 1*X + -1 *Y = 0, but that 'ad-hoc' solution simply does not look right. Can you help me? Thanks!
Hi,
Inspecting the constraints is definitely not the right way to check if X=Y. There is no guarantee as to the exact form of a constraint system for the polyhedron returned to the user. So the constraint X = Y may be implied by the other constraints but not explicitly in the constraint system.
(Assuming Prolog, but the solution I think would be similar for the C or C++ API)
To see if the constraint X = Y is satisfied by all the points in a polyhedron, there is the predicate ppl_Polyhedron_relation_with_constraint/3
If Poly is your polyhedron and X, Y your dimensions, the query ppl_Polyhedron_relation_with_constraint(Poly, X = Y, R). will unify R with a list of relations one of which will be "included_in" if and only if the constraint X = Y is satisfied by all the points in Poly.
With regards to your stated problem of finding _which_ dimensions are equal, I do not know of any way other than by checking all the pairs of dimensions X and Y and checking if X = Y holds using a method such as that given above.
Can you say what it is about your application that led to such a query?
Best wishes, Pat