#10562: File ecpp.py added to sage: provides primality proving via Goldwasser-
Kilian and Atkin-Morain (ECPP)
--------------------------------+-------------------------------------------
   Reporter:  gh...@…           |       Owner:  was                             
            
       Type:  enhancement       |      Status:  needs_review                    
            
   Priority:  major             |   Milestone:                                  
            
  Component:  number theory     |    Keywords:  ecpp, goldwasser, kilian, 
primality, proving
     Author:  Georg Hahn        |    Upstream:  N/A                             
            
   Reviewer:                    |      Merged:                                  
            
Work_issues:                    |  
--------------------------------+-------------------------------------------

Comment(by robertwb):

 Replying to [comment:6 gh...@…]:
 > Hi!
 >
 > * thanks for your help on "from ... import": it makes sense only to
 import top-level
 functions. I'll change that.

 Thanks.

 > * concerning Cython: computing primality proofs can take a long time for
 large numbers, so I used to load my file "ecpp.py" (the same as appended
 to this ticket) as .pyx file (command load "ecpp.pyx") to make sage
 compile it (loading it as .py or .pyx made a huge difference in speed on
 my computer). Therefore, it made sense to me to include it into sage as
 .pyx as well.
 > It's no problem to add ecpp as devel/sage/sage/rings/ecpp.py again, but
 won't it be much slower afterwards?

 I am (very pleasantly) surprised that Cython was able to make your code
 significantly faster with no work on your part. In that case, .pyx is
 fine.

 > * I could rewrite it as Python class, but normally I'd prefer to use
 basic data structures and a normal list is enough to store a certificate.

 In general, classes are preferred in Sage, as a list is rather meaningless
 without context. For example, [1,0,1,0,35] could be an elliptic curve,
 polynomial, point counts, or whatever. It also is a good place to put a
 method for verification (as verify_certificate is more likely to invoke
 recollections of ssl than primality proving).

 Also, it'd probably be more Pythonic to return None or raise an exception
 if the number is not prime.

 > I'll prepare a class for ecpp... Is it possible to include the class in
 a Cython file (and thus to make it run fast again)?

 Yes, classes work just fine in Cython.

 - Robert

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