
Manoj Rajagopalan wrote:
Hi all
How do I check if a point is contained within a polyhedron?
Dear Manoj,
a point is just one kind of polyhedra generator. To compute the relation between a polyhedron and a generator, you do something like
Poly_Gen_Relation rel = ph.relation_with(g),
assuming `ph' is the polyhedron and `g' is the point you are interested in. If `rel' so computed turns out to be equal to
Poly_Gen_Relation::subsumes(),
then you know `ph' subsumes `g', i.e., that adding the generator `g' to `ph' would not change `ph', i.e., that `ph' already contains `g'.
Firstly, how do i represent the point? in terms of X, Y, Z where these are declared to be of type Variable?
You can do something like
Generator g = point(X + 2*Y - 3*Z).
Would someone have any example code snippets to illustrate related points?
You can find more examples in the library's documentation and in the `tests' directory of the PPL distribution.
thanks Manoj Rajagopalan
All the best,
Roberto