Ticket #10001: 10001_remove_sea.patch

File 10001_remove_sea.patch, 2.3 KB (added by jdemeyer, 10 years ago)
  • deleted file sage/schemes/elliptic_curves/sea.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1285327616 -7200
    # Node ID 0e63448ae16cf420962695bdb1cc21f2b8e7207e
    # Parent  6f205afeaced1de062d20884299dc18b3910e5ab
    #10001: Remove sage/schemes/elliptic_curves/sea.py
    
    diff -r 6f205afeaced -r 0e63448ae16c sage/schemes/elliptic_curves/sea.py
    + -  
    1 """
    2 SEA: Schoof, Elkies, Atkins point counting
    3 
    4 Interface to the GP SEA implementation of Christophe Doche and Sylvain
    5 Duquesne.
    6 """
    7 
    8 #*****************************************************************************
    9 #       Copyright (C) 2005 William Stein <wstein@gmail.com>
    10 #
    11 #  Distributed under the terms of the GNU General Public License (GPL)
    12 #
    13 #    This code is distributed in the hope that it will be useful,
    14 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
    15 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    16 #    General Public License for more details.
    17 #
    18 #  The full text of the GPL is available at:
    19 #
    20 #                  http://www.gnu.org/licenses/
    21 #*****************************************************************************
    22 
    23 from sage.interfaces.gp import Gp
    24 from sage.rings.all import Integer
    25 
    26 gp = None
    27 def ellsea(E, p, early_abort=False):
    28     """
    29     INPUT:
    30         E -- list of 5 integers that defines an elliptic curve
    31         p -- prime number
    32         early_abort -- bool (default: False); if True an early abort
    33                        technique is used and the computation is
    34                        interrupted as soon as a small divisor of the
    35                        order is detected.  The function then returns
    36                        0.  This is useful for ruling out curves whose
    37                        cardinality is divisible by a small prime.
    38     """
    39     global gp
    40     if gp is None:
    41         gp = Gp(script_subdirectory='SEA')
    42         gp.eval('allocatemem();allocatemem();allocatemem();allocatemem();allocatemem();allocatemem()')
    43         gp.read("sea.gp")
    44 
    45     gp.eval('E = ellinit(%s*Mod(1,%s));'%(E,p))
    46     N = gp.eval("ellsea(E,%s,0,%s)"%(p,int(early_abort)))
    47     if N.find("*") != -1:
    48         raise RuntimeError, "Error: '%s'"%N
    49     return Integer(N)