#12887: Optional args in Matrix_Mod submatrix method
---------------------------------------------------+------------------------
Reporter: dscharles | Owner: jason, was
Type: defect | Status: new
Priority: minor | Milestone: sage-5.1
Component: linear algebra | Resolution:
Keywords: matrix, finite field, submatrix | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------------------------+------------------------
Description changed by dscharles:
Old description:
> When computing the smith form of a matrix (over a finite field) it promts
> an error
>
> {{{
> #!python
> sage: AA = matrix(Zmod(2), [[1,1],[1,0],[0,1]])
> sage: AA.smith_form()
> }}}
>
> It promts
> {{{
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "_sage_input_100.py", line 10, in <module>
> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
> -*-\\n" +
> _support_.preparse_worksheet_cell(base64.b64decode("QUEuc21pdGhfZm9ybSgp"),globals())+"\\n");
> execfile(os.path.abspath("___code___.py"))
> File "", line 1, in <module>
>
> File "/tmp/tmpXWhShB/___code___.py", line 2, in <module>
> exec compile(u'AA.smith_form()
> File "", line 1, in <module>
>
> File "matrix2.pyx", line 10512, in
> sage.matrix.matrix2.Matrix.smith_form (sage/matrix/matrix2.c:49285)
> File "matrix_mod2_dense.pyx", line 1666, in
> sage.matrix.matrix_mod2_dense.Matrix_mod2_dense.submatrix
> (sage/matrix/matrix_mod2_dense.c:9696)
> TypeError: submatrix() takes exactly 4 positional arguments (2 given)
> }}}
>
> It seems like the "Matrix_mod" submatrix method doesn't have "ncols" and
> "nrows" as optional parameters (like the base Matrix class).
>
> I used Sage 4.8.0 in an Ubuntu 12.04 (32 bits).
>
> sage-support discussion:
> [https://groups.google.com/forum/?fromgroups#!topic/sage-
> support/TssHVf3oUeM]
New description:
When computing the smith form of a matrix (over a finite field) it promts
an error
{{{
#!python
sage: AA = matrix(Zmod(2), [[1,1],[1,0],[0,1]])
sage: AA.smith_form()
}}}
It promts
{{{
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_100.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
-*-\\n" +
_support_.preparse_worksheet_cell(base64.b64decode("QUEuc21pdGhfZm9ybSgp"),globals())+"\\n");
execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpXWhShB/___code___.py", line 2, in <module>
exec compile(u'AA.smith_form()
File "", line 1, in <module>
File "matrix2.pyx", line 10512, in sage.matrix.matrix2.Matrix.smith_form
(sage/matrix/matrix2.c:49285)
File "matrix_mod2_dense.pyx", line 1666, in
sage.matrix.matrix_mod2_dense.Matrix_mod2_dense.submatrix
(sage/matrix/matrix_mod2_dense.c:9696)
TypeError: submatrix() takes exactly 4 positional arguments (2 given)
}}}
It seems that the "Matrix_mod" submatrix method doesn't have "ncols" and
"nrows" as optional parameters (like the base Matrix class).
I used Sage 4.8.0 in an Ubuntu 12.04 (32 bits).
sage-support discussion:
[https://groups.google.com/forum/?fromgroups#!topic/sage-
support/TssHVf3oUeM]
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12887#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.