This (slightly fixed) output from sage -grep shows what needs to be done:
$ sage -grep -n 'def submatrix'
sage/matrix/matrix1.pyx:1810: def submatrix(self, Py_ssize_t row=0,
Py_ssize_t col=0,
Py_ssize_t nrows=-1,
Py_ssize_t ncols=-1):
sage/matrix/matrix_mod2_dense.pyx:1665: def submatrix(self, lowr, lowc,nrows
, ncols):
sage/matrix/matrix_mod2e_dense.pyx:1284: def submatrix(self, lowr,
lowc,nrows
, ncols):
On Tuesday, February 18, 2014 7:07:53 PM UTC, Martin R. Albrecht wrote:
>
> Looks like a bug to me, i.e. the mod2 submatrix command should assume
> default parameters when less than four parameters are given.
>
> I am happy to review your patch ;)
>
> On 18/02/14 18:38, [email protected] <javascript:> wrote:
> > I'm trying to compute some homology stuff by finding the smith normal
> > form of (fairly) large matrices.
> >
> > I do the following:
> >
> > A = Matrix(IntegerModRing(2),[[1,0,2],[1,0,1]]) A.smith_form()
> >
> > and I get the following error:
> >
> > TypeError Traceback (most recent call
> > last) <ipython-input-6-23e95c6be019> in <module>() ----> 1
> > A.smith_form()
> >
> >
> /Users/.../builds/sage-6.1.1/local/lib/python2.7/site-packages/sage/matrix/matrix2.so
>
>
> > in sage.matrix.matrix2.Matrix.smith_form
> > (sage/matrix/matrix2.c:60007)()
> >
> >
> /Users/.../builds/sage-6.1.1/local/lib/python2.7/site-packages/sage/matrix/matrix_mod2_dense.so
>
>
> > in sage.matrix.matrix_mod2_dense.Matrix_mod2_dense.submatrix
> > (sage/matrix/matrix_mod2_dense.c:10429)()
> >
> > TypeError: submatrix() takes exactly 4 positional arguments (2
> > given)
> >
> > Looking at the code, line 12413 (mm = t.submatrix(1,1) ) only passes
> > two arguments while the actual sub matrix function takes 5 arguments
> > (itself, which doesn't count, lowr, lowc, nrows, ncols).
> >
> > Since the integers mod 2 are a field, this "should" be working in
> > theory. The integers mod 3 and the integers both work. Any thoughts?
> >
>
>
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.