# 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
|
|
| 217 | 217 | ... # 32-bit |
| 218 | 218 | 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 |
| 219 | 219 | 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 |
| 221 | 225 | sage: MatrixSpace(ZZ,10,10).category() |
| 222 | 226 | Category of algebras over Integer Ring |
| 223 | 227 | sage: MatrixSpace(QQ,10).category() |
| … |
… |
|
| 247 | 251 | |
| 248 | 252 | if nrows >= 2**63 or ncols >= 2**63: |
| 249 | 253 | 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: |
| 251 | 255 | 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)" |
| 252 | 256 | |
| 253 | 257 | self.__nrows = nrows |