GOCompact
is an option which fixes the output format of the matrix.
First load the package:
Values not equal to zero and their positions are stored.
GOMatrixType GTCompactStore