This is actually perfect for GF(2) matrices (which is all I need for
now).Interestingly enough if I convert the GF(2) matrix to 1 and 0's (using
"Int") the bitmapfile is 24x larger...that was just an experiment so it's
actually better to stay in GF(2).I should be able to process a .bmp file in
matlab so this could be one way to passthe matrices between the two.Thanks for
your help.R.N.
From: Stefan Kohl <[email protected]>
To: R.N. Tsai <[email protected]>
Cc: Max Horn <[email protected]>; GAP Forum <[email protected]>
Sent: Wednesday, June 15, 2016 1:51 PM
Subject: Re: [GAP Forum] saving variables to a file
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
_______________________________________________
Forum mailing list
[email protected]
http://mail.gap-system.org/mailman/listinfo/forum