#4155: [with patch, needs review] Speed up totally real field enumeration code
---------------------------+------------------------------------------------
 Reporter:  craigcitro     |        Owner:  craigcitro
     Type:  defect         |       Status:  new       
 Priority:  major          |    Milestone:  sage-3.1.3
Component:  number theory  |   Resolution:            
 Keywords:                 |  
---------------------------+------------------------------------------------
Comment (by jvoight):

 Thanks!  I tried your patch against my (presumably clean upgraded)
 3.1.2 and it tells me:

 sage: hg_sage.import_patch('trac-4155.patch')
 Not trusting file /usr/local/sage/devel/sage-main/.hg/hgrc from
 untrusted user lkost, group lkost
 Not trusting file /usr/local/sage/devel/sage-main/.hg/hgrc from
 untrusted user lkost, group lkost
 applying /home/jvoight/trac-4155.patch
 abort: no diffs found
 cd "/usr/local/sage/devel/sage" && hg status
 cd "/usr/local/sage/devel/sage" && hg status
 cd "/usr/local/sage/devel/sage" && hg import
 "/home/jvoight/trac-4155.patch"
 sage: len(enumerate_totallyreal_fields_prim(5,5**7))
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /home/jvoight/<ipython console> in <module>()

 /home/jvoight/totallyreal.pyx in
 sage.rings.number_field.totallyreal.enumerate_totallyreal_fields_prim
 (sage/rings/number_field/totallyreal.c:4360)()

 TypeError: Cannot convert int to sage.libs.pari.gen.gen

 Maybe there's something going on with nfbasis_d?  That was the only
 thing that came up as a possible conflict when I upgraded to 3.1.2.

    def nfbasis_d(self, long flag=0, p=0):
        """
        nfbasis_d(x): Return a basis of the number field defined over
        QQ by x and its discriminant.

        EXAMPLES:
            sage: F = NumberField(x^3-2,'alpha')
            sage: F._pari_()[0].nfbasis_d()
            ([1, x, x^2], -108)

            sage: G = NumberField(x^5-11,'beta')
            sage: G._pari_()[0].nfbasis_d()
            ([1, x, x^2, x^3, x^4], 45753125)

            sage: pari([-2,0,0,1]).Polrev().nfbasis_d()
            ([1, x, x^2], -108)
        """
        cdef gen d
        cdef GEN g

        if p:
            g = (<gen>self.pari(p)).g
        else:
            g = <GEN>NULL
        d = self.pari(0)
        _sig_on
        nfb = self.new_gen(nfbasis(self.g, &d.g, flag, g))
        return nfb, d.__int__()

 JV

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4155#comment:1>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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