Ticket #3674: sage-trac3674d.patch

File sage-trac3674d.patch, 1.4 KB (added by cremona, 9 years ago)
  • sage/schemes/elliptic_curves/ell_rational_field.py

    # HG changeset patch
    # User John Cremona <john.cremona@gmail.com>
    # Date 1217389855 14400
    # Node ID 85af4c323950566913348bddd4be5c7f3893653e
    # Parent  4bb3dbd8745648726c2682b39070b1d78b0c7ddb
    trac#3674:  fix rank 0 case
    
    diff -r 4bb3dbd87456 -r 85af4c323950 sage/schemes/elliptic_curves/ell_rational_field.py
    a b class EllipticCurve_rational_field(Ellip 
    39083908        ######################################################################
    39093909   
    39103910        if (r == 0):
    3911             pts = self.torsion_points()
    3912             pts = [P for P in pts if P[0].is_integral()]
    3913             pts.sort()
    3914             return pts
     3911            int_points = self.torsion_points()
     3912            int_points = [P for P in int_points if not P.is_zero()]
     3913            int_points = [P for P in int_points if P[0].is_integral()]
     3914            if both_signs:
     3915                int_points = list(set(int_points)) # remove duplicates
     3916            else:
     3917                xlist = set([P[0] for P in int_points])
     3918                int_points = [self.lift_x(x) for x in xlist]
     3919            int_points.sort()
     3920            if verbose:
     3921                print 'Total number of integral points:',len(int_points)
     3922            return int_points
     3923
    39153924
    39163925        e = R(1).exp()
    39173926        pi = R(constants.pi)