read very large integer matrix from file

347 views
Skip to first unread message

John Matrix

unread,
Jan 31, 2009, 11:18:52 PM1/31/09
to sage-support
Hi,

I'd like to read a very large integer dense square matrix into sage
from a file, in order to determine its rank. I could not find much
information on what format I should store the matrix in, and what
commands to use to read it. Any help would be appreciated.

Thanks!

David Joyner

unread,
Feb 1, 2009, 8:56:33 AM2/1/09
to sage-s...@googlegroups.com
I guess it depends on what "very large" means.
Do you know any Python? If so, one option is just
read in the file of entries then write a python/sage script
to create the matrix in Sage from that. I think large integer
matrices use linbox, which I think is easily capable of some
matrix computations whose row-dim and column-dim are in the
thousands (according to
http://www.sagemath.org/doc/ref/module-sage.matrix.matrix-integer-dense.html,
they must be <2^64-1 on a 64 bit machine).
Message has been deleted

John Matrix

unread,
Feb 1, 2009, 11:20:12 AM2/1/09
to sage-support

Hi David and Minh,

Thanks for your comments!
@David
In the worst case, the matrix will have roughly 17000 rows and
columns. I could reduce it with some effort, but I'll first
try to figure out if it's worth it. I don't know Python very
well, but I could probably learn that much. Alternatively,
I'm now considering calling linbox directly from c++.

@Minh
Thant looks very helpful, except that the matrix must
first be generated by some other c++ application.
Is any format that the "load" command can handle
somewhere documented?

Thanks again,
John

Fabio Tonti

unread,
Feb 1, 2009, 11:32:17 AM2/1/09
to sage-s...@googlegroups.com

John Matrix

unread,
Feb 1, 2009, 11:45:25 AM2/1/09
to sage-support

Thanks, Fabio, that seems to solve my problem indeed!
Reply all
Reply to author
Forward
0 new messages