[GAP Forum] saving variables to a file
Stefan Kohl
stefan at mcs.st-and.ac.uk
Wed Jun 15 21:51:30 BST 2016
On Tue, June 14, 2016 5:20 pm, R.N. Tsai wrote:
> Thanks for the response Max,The matrices are over GF(2), so hopefully they can be
> managed more efficiently than generic matrices.R.N
One thing you could do specifically for matrices over GF(2) is to save them
as monochrome bitmap pictures -- this uses just one bit per entry (plus a tiny
overhead for the description block for the picture):
gap> M := NullMat(10000,10000,GF(2));; # just some GF(2) matrix, could be any
gap> file := Filename(DirectoryTemporary(),"matrix.bmp"); # pick a file name
"/tmp/tmIthaXA/matrix.bmp"
gap> SaveAsBitmapPicture(M,file); # save the matrix to the file, 12.5 MB in this case
gap> time;
18392
gap> N := LoadBitmapPicture(file);; # read it in again
gap> time;
8320
gap> N = M;
true
Hope this helps,
Stefan
More information about the Forum
mailing list