Ticket #7638: trac_7638-rebase.patch

File trac_7638-rebase.patch, 1.9 KB (added by was, 3 years ago)
  • sage/matrix/matrix_space.py

    # HG changeset patch
    # User dagss
    # Date 1260369556 28800
    # Node ID 0a7eef984b2cee0f1b42a2ad73ea7e1063f75a04
    # Parent  d4c7a570bae7f7d966f2c6cae603f288b15e4ca1
    trac 7638 -- Cannot create big matrix on 64-bit system
    
    diff --git a/sage/matrix/matrix_space.py b/sage/matrix/matrix_space.py
    a b  
    217217        ...                                                                  # 32-bit 
    218218        ValueError: number of rows and columns must be less than 2^31 (on a 32-bit computer -- use a 64-bit computer for matrices with up to 2^63-1 rows and columns)           # 32-bit 
    219219        Full MatrixSpace of 10 by 2147483648 dense matrices over Integer Ring   # 64-bit 
    220  
     220        sage: MatrixSpace(ZZ,2^31,10) 
     221        Traceback (most recent call last):                                   # 32-bit 
     222        ...                                                                  # 32-bit 
     223        ValueError: number of rows and columns must be less than 2^31 (on a 32-bit computer -- use a 64-bit computer for matrices with up to 2^63-1 rows and columns)           # 32-bit 
     224        Full MatrixSpace of 2147483648 by 10 dense matrices over Integer Ring   # 64-bit 
    221225        sage: MatrixSpace(ZZ,10,10).category() 
    222226        Category of algebras over Integer Ring 
    223227        sage: MatrixSpace(QQ,10).category() 
     
    247251 
    248252        if nrows >= 2**63 or ncols >= 2**63: 
    249253            raise ValueError, "number of rows and columns must be less than 2^63" 
    250         elif nrows >= 2**31 or ncols >= 2**31 and not sage.misc.misc.is_64_bit: 
     254        elif (nrows >= 2**31 or ncols >= 2**31) and not sage.misc.misc.is_64_bit: 
    251255            raise ValueError, "number of rows and columns must be less than 2^31 (on a 32-bit computer -- use a 64-bit computer for matrices with up to 2^63-1 rows and columns)" 
    252256             
    253257        self.__nrows = nrows