Skip to content

Commit

Permalink
Introduce command-line switch to disable parts of MatrixObj
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Pfeiffer committed Aug 27, 2018
1 parent f701a6f commit a449cb0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/matobj.gi
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ end);



if GAPInfo.CommandLineOptions.enableMatrixObj then
# methods to create vectors

InstallMethod( Vector,
Expand Down Expand Up @@ -225,6 +226,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
9 changes: 8 additions & 1 deletion lib/matrix.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1219,10 +1219,18 @@ end );
## Since the rows are homogeneous and nonempty,
## one can also access the first entry in the first row.
##
if GAPInfo.CommandLineOptions.enableMatrixObj then
InstallOtherMethod( BaseDomain,
"generic method for a row vector",
[ IsRowVector ],
DefaultRing );
else
InstallOtherMethod( BaseDomain,
"generic method for a row vector",
[ IsRowVector ],
-10,
DefaultRing );
fi;

InstallOtherMethod( OneOfBaseDomain,
"generic method for a row vector",
Expand All @@ -1249,7 +1257,6 @@ InstallOtherMethod( ZeroOfBaseDomain,
[ IsMatrix and IsPlistRep ],
mat -> Zero( mat[1,1] ) );


#############################################################################
##
#M DepthOfUpperTriangularMatrix( <mat> )
Expand Down
4 changes: 3 additions & 1 deletion lib/system.g
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ 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)" ] ),
rec( long := "enableMatrixObj", default := false,
help := [ "Enable new MatrixObj functionality" ] )
],
) );

Expand Down

0 comments on commit a449cb0

Please sign in to comment.