Hi Vincent,
that's actually not true, have you checked it?
The code
elif Vobj.is_vertex():
return (self.polyhedron()._is_positive( self.eval(Vobj) ) and
not self.polyhedron()._is_zero( self.eval(Vobj) ) )
inside interior_contains in representations.py gives
sage: P = polytopes.regular_polygon(5, base_ring=RDF)
sage: sage: a_vertex = P.vertices()[0]
sage: sage: for facet in P.Hrepresentation(): print
facet.contains(a_vertex), facet.interior_contains(a_vertex)
True True
True False
True True
True False
True True
Whether this is the correct way to go is an entirely different question -
all I'm saying is that _is_positive checks (with fuzziness) whether that
the argument is non-negative, but not whether it is non-zero. Maybe that is
what should be changed.
Am Dienstag, 13. Oktober 2015 12:19:50 UTC+2 schrieb vdelecroix:
>
> On 13/10/15 06:48, Jan Keitel wrote:
> > In this particular case the problem can probably be resolved by being
> > a bit stricter with the check in interior_contains:
> >
> > Instead of checking
> >
> > return self.polyhedron()._is_positive( self.eval(Vobj) )
> >
> > one should have
> >
> > return self.polyhedron()._is_positive( self.eval(Vobj) )
> > and not
> > self.polyhedron()._is_zero( self.eval(Vobj) )
>
> This will not solve the problem! _is_positive(x) returns (x >= -1e-6)...
> which is exactly the same thing as _is_nonneg(x)... You will also get
> False positive and True negative, won't you? For example, you can be out
> of the polytope but get from _is_positive that you are inside.
>
> I would go for:
> - a warning for non exact rings (using the method .is_exact())
> - using _is_positive for non exact rings
>
> Though, using intensively _is_positive or _is_nonneg might significantly
> slows down the code (it is one more Python function call).
>
> Vincent
>
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.