Ticket #12346: 12346_pari_hnf.patch

File 12346_pari_hnf.patch, 2.3 KB (added by jdemeyer, 10 years ago)
  • sage/matrix/matrix_integer_dense.pyx

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1343825415 -7200
    # Node ID 551052cb428349102106268f96f9be978303834a
    # Parent  2e4b84bf808f2f633934198d760e96c8206eb2dc
    Re-enable PARI HNF with flag=4 and include_zero_rows=False
    
    diff --git a/sage/matrix/matrix_integer_dense.pyx b/sage/matrix/matrix_integer_dense.pyx
    a b  
    49554955            [1 2 3]
    49564956            [0 3 6]
    49574957            sage: matrix(ZZ,3,[1..9])._hnf_pari(4, include_zero_rows=False)
    4958             Traceback (most recent call last):
    4959             ...
    4960             NotImplementedError: Pari flag=4 is currently broken.
     4958            [1 2 3]
     4959            [0 3 6]
    49614960           
    4962         The following tests for the Pari bug in trac #12280. Expected
    4963         output is ``Mat(1), [1, 0; 0, 1]]``. Once this gets fixed we
    4964         can remove the ``NotImplementedError`` below. This is trac
    4965         #12346 ::
     4961        Check that :trac:`12346` is fixed::
    49664962
    49674963            sage: pari('mathnf(Mat([0,1]), 4)')
    4968             [Mat([0, 1]), [1, 0; 0, 1]]
     4964            [Mat(1), [1, 0; 0, 1]]
    49694965        """
    4970         if not include_zero_rows and flag==4:
    4971             raise NotImplementedError('Pari flag=4 is currently broken.')
    49724966        cdef PariInstance P = sage.libs.pari.gen.pari
    49734967        cdef GEN A
    49744968        sig_on()
     
    50295023            [1 2 3]
    50305024            [0 3 6]
    50315025            sage: matrix(ZZ,3,[1..9])._hnf_pari_big(4, include_zero_rows=False)
    5032             Traceback (most recent call last):
    5033             ...
    5034             NotImplementedError: Pari flag=4 is currently broken.
    5035 
    5036         The following tests for the Pari bug in trac #12280. Expected output
    5037         is ``Mat(1), [1, 0; 0, 1]]``. If this gets fixed we can remove
    5038         the ``NotImplementedError`` below. This is trac #12346 ::
    5039 
    5040             sage: pari('mathnf(Mat([0,1]), 4)')
    5041             [Mat([0, 1]), [1, 0; 0, 1]]
     5026            [1 2 3]
     5027            [0 3 6]
    50425028        """
    5043         if (not include_zero_rows and flag==4):
    5044             raise NotImplementedError('Pari flag=4 is currently broken.')
    50455029        cdef PariInstance P = sage.libs.pari.gen.pari
    50465030        cdef gen H = P.integer_matrix(self._matrix, self._nrows, self._ncols, 1)
    50475031        H = H.mathnf(flag)