[GAP Forum] GAP to MATLAB?
Iverson, Joseph W [MATH]
jwi at iastate.edu
Wed Oct 16 19:16:48 BST 2019
Dear Alexander (and everybody),
What about only transferring two generators, and information on how to build the rest?
Thanks for the helpful suggestion. In this case I think that will work!
I am still interested in the general problem of exporting to MATLAB, though, since this comes up pretty frequently.
I think, unless someone has a function to write MATLAB’s binary format (and even then) the size of the objects will be problematic.
Yes, I see that file size might be a problem. If the size of a .mat file scales with the matrix dimensions, then I think it would be about a 15GB file. That's stretching the limits for sure.
On the other hand, in the present case my matrices happen to describe an *induced* representation, so they are incredibly sparse. Presumably one could create a .mat file with MATLAB's "sparse" format to cut it down to a reasonable size.
Thanks again for your helpful comments.
All the best,
Joey
Assistant Professor
Department of Mathematics
Iowa State University
On 10/16/19, 9:11 AM, "Hulpke,Alexander" <Alexander.Hulpke at colostate.edu> wrote:
Dear Forum, Dear Joey,
at the risk of stretching everybodies patience with useless remarks:
> Dear GAP forum,
>
> Does anybody know of a way to efficiently get matrices (say with cyclotomic entries) from GAP to MATLAB? For instance, is there a package to export matrices as .mat files?
I think, unless someone has a function to write MATLAB’s binary format (and even then) the size of the objects will be problematic.
What about only transferring two generators, and information on how to build the rest? That is, if you have two (or whatever number) of matrices A and B that generate M12, do the following:
Write A and B to the Matlab file
run through the elements of M12 , preferrably using a permutation representation
Factor every element into the generators A and B, using `Factorization` — for M12 this will be a jiffy.
add code to the matlab file that builds a list/tensor/thingy by forming the corresponding words. (This is building on the assumption that with optimized code matrix multiplication will actually be faster than printing/reading).
(In fact one could even re-use partial words, as done with straight line programs).
Feel free to contact me directly, if you want to do so, but don’t know how to do this on the GAP side.
All the best,
Alexander Hulpke
-- Colorado State University, Department of Mathematics,
Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA
email: hulpke at colostate.edu, http://www.math.colostate.edu/~hulpke
More information about the Forum
mailing list