Ticket #9511: trac_9511_givaro_3_7_x.2.patch

File trac_9511_givaro_3_7_x.2.patch, 21.5 KB (added by vbraun, 10 years ago)

Rebased patch

  • module_list.py

    # HG changeset patch
    # User Martin Albrecht <martinralbrecht@googlemail.com>
    # Date 1339422258 -3600
    # Node ID c39a3884995d24b7bcaf2f5c5ca6489eefebce3c
    # Parent  ce81480a1d287059740c96504e5763639d836f67
    #9511 update Givaro to 3.7.0 (patch applies to Sage 5.1.beta5 and above)
    
    diff --git a/module_list.py b/module_list.py
    a b  
    7272
    7373singular_libs = ['m', 'readline', 'singular', 'givaro', 'ntl', 'gmpxx', 'gmp']
    7474
     75
     76#########################################################
     77### Givaro flags
     78#########################################################
     79
     80givaro_extra_compile_args =['-D__STDC_LIMIT_MACROS']
     81
    7582#########################################################
    7683### PolyBoRi defines
    7784#########################################################
     
    614621              libraries = ['linboxsage', 'ntl', 'linbox',
    615622                           'stdc++', 'givaro', 'gmp', 'gmpxx', BLAS, BLAS2],
    616623              language = 'c++',
     624              extra_compile_args = givaro_extra_compile_args,
    617625              depends = [SAGE_INC + 'givaro/givconfig.h']),
    618626
    619627    Extension('sage.libs.lcalc.lcalc_Lfunction',
     
    668676              libraries = singular_libs,
    669677              language="c++",
    670678              include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'],
    671               depends = singular_depends),
     679              depends = singular_depends,
     680              extra_compile_args = givaro_extra_compile_args),
    672681   
    673682    Extension('sage.libs.singular.polynomial',
    674683              sources = ['sage/libs/singular/polynomial.pyx'],
    675684              libraries = singular_libs,
    676685              language="c++",
    677686              include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'],
    678               depends = singular_depends),
     687              depends = singular_depends,
     688              extra_compile_args = givaro_extra_compile_args),
    679689
    680690    Extension('sage.libs.singular.ring',
    681691              sources = ['sage/libs/singular/ring.pyx'],
    682692              libraries = singular_libs,
    683693              language="c++",
    684694              include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'],
    685               depends = singular_depends),
     695              depends = singular_depends,
     696              extra_compile_args = givaro_extra_compile_args),
    686697
    687698    Extension('sage.libs.singular.groebner_strategy',
    688699              sources = ['sage/libs/singular/groebner_strategy.pyx'],
    689700              libraries = singular_libs,
    690701              language="c++",
    691702              include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'],
    692               depends = singular_depends),
     703              depends = singular_depends,
     704              extra_compile_args = givaro_extra_compile_args),
    693705
    694706    Extension('sage.libs.singular.function',
    695707              sources = ['sage/libs/singular/function.pyx'],
    696708              libraries = singular_libs,
    697709              language="c++",
    698710              include_dirs = [SAGE_INC +'singular', SAGE_INC + 'factory'],
    699               depends = singular_depends),
     711              depends = singular_depends,
     712              extra_compile_args = givaro_extra_compile_args),
    700713
    701714    Extension('sage.libs.singular.option',
    702715              sources = ['sage/libs/singular/option.pyx'],
    703716              libraries = singular_libs,
    704717              language="c++",
    705718              include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'],
    706               depends = singular_depends),
     719              depends = singular_depends,
     720              extra_compile_args = givaro_extra_compile_args),
    707721
    708722    Extension('sage.libs.symmetrica.symmetrica',
    709723              sources = ["sage/libs/symmetrica/%s"%s for s in ["symmetrica.pyx"]],
     
    966980              libraries = ['m4rie', 'm4ri', 'givaro', 'ntl', 'gmpxx', 'gmp', 'm', 'stdc++'],
    967981              depends = [SAGE_INC + "m4rie/m4rie.h"],
    968982              include_dirs = [SAGE_INC + 'm4rie'],
    969               extra_compile_args = m4ri_extra_compile_args,
     983              extra_compile_args = m4ri_extra_compile_args + givaro_extra_compile_args,
    970984              language="c++"),
    971985
    972986    Extension('sage.matrix.matrix_modn_dense',
     
    977991              sources = ['sage/matrix/matrix_modn_dense_float.pyx'],
    978992              language="c++",
    979993              libraries = ['linbox', 'givaro', 'gmpxx', 'gmp', BLAS, BLAS2],
    980               extra_compile_args = ['-DDISABLE_COMMENTATOR']),
     994              extra_compile_args = ['-DDISABLE_COMMENTATOR'] + givaro_extra_compile_args),
    981995
    982996    Extension('sage.matrix.matrix_modn_dense_double',
    983997              sources = ['sage/matrix/matrix_modn_dense_double.pyx'],
    984998              language="c++",
    985999              libraries = ['linbox', 'givaro', 'gmpxx', 'gmp', BLAS, BLAS2],
    986               extra_compile_args = ['-DDISABLE_COMMENTATOR']),
     1000              extra_compile_args = ['-DDISABLE_COMMENTATOR'] + givaro_extra_compile_args),
    9871001
    9881002    Extension('sage.matrix.matrix_modn_sparse',
    9891003              sources = ['sage/matrix/matrix_modn_sparse.pyx'],
     
    9941008              libraries = singular_libs,
    9951009              language="c++",
    9961010              include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'],
    997               depends = singular_depends),
     1011              depends = singular_depends,
     1012              extra_compile_args = givaro_extra_compile_args),
    9981013
    9991014    #Extension('sage.matrix.matrix_pid_dense',
    10001015    #          sources = ['sage/matrix/matrix_pid_dense.pyx']),
     
    14461461              sources = ["sage/rings/finite_rings/element_givaro.pyx"],
    14471462              # this order is needed to compile under windows.
    14481463              libraries = ['givaro', 'ntl', 'gmpxx', 'gmp', 'm', 'stdc++', ],
    1449               language='c++'),
     1464              language='c++',
     1465              extra_compile_args = givaro_extra_compile_args),
    14501466
    14511467    Extension('sage.rings.finite_rings.element_ntl_gf2e',
    14521468              sources = ['sage/rings/finite_rings/element_ntl_gf2e.pyx'],
     
    15861602              libraries = singular_libs,
    15871603              language="c++",
    15881604              include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'],
    1589               depends = singular_depends),
     1605              depends = singular_depends,
     1606              extra_compile_args = givaro_extra_compile_args),
    15901607
    15911608    Extension('sage.rings.polynomial.plural',
    15921609              sources = ['sage/rings/polynomial/plural.pyx'],
    15931610              libraries = ['m', 'readline', 'singular', 'givaro', 'gmpxx', 'gmp'],
    15941611              language="c++",
    15951612              include_dirs = [SAGE_ROOT +'/local/include/singular'],
    1596               depends = [SAGE_ROOT + "/local/include/libsingular.h"]),
     1613              depends = [SAGE_ROOT + "/local/include/libsingular.h"],
     1614              extra_compile_args = givaro_extra_compile_args),
    15971615
    15981616    Extension('sage.rings.polynomial.multi_polynomial_libsingular',
    15991617              sources = ['sage/rings/polynomial/multi_polynomial_libsingular.pyx'],
    16001618              libraries = singular_libs,
    16011619              language="c++",
    16021620              include_dirs = [SAGE_INC + 'singular', SAGE_INC + 'factory'],
    1603               depends = singular_depends),
     1621              depends = singular_depends,
     1622              extra_compile_args = givaro_extra_compile_args),
    16041623
    16051624    Extension('sage.rings.polynomial.multi_polynomial_ring_generic',
    16061625              sources = ['sage/rings/polynomial/multi_polynomial_ring_generic.pyx']),
  • sage/matrix/constructor.py

    diff --git a/sage/matrix/constructor.py b/sage/matrix/constructor.py
    a b  
    10641064
    10651065        sage: K.<a>=FiniteField(3^2)
    10661066        sage: random_matrix(K, 2, 5)
    1067         [      1     2*a       1   a + 2       2]
    1068         [      a 2*a + 1       0       2       1]
    1069        
     1067        [      1       a       1 2*a + 1       2]
     1068        [    2*a   a + 2       0       2       1]
     1069
    10701070        sage: random_matrix(RR, 3, 4, density=0.66)
    10711071        [ 0.000000000000000 -0.806696574554030 -0.693915509972359  0.000000000000000]
    10721072        [ 0.629781664418083  0.000000000000000 -0.833709843116637  0.000000000000000]
  • sage/matrix/matrix2.pyx

    diff --git a/sage/matrix/matrix2.pyx b/sage/matrix/matrix2.pyx
    a b  
    98299829            sage: A.is_symmetric()
    98309830            True
    98319831            sage: L = A.cholesky()
    9832             sage: L
    9833             [            3             0             0]
    9834             [    4*a^2 + 1             1             0]
    9835             [      3*a + 2 a^2 + 2*a + 3             3]
    98369832            sage: L*L.transpose() == A
    98379833            True
    98389834
  • sage/matrix/matrix_space.py

    diff --git a/sage/matrix/matrix_space.py b/sage/matrix/matrix_space.py
    a b  
    14961496            [  -3 -1/3   -1]
    14971497            [   0   -1    1]
    14981498            sage: Mat(GF(9,'a'),3,sparse=True).random_element()
    1499             [    2*a       a       1]
    1500             [      2       1 2*a + 1]
    1501             [      a       2       2]
     1499            [    a   2*a     1]
     1500            [    2     1 a + 2]
     1501            [  2*a     2     2]
    15021502        """
    15031503        Z = self.zero_matrix().__copy__()
    15041504        if density is None:
  • sage/rings/finite_rings/constructor.py

    diff --git a/sage/rings/finite_rings/constructor.py b/sage/rings/finite_rings/constructor.py
    a b  
    7777    sage: k = GF(9, 'a')
    7878    sage: for i,x in enumerate(k):  print i,x
    7979    0 0
    80     1 2*a
     80    1 a
    8181    2 a + 1
    82     3 a + 2
     82    3 2*a + 1
    8383    4 2
    84     5 a
     84    5 2*a
    8585    6 2*a + 2
    86     7 2*a + 1
     86    7 a + 2
    8787    8 1
    8888    sage: for a in GF(5):
    8989    ...    print a
  • sage/rings/finite_rings/element_givaro.pxd

    diff --git a/sage/rings/finite_rings/element_givaro.pxd b/sage/rings/finite_rings/element_givaro.pxd
    a b  
    88    pass
    99
    1010cdef extern from "givaro/givrandom.h":
    11     ctypedef struct GivRandom "GivRandom":
     11    ctypedef struct GivRandom "Givaro::GivRandom":
    1212        pass
    1313
    14     GivRandom GivRandomSeeded  "GivRandom"(unsigned long seed)
     14    GivRandom GivRandomSeeded  "Givaro::GivRandom"(unsigned long seed)
    1515
    1616cdef extern from "givaro/givgfq.h":
    1717    ctypedef struct intvec "std::vector<unsigned int>":
     
    2323
    2424cdef extern from "givaro/givgfq.h":
    2525
    26     ctypedef struct GivaroGfq "GFqDom<int>":
     26    ctypedef struct GivaroGfq "Givaro::GFqDom<int>":
    2727        #attributes
    2828        unsigned int one
    2929        unsigned int zero
     
    4242        int (* random)(GivRandom gen, int res)
    4343        int (* initi "init")(int res, int e)
    4444        int (* initd "init")(int res, double e)
    45         int (* axpyin)(int r, int a, int x)
    4645        int (* sage_generator)() # SAGE specific method, not found upstream
    4746        int (* convert)(int r, int p)
    4847        int (* read)(int r, int p)
     48        int (* axpyin)(int r, int a, int x)
    4949        int (* axpy)(int r, int a, int b, int c)
    5050        int (* axmy)(int r, int a, int b, int c)
    51         int (* amxy)(int r, int a, int b, int c)
     51        int (* maxpy)(int r, int a, int b, int c)
    5252        bint (* isZero)(int e)
    5353        bint (* isOne)(int e)
    5454        bint (* isunit)(int e)
    5555
    56     GivaroGfq *gfq_factorypk "new GFqDom<int>" (unsigned int p, unsigned int k)
     56    GivaroGfq *gfq_factorypk "new Givaro::GFqDom<int>" (unsigned int p, unsigned int k)
    5757    # SAGE specific method, not found upstream
    58     GivaroGfq *gfq_factorypkp "new GFqDom<int>" (unsigned int p, unsigned int k, intvec poly)
    59     GivaroGfq *gfq_factorycopy "new GFqDom<int>"(GivaroGfq orig)
     58    GivaroGfq *gfq_factorypkp "new Givaro::GFqDom<int>" (unsigned int p, unsigned int k, intvec poly)
     59    GivaroGfq *gfq_factorycopy "new Givaro::GFqDom<int>"(GivaroGfq orig)
    6060    GivaroGfq  gfq_deref "*"(GivaroGfq *orig)
    6161    void delete "delete "(void *o)
    62     int gfq_element_factory "GFqDom<int>::Element"()
     62    int gfq_element_factory "Givaro::GFqDom<int>::Element"()
    6363
    6464cdef class FiniteField_givaroElement(FinitePolyExtElement) #forward declaration
    6565
  • sage/rings/finite_rings/element_givaro.pyx

    diff --git a/sage/rings/finite_rings/element_givaro.pyx b/sage/rings/finite_rings/element_givaro.pyx
    a b  
    212212            sage: sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro(9,repr='int').gen()
    213213            3
    214214            sage: sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro(9,repr='log').gen()
    215             5
     215            1
    216216        """
    217217        # we are calling late_import here because this constructor is
    218218        # called at least once before any arithmetic is performed.
     
    351351        EXAMPLES:
    352352            sage: k = GF(23**3, 'a')
    353353            sage: e = k._cache.random_element(); e
    354             9*a^2 + 10*a + 3
     354            2*a^2 + 14*a + 21
    355355            sage: type(e)
    356356            <type 'sage.rings.finite_rings.element_givaro.FiniteField_givaroElement'>
    357357
    358358            sage: P.<x> = PowerSeriesRing(GF(3^3, 'a'))
    359359            sage: P.random_element(5)
    360             a^2 + 2*a + 1 + (a + 1)*x + (a^2 + a + 1)*x^2 + (a^2 + 1)*x^3 + (2*a^2 + a)*x^4 + O(x^5)
     360            2*a + 2 + (a^2 + a + 2)*x + (2*a + 1)*x^2 + (2*a^2 + a)*x^3 + 2*a^2*x^4 + O(x^5)
    361361        """
    362362        cdef int seed = current_randstate().c_random()
    363363        cdef int res
     
    625625            return self._element_int_repr(e)
    626626
    627627    def _element_log_repr(self, FiniteField_givaroElement e):
    628         r"""
    629         Return str(i) where \code{base.gen()^i==self}.
    630 
    631         TODO -- this isn't what it does -- see below.
     628        """
     629        Return ``str(i)`` where ``self` is ``gen^i`` with ``gen``
     630        being the *internal* multiplicative generator of this finite
     631        field.
    632632
    633633        EXAMPLES:
    634634            sage: k.<a> = GF(3^4); k
    635635            Finite Field in a of size 3^4
    636636            sage: k._cache._element_log_repr(a^20)
    637637            '20'
    638             sage: k._cache._element_log_repr(a)    # TODO -- why 41 ?? why not 1?
    639             '41'
     638            sage: k._cache._element_log_repr(a)
     639            '1'
    640640        """
    641641        return str(int(e.element))
    642642
     
    750750        """
    751751        cdef int r
    752752
    753         r = self.objectptr.amxy(r , a.element, b.element, c.element, )
     753        r = self.objectptr.maxpy(r , a.element, b.element, c.element, )
    754754        return make_FiniteField_givaroElement(self,r)
    755755
    756756    def __reduce__(self):
     
    819819            sage: i.next()
    820820            0
    821821            sage: i.next()
    822             2*a
     822            a
    823823        """
    824824
    825825        self.iterator=self.iterator+1
     
    899899
    900900            sage: k.<FOOBAR> = GF(3^4,repr='log')
    901901            sage: FOOBAR
    902             41
     902            1
    903903           
    904904            sage: k.<FOOBAR> = GF(3^4,repr='int')
    905905            sage: FOOBAR
     
    14781478            sage: k.<b> = GF(5^2); k
    14791479            Finite Field in b of size 5^2
    14801480            sage: (b+2).log_repr()
    1481             '3'
     1481            '15'
    14821482        """
    14831483        return self._cache._element_log_repr(self)
    14841484   
  • sage/rings/finite_rings/finite_field_base.pyx

    diff --git a/sage/rings/finite_rings/finite_field_base.pyx b/sage/rings/finite_rings/finite_field_base.pyx
    a b  
    5454
    5555            sage: K.<a> = GF(7^4)
    5656            sage: K.list()[:7]
    57             [0, 6*a, a^2, 6*a^3, 2*a^2 + 3*a + 4, 5*a^3 + 4*a^2 + 3*a, 3*a^3 + a^2 + 6*a + 1]
     57            [0, a, a^2, a^3, 2*a^2 + 3*a + 4, 2*a^3 + 3*a^2 + 4*a, 3*a^3 + a^2 + 6*a + 1]
    5858            sage: K.<a> = GF(5^9)
    5959            sage: for x in K:
    6060            ...       if x == a+3: break
  • sage/rings/finite_rings/finite_field_givaro.py

    diff --git a/sage/rings/finite_rings/finite_field_givaro.py b/sage/rings/finite_rings/finite_field_givaro.py
    a b  
    7070            sage: sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro(9,repr='int').gen()
    7171            3
    7272            sage: sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro(9,repr='log').gen()
    73             5
     73            1
    7474
    7575            sage: k.<a> = GF(2^3)
    7676            sage: j.<b> = GF(3^4)
     
    188188        EXAMPLES:
    189189            sage: k = GF(23**3, 'a')
    190190            sage: e = k.random_element(); e
    191             9*a^2 + 10*a + 3
     191            2*a^2 + 14*a + 21
    192192            sage: type(e)
    193193            <type 'sage.rings.finite_rings.element_givaro.FiniteField_givaroElement'>
    194194
    195195            sage: P.<x> = PowerSeriesRing(GF(3^3, 'a'))
    196196            sage: P.random_element(5)
    197             a^2 + 2*a + 1 + (a + 1)*x + (a^2 + a + 1)*x^2 + (a^2 + 1)*x^3 + (2*a^2 + a)*x^4 + O(x^5)
     197            2*a + 2 + (a^2 + a + 2)*x + (2*a + 1)*x^2 + (2*a^2 + a)*x^3 + 2*a^2*x^4 + O(x^5)
    198198        """
    199199        return self._cache.random_element()
    200200
  • sage/schemes/elliptic_curves/ell_finite_field.py

    diff --git a/sage/schemes/elliptic_curves/ell_finite_field.py b/sage/schemes/elliptic_curves/ell_finite_field.py
    a b  
    312312            sage: k.<a> = GF(7^5)
    313313            sage: E = EllipticCurve(k,[2,4])
    314314            sage: P = E.random_element(); P
    315             (2*a^4 + 3*a^3 + 5*a^2 + 6*a + 4 : 6*a^4 + 4*a^3 + a + 6 : 1)
     315            (2*a^4 + 3*a^2 + 4*a : 3*a^4 + 6*a^2 + 5 : 1)
    316316            sage: type(P)
    317317            <class 'sage.schemes.elliptic_curves.ell_point.EllipticCurvePoint_finite_field'>
    318318            sage: P in E
  • sage/schemes/generic/affine_space.py

    diff --git a/sage/schemes/generic/affine_space.py b/sage/schemes/generic/affine_space.py
    a b  
    216216            sage: A.rational_points()
    217217            [(0), (1), (2)]
    218218            sage: A.rational_points(GF(3^2, 'b'))
    219             [(0), (2*b), (b + 1), (b + 2), (2), (b), (2*b + 2), (2*b + 1), (1)]
     219            [(0), (b), (b + 1), (2*b + 1), (2), (2*b), (2*b + 2), (b + 2), (1)]
    220220
    221221            sage: AffineSpace(2, ZZ).rational_points(GF(2))
    222222            [(0, 0), (1, 0), (0, 1), (1, 1)]
  • sage/schemes/generic/projective_space.py

    diff --git a/sage/schemes/generic/projective_space.py b/sage/schemes/generic/projective_space.py
    a b  
    691691            sage: P.rational_points()
    692692            [(0 : 1), (1 : 1), (2 : 1), (1 : 0)]
    693693            sage: P.rational_points(GF(3^2, 'b'))
    694             [(0 : 1), (2*b : 1), (b + 1 : 1), (b + 2 : 1), (2 : 1), (b : 1), (2*b + 2 : 1), (2*b + 1 : 1), (1 : 1), (1 : 0)]
     694            [(0 : 1), (b : 1), (b + 1 : 1), (2*b + 1 : 1), (2 : 1), (2*b : 1), (2*b + 2 : 1), (b + 2 : 1), (1 : 1), (1 : 0)]
    695695        """
    696696        if F == None:
    697697            return [ P for P in self ]
  • sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py

    diff --git a/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py b/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py
    a b  
    77    sage: x = polygen(K)
    88    sage: C = HyperellipticCurve(x^7 - x^5 - 2, x^2 + a)
    99    sage: C._points_fast_sqrt()
    10     [(0 : 1 : 0), (2*a : 2*a + 2 : 1), (2*a : 2*a : 1), (a + 1 : a : 1), (a + 1 : a + 1 : 1), (2 : a + 1 : 1), (1 : a + 1 : 1)]
     10    [(0 : 1 : 0), (a + 1 : a : 1), (a + 1 : a + 1 : 1), (2 : a + 1 : 1), (2*a : 2*a + 2 : 1), (2*a : 2*a : 1), (1 : a + 1 : 1)]
     11
    1112"""
    1213
    1314#*****************************************************************************
     
    173174            sage: x = polygen(K)
    174175            sage: C = HyperellipticCurve(x^7 - 1, x^2 + a)
    175176            sage: C._points_fast_sqrt()
    176             [(0 : 1 : 0), (2 : a + 1 : 1), (a : 2*a + 1 : 1), (2*a + 2 : 2*a : 1), (2*a + 2 : 1 : 1), (1 : 2*a + 2 : 1), (1 : 0 : 1)]
     177            [(0 : 1 : 0), (a : 2*a + 1 : 1), (2 : a + 1 : 1), (2*a + 2 : 2*a : 1), (2*a + 2 : 1 : 1), (1 : 2*a + 2 : 1), (1 : 0 : 1)]
    177178            sage: K.<a> = GF(49, 'a')
    178179            sage: x = polygen(K)
    179180            sage: C = HyperellipticCurve(x^5 - x^2 - 1, x^2 + a)
  • sage/schemes/hyperelliptic_curves/jacobian_morphism.py

    diff --git a/sage/schemes/hyperelliptic_curves/jacobian_morphism.py b/sage/schemes/hyperelliptic_curves/jacobian_morphism.py
    a b  
    290290    ::
    291291   
    292292        sage: Q = J(H.lift_x(F(a+1))); Q
    293         (x + 6*a + 6, y + 2)
     293        (x + 6*a + 6, y + 2*a)
    294294        sage: 7*8297*Q # indirect doctest
    295295        (1)
    296296
  • sage/schemes/plane_curves/projective_curve.py

    diff --git a/sage/schemes/plane_curves/projective_curve.py b/sage/schemes/plane_curves/projective_curve.py
    a b  
    367367            sage: b.next()
    368368            (0 : 0 : 1)
    369369            sage: b.next()
    370             (2*a + 2 : 2*a : 1)
     370            (2*a + 2 : a : 1)
    371371            sage: b.next()
    372372            (2 : a + 1 : 1)
    373373            sage: b.next()
    374             (a + 1 : a + 2 : 1)
     374            (a + 1 : 2*a + 1 : 1)
    375375            sage: b.next()
    376376            (1 : 2 : 1)
    377377            sage: b.next()
    378             (2*a + 2 : a : 1)
     378            (2*a + 2 : 2*a : 1)
    379379            sage: b.next()
    380380            (2 : 2*a + 2 : 1)
    381381            sage: b.next()
    382             (a + 1 : 2*a + 1 : 1)
     382            (a + 1 : a + 2 : 1)
    383383            sage: b.next()
    384384            (1 : 1 : 1)
    385385            sage: b.next()
  • sage/tests/french_book/numbertheory.py

    diff --git a/sage/tests/french_book/numbertheory.py b/sage/tests/french_book/numbertheory.py
    a b  
    4040Finite Field in x of size 3^2
    4141sage: R.polynomial()
    4242x^2 + 2*x + 2
    43 sage: [r for r in R]
    44 [0, 2*x, x + 1, x + 2, 2, x, 2*x + 2, 2*x + 1, 1]
     43sage: Set([r for r in R])
     44{0, 1, 2, x, x + 1, x + 2, 2*x, 2*x + 1, 2*x + 2}
    4545sage: Q.<x> = PolynomialRing(GF(3))
    4646sage: R2 = GF(9,name='x',modulus=x^2+1); R2
    4747Finite Field in x of size 3^2