[GAP Forum] saving variables to a file
R.N. Tsai
r_n_tsai at yahoo.com
Tue Jun 14 17:20:03 BST 2016
Thanks for the response Max,The matrices are over GF(2), so hopefully they can be managed more efficiently than generic matrices.R.N
From: Max Horn <max at quendi.de>
To: R.N. Tsai <r_n_tsai at yahoo.com>
Cc: GAP Forum <forum at gap-system.org>
Sent: Tuesday, June 14, 2016 2:01 AM
Subject: Re: [GAP Forum] saving variables to a file
Dear R.N.,
> On 14 Jun 2016, at 05:52, R.N. Tsai <r_n_tsai at yahoo.com> wrote:
>
> Dear GAP forum,
> I have same fairly large matrices that take a long time to calculate. Is there a way to save these efficiently?I read about saving the workspace but that won't help with this; I have many matrices and I want to load morethan one at a time. I tried printing to a text file but that takes a very long time because of the size of the matrices.
To get a better feeling for your problem: How large are you matrices? Over which ring are they defined?
> Here's how I would have done this in Ocatave/Matlab :
> M1=(results of long calculations)save('M1.mat','M1);M2=...save('M2.mat','M2);
> so in the future I can bring up these matrices into gap like this :
> load('M1.mat','M1')
> load('M2.mat','M2')
>
> and now I can process both say M3=M1+M2,....in the same gap session...
> Any suggestions?
> Also, is there an efficient way to pass data between gap and Octave/Matlab?
One way to achieve this would be to use the IO_Pickle / IO_Unpickle functions from the GAP IO package. You can finde an example of using them here: <http://www.gap-system.org/Manuals/pkg/io-4.4.6/doc/chap10.html#X81BD8400832EE20B>. For details, see also <http://www.gap-system.org/Manuals/pkg/io-4.4.6/doc/chap5.html>
Hope that helps,
Max
More information about the Forum
mailing list