Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection of minor improvements #618

Merged
merged 8 commits into from
Feb 17, 2016
Prev Previous commit
Next Next commit
ENHANCE: Fallback method for CopySubMatrix
in case the representation is only Plist.
  • Loading branch information
hulpke committed Feb 15, 2016
commit 679d0cfb519b629aaa62ecfbf28383aaf1c540b5
14 changes: 14 additions & 0 deletions lib/matobjplist.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,20 @@ InstallMethod( CopySubMatrix, "for two plist matrices and four lists",
od;
end );

InstallOtherMethod( CopySubMatrix,
"for two plists -- fallback in case of bad rep.",
[ IsPlistRep, IsPlistRep and IsMutable,
IsList, IsList, IsList, IsList ],
function( m, n, srcrows, dstrows, srccols, dstcols )
local i;
# in this representation all access probably has to go through the
# generic method selection, so it is not clear whether there is an
# improvement in moving this into the kernel.
for i in [1..Length(srcrows)] do
n[dstrows[i]]{dstcols}:=m[srcrows[i]]{srccols};
od;
end );

InstallMethod( CopySubMatrix,
"for a plist matrix and a checking plist matrix and four lists",
[ IsPlistMatrixRep,
Expand Down