Skip to content

Commit

Permalink
Downrank MatrixObj methods to unbreak Semigroups
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Pfeiffer committed Aug 28, 2018
1 parent f701a6f commit ecb3225
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions lib/matobj.gi
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ InstallMethod( Matrix,
#
InstallMethod( Matrix,
[IsSemiring, IsList, IsInt],
# FIXME: Remove this downranking, it was introduced to prevent
# Semigroups from breaking ahead of the 4.10 release
-SUM_FLAGS,
function( basedomain, list, nrCols )
local rep;
rep := DefaultMatrixRepForBaseDomain(basedomain);
Expand All @@ -187,6 +190,9 @@ InstallMethod( Matrix,

InstallMethod( Matrix,
[IsSemiring, IsList],
# FIXME: Remove this downranking, it was introduced to prevent
# Semigroups from breaking ahead of the 4.10 release
-SUM_FLAGS,
function( basedomain, list )
local rep;
if Length(list) = 0 then Error("list must be not empty"); fi;
Expand All @@ -196,6 +202,9 @@ InstallMethod( Matrix,

InstallMethod( Matrix,
[IsSemiring, IsMatrixObj],
# FIXME: Remove this downranking, it was introduced to prevent
# Semigroups from breaking ahead of the 4.10 release
-SUM_FLAGS,
function( basedomain, mat )
# TODO: can we do better? encourage MatrixObj implementors to overload this?
return NewMatrix( DefaultMatrixRepForBaseDomain(basedomain), basedomain, NrCols(mat), Unpack(mat) );
Expand Down Expand Up @@ -225,6 +234,7 @@ InstallMethod( Matrix,
rep := DefaultMatrixRepForBaseDomain(basedomain);
return NewMatrix( rep, basedomain, Length(list[1]), list );
end );
# fi;

#
# matrix constructors using example objects (as last argument)
Expand Down
4 changes: 3 additions & 1 deletion lib/matrix.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,9 @@ end );
InstallOtherMethod( BaseDomain,
"generic method for a row vector",
[ IsRowVector ],
# FIXME: Remove this downranking, it was introduced to prevent
# Semigroups from breaking ahead of the 4.10 release
-SUM_FLAGS,
DefaultRing );

InstallOtherMethod( OneOfBaseDomain,
Expand Down Expand Up @@ -1249,7 +1252,6 @@ InstallOtherMethod( ZeroOfBaseDomain,
[ IsMatrix and IsPlistRep ],
mat -> Zero( mat[1,1] ) );


#############################################################################
##
#M DepthOfUpperTriangularMatrix( <mat> )
Expand Down
2 changes: 1 addition & 1 deletion lib/system.g
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ BIND_GLOBAL( "GAPInfo", rec(
rec( long := "norepl", default := false,
help := [ "Disable the GAP read-evaluate-print loop (REPL)" ] ),
rec( long := "nointeract", default := false,
help := [ "Start GAP in non-interactive mode (disable read-evaluate-print loop (REPL) and break loop)" ] )
help := [ "Start GAP in non-interactive mode (disable read-evaluate-print loop (REPL) and break loop)" ] ),
],
) );

Expand Down

0 comments on commit ecb3225

Please sign in to comment.