#10112: random_prime  does not handle erroneous input gracefully - it hangs
-------------------------------------------+--------------------------------
   Reporter:  drkirkby                     |       Owner:  was       
       Type:  defect                       |      Status:  needs_work
   Priority:  major                        |   Milestone:  sage-4.6.1
  Component:  number theory                |    Keywords:            
     Author:  Mike Hansen, Francis Clarke  |    Upstream:  N/A       
   Reviewer:  David Kirkby                 |      Merged:            
Work_issues:                               |  
-------------------------------------------+--------------------------------
Changes (by burcin):

  * status:  needs_review => needs_work


Comment:

 Can we create a fast but unsafe function `random_prime_unsafe()` and make
 the `random_prime()` function exposed to the users call that?

 ATM, the `random_prime()` function is used in speed critical code. See
 `sage/ext/multi_modular.pyx` for example. In this use case, the checks are
 unnecessary and they would cause a dramatic slow down. We should be able
 to bypass the checks when we know the input makes sense. I suggest
 separating the core of the function from the code that makes it idiot-
 proof, and using the core directly in places like
 `sage/ext/multi_modular.pyx`.

 When this change is made, there should be a clear and loud warning in the
 release notes to notify people who rely on the current behavior of
 `random_prime()` to switch to this unsafe version in their personal
 codebase as well.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10112#comment:11>
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