[GAP Forum] Efficient transposition

Max Horn max at quendi.de
Sat Oct 24 16:16:28 BST 2015


Dear Anvita, dear Steve,

> On 24.10.2015, at 09:13, Stephen Linton <sl4 at st-andrews.ac.uk> wrote:
> 
> Dear Anvita,
> 
> This looks like a bug at the very least in the sense that a better error message should be produced.
> M is constructed here in a compressed form, and I am not sure it is possible to transpose a matrix destructively in that form.

Yet the documentation of TransposedMatDestructive does not mention any restrictions of that kind, so it is a bug in GAP. I logged a bug report for this now:

  https://github.com/gap-system/gap/issues/303

There is also a related issue: TransposedMatDestructive does not work for immutable matrices, even though the documentation suggests that it does. Of course that may just be a bug in the documentation.

> 
> On the other hand, this form is quite space efficient, so making a copy with TransposedMat and then letting the garbage collector get rid of the old copy shouldn’t be too bad. In particular it probably uses less memory that converting the matrix to a different form and then transposing it.

Depending on what you do, another alternative might be to use the cvec package:

  http://gap-packages.github.io/cvec/

It provides very efficient routines to work with matrices over finite fields, and in particular, can efficiently transpose matrices in-place.


Best wishes,
Max


More information about the Forum mailing list