You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following was reported (in slightly different form) on the GAP forum:
gap> M:=NullMat(4,6,GF(5));
[ [ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5) ],
[ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5) ] ]
gap> ConvertToMatrixRep(M);
5
gap> TransposedMatDestructive(M);
Error, Unbind of entry of locked compressed vector is forbidden in
Unbind( mat[j][m + i] ); on line 1957 of file /BLABLA/gap/lib/matrix.gi called from
<function "unknown">( <arguments> )
called from read-eval loop at line 44 of *stdin*
You can `return;' to ignore the assignment
brk>
Going beyond that, there is another issue with TransposedMatDestructive: Its documentation states the following:
TransposedMatDestructive( mat ):
If mat is a mutable matrix, then the transposed is computed by swapping the entries in mat. In this way mat gets changed. In all other cases the transposed is computed by TransposedMat (24.5-6).
So this suggests that TransposedMatDestructive should work for immutable matrices, but it also doesn't:
gap> M:=NullMat(4,6,GF(5));;
gap> MakeImmutable(M);;
gap> TransposedMatDestructive(M);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `MutableTransposedMatDestructive' on 1 arguments called from
<function "HANDLE_METHOD_NOT_FOUND">( <arguments> )
called from read-eval loop at line 62 of *stdin*
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk>
The text was updated successfully, but these errors were encountered:
implement the operation for compressed matrices in an efficient way;
implement it, but in an inefficient way (e.g. using conversions to/from another format)
change the documentation to state that this is not supported for compressed matrices.
I prefer the first option, but it is the most work, of course.
For the second issue, we could:
implement the operation for immutable matrices by delegating to TransposedMat, as the documentation states;
change the documentation to state that TransposedMatDestructive is only provided for mutable matrices.
I prefer the second option, as it doesn't make sense to me to allow TransposedMatDestructive for immutable matrices, and I think doing so just promotes inefficient coding. But we should only do so if TransposedMatDestructive really never worked for immutable matrices, i.e. if this is not just a recent regression. (The reason for this is simple: If it never worked, it is safe to change the documentation; but if it used to work, we may have broken people's code, and I am conservative about doing that).
For compressed (and non-square) matrices in the built-in GAP format it is not really possible to
transpose in-place. The reason behind this is a nasty kludge around the possibility of rows being shared between multiple compressed matrices.
Since TransposedMatDestructive doesn't promise that the change will be in-place, merely allows it,
it probably makes sense to install methods for that case (and the case of an immutablke matrix) that simply defer to TransposedMat where the appropriate methods all exist.
The following was reported (in slightly different form) on the GAP forum:
Going beyond that, there is another issue with
TransposedMatDestructive
: Its documentation states the following:So this suggests that
TransposedMatDestructive
should work for immutable matrices, but it also doesn't:The text was updated successfully, but these errors were encountered: