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
|
|
| 5389 | 5389 | """ |
| 5390 | 5390 | cdef long n |
| 5391 | 5391 | _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 |
| 5392 | 5397 | n = glength(<GEN>(self.g[1])) |
| 5393 | 5398 | _sig_off |
| 5394 | 5399 | return n |
diff -r 667bc05730be -r d7869c424add sage/matrix/matrix_integer_dense.pyx
|
a
|
b
|
|
| 1771 | 1771 | [ -1 2 -1] |
| 1772 | 1772 | [ 0 23/15 -14/15] |
| 1773 | 1773 | [ 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 | |
| 1775 | 1787 | AUTHOR: |
| 1776 | 1788 | -- 2006-04-02: Martin Albrecht |
| 1777 | 1789 | |