From 55479e627c649d0e1d1ecac69d8cca6f8697e8fb Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Wed, 27 May 2020 03:50:41 +0200 Subject: [PATCH] turned several LIMAT immediate methods into methods as the do unnecessary computations or might produce big results --- MatricesForHomalg/PackageInfo.g | 2 +- MatricesForHomalg/gap/LIMAT.gi | 44 ++++++++++++++++----------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/MatricesForHomalg/PackageInfo.g b/MatricesForHomalg/PackageInfo.g index 07725aa63..3a8e55752 100644 --- a/MatricesForHomalg/PackageInfo.g +++ b/MatricesForHomalg/PackageInfo.g @@ -5,7 +5,7 @@ PackageName := "MatricesForHomalg", Subtitle := "Matrices for the homalg project", Version := Maximum( [ - "2020.09.05", ## Mohamed's version + "2020.10.03", ## Mohamed's version ## this line prevents merge conflicts "2020.10.02", ## Fabian's version ## this line prevents merge conflicts diff --git a/MatricesForHomalg/gap/LIMAT.gi b/MatricesForHomalg/gap/LIMAT.gi index 1726af8af..ad845cdf1 100644 --- a/MatricesForHomalg/gap/LIMAT.gi +++ b/MatricesForHomalg/gap/LIMAT.gi @@ -497,8 +497,8 @@ InstallImmediateMethod( ZeroRows, end ); ## -InstallImmediateMethod( ZeroRows, - IsHomalgMatrix and HasPositionOfFirstNonZeroEntryPerRow and HasNrRows, 0, +InstallMethod( ZeroRows, + [ IsHomalgMatrix and HasPositionOfFirstNonZeroEntryPerRow and HasNrRows ], 0, function( M ) local pos; @@ -510,8 +510,8 @@ InstallImmediateMethod( ZeroRows, end ); ## -InstallImmediateMethod( ZeroRows, - IsHomalgMatrix and HasPositionOfFirstNonZeroEntryPerColumn and IsSubidentityMatrix and HasNrRows, 0, +InstallMethod( ZeroRows, + [ IsHomalgMatrix and HasPositionOfFirstNonZeroEntryPerColumn and IsSubidentityMatrix and HasNrRows ], 0, function( M ) local pos; @@ -523,8 +523,8 @@ InstallImmediateMethod( ZeroRows, end ); ## -InstallImmediateMethod( ZeroRows, - IsHomalgMatrix and HasEvalCertainRows, 0, +InstallMethod( ZeroRows, + [ IsHomalgMatrix and HasEvalCertainRows ], 0, function( M ) local e; @@ -577,8 +577,8 @@ InstallImmediateMethod( ZeroColumns, end ); ## -InstallImmediateMethod( ZeroColumns, - IsHomalgMatrix and HasPositionOfFirstNonZeroEntryPerColumn and HasNrColumns, 0, +InstallMethod( ZeroColumns, + [ IsHomalgMatrix and HasPositionOfFirstNonZeroEntryPerColumn and HasNrColumns ], 0, function( M ) local pos; @@ -590,8 +590,8 @@ InstallImmediateMethod( ZeroColumns, end ); ## -InstallImmediateMethod( ZeroColumns, - IsHomalgMatrix and HasPositionOfFirstNonZeroEntryPerRow and IsSubidentityMatrix and HasNrColumns, 0, +InstallMethod( ZeroColumns, + [ IsHomalgMatrix and HasPositionOfFirstNonZeroEntryPerRow and IsSubidentityMatrix and HasNrColumns ], 0, function( M ) local pos; @@ -603,8 +603,8 @@ InstallImmediateMethod( ZeroColumns, end ); ## -InstallImmediateMethod( ZeroColumns, - IsHomalgMatrix and HasEvalCertainColumns, 0, +InstallMethod( ZeroColumns, + [ IsHomalgMatrix and HasEvalCertainColumns ], 0, function( M ) local e; @@ -623,8 +623,8 @@ InstallImmediateMethod( ZeroColumns, end ); ## -InstallImmediateMethod( NonZeroRows, - IsHomalgMatrix and HasZeroRows and HasNrRows, 0, +InstallMethod( NonZeroRows, + [ IsHomalgMatrix and HasZeroRows and HasNrRows ], 0, function( M ) @@ -653,8 +653,8 @@ InstallImmediateMethod( NonZeroRows, end ); ## -InstallImmediateMethod( NonZeroColumns, - IsHomalgMatrix and HasZeroColumns and HasNrColumns, 0, +InstallMethod( NonZeroColumns, + [ IsHomalgMatrix and HasZeroColumns and HasNrColumns ], 0, function( M ) @@ -696,9 +696,9 @@ InstallImmediateMethod( PositionOfFirstNonZeroEntryPerRow, end ); -## -InstallImmediateMethod( PositionOfFirstNonZeroEntryPerRow, - IsHomalgMatrix and IsZero and HasNrRows, 0, +## the result might be too big, so only compute when necessary +InstallMethod( PositionOfFirstNonZeroEntryPerRow, + [ IsHomalgMatrix and IsZero and HasNrRows ], 0, function( M ) @@ -720,9 +720,9 @@ InstallImmediateMethod( PositionOfFirstNonZeroEntryPerColumn, end ); -## -InstallImmediateMethod( PositionOfFirstNonZeroEntryPerColumn, - IsHomalgMatrix and IsZero and HasNrColumns, 0, +## the result might be too big, so only compute when necessary +InstallMethod( PositionOfFirstNonZeroEntryPerColumn, + [ IsHomalgMatrix and IsZero and HasNrColumns ], 0, function( M )