#8986: Add support for convex rational polyhedral cones
----------------------------------+-----------------------------------------
   Reporter:  novoselt            |       Owner:  mhampton  
       Type:  enhancement         |      Status:  needs_work
   Priority:  major               |   Milestone:  sage-4.4.4
  Component:  geometry            |    Keywords:            
     Author:  Andrey Novoseltsev  |    Upstream:  N/A       
   Reviewer:  Volker Braun        |      Merged:            
Work_issues:                      |  
----------------------------------+-----------------------------------------

Comment(by vbraun):

 No, I definitely want `__contains__()` and `contains()` to be the same.
 I'm only concerned that a novice user of the package will write
 {{{
 sage: cone = Cone([[1,0],[0,1]])
 sage: (1,1) in cone
 False
 }}}
 and get the (in his eyes) wrong answer without any clue as to what went
 wrong. If that would be my first interaction with the package, I'd be
 convinced that its computations cannot be trusted :-). Once you understand
 the code it is of course obvious why it returned False. The difference to
 your example, where a ring is not in a graph, is that here it depends on
 the details of the coercion (or not) between `ZZ^n` and `ToricLattice`
 that will not be familiar to all users.

 One could narrow it down to only raise an exception on tests that run into
 this problem, like a test along the lines of
 {{{
 if (!is_ToricLatticeElement(n)):
   try:
     [ ZZ(i) for i in n ]
     raise ValueError, 'You probably want '+str(n)+' to be a N-lattice
 element.'
   except:
     return False   # whatever n is, its not in the cone
 }}}
 Let me know what you think!

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8986#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to