Ticket #3065: 3065.patch

File 3065.patch, 1.5 KB (added by dfdeshom, 5 years ago)
  • sage/libs/pari/gen.pyx

    exporting patch:
    # HG changeset patch
    # User dfdeshom@sage <dfdeshom@gmail.com>
    # Date 1209749554 25200
    # Node ID d7869c424add89d20d48c73a5e6a17b979c4686b
    # Parent  667bc05730bede64a58640872c39e695b6a24666
    #3065: empty matrices: frobenius() throws RuntimeError
    
    diff -r 667bc05730be -r d7869c424add sage/libs/pari/gen.pyx
    a b  
    53895389        """ 
    53905390        cdef long n 
    53915391        _sig_on 
     5392        # if this matrix has no columns 
     5393        # then it has no rows.  
     5394        if self.ncols() == 0: 
     5395            _sig_off 
     5396            return 0 
    53925397        n = glength(<GEN>(self.g[1])) 
    53935398        _sig_off 
    53945399        return n 
  • sage/matrix/matrix_integer_dense.pyx

    diff -r 667bc05730be -r d7869c424add sage/matrix/matrix_integer_dense.pyx
    a b  
    17711771           [    -1      2     -1] 
    17721772           [     0  23/15 -14/15] 
    17731773           [     0  -2/15   1/15]) 
    1774  
     1774           sage: a=matrix([]) 
     1775           sage: a.frobenius(2) 
     1776           ([], []) 
     1777           sage: a.frobenius(0) 
     1778           [] 
     1779           sage: a.frobenius(1) 
     1780           [] 
     1781           sage: B = random_matrix(ZZ,2,3) 
     1782           sage: B.frobenius() 
     1783           Traceback (most recent call last): 
     1784           ... 
     1785           ArithmeticError: frobenius matrix of non-square matrix not defined. 
     1786            
    17751787        AUTHOR: 
    17761788           -- 2006-04-02: Martin Albrecht 
    17771789