Am 24.02.2011 19:29, schrieb Dmitri:
>> A chosen set of points is convex if it is equal to its convex hull. 

as far as I see this is equivalent to, all points are on a facet of the
polytope.

> I think my problem is actually doing the comparison. So I have this
> chosen set of points which I don't know is convex. I compute its
> convex hull. Now how do I compare these two objects?
> 
> Dmitri
> 

you can try someting like this:
len([i for i in range(foo.npoints()) if any([i in face.points() for face
in foo.facets()])]) == foo.npoints()

ths is not a nice way to do but it works. maybe it would be nice to put
this into a property of a latticepolytope.

some littel explanation to the piece of code:
we count all points of foo, which lay on some facet of foo. (those
points are just numbered and you can get the value of it by
foo.point(index) but this doesnt matter here because they are indexed in
by the same number in the facets too) and compare them to the total
number of points in foo (and on its boundary)
As long as my comment above is correct (and as long as I got the point
of your problem) this should work.

greatz Johannes

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to