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] 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?
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to