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

RowEchelonForm now supported in Singular and Maple #597

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MatricesForHomalg/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SetPackageInfo( rec(

PackageName := "MatricesForHomalg",
Subtitle := "Matrices for the homalg project",
Version := "2023.10-01",
Version := "2023.11-01",
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
License := "GPL-2.0-or-later",

Expand Down
12 changes: 9 additions & 3 deletions MatricesForHomalg/gap/Service.gi
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,19 @@

B := RP!.RowEchelonForm( M );

ColoredInfoForService( t, "RowEchelonForm", Length( NonZeroRows( B ) ) );
B := CertainRows( B, NonZeroRows( B ) );

Check warning on line 175 in MatricesForHomalg/gap/Service.gi

View check run for this annotation

Codecov / codecov/patch

MatricesForHomalg/gap/Service.gi#L175

Added line #L175 was not covered by tests

ColoredInfoForService( t, "RowEchelonForm", NumberRows( B ) );

Check warning on line 177 in MatricesForHomalg/gap/Service.gi

View check run for this annotation

Codecov / codecov/patch

MatricesForHomalg/gap/Service.gi#L177

Added line #L177 was not covered by tests

return B;

elif IsBound(RP!.ColumnEchelonForm) then

B := Involution( RP!.ColumnEchelonForm( Involution( M ) ) );

ColoredInfoForService( t, "RowEchelonForm", Length( NonZeroRows( B ) ) );
B := CertainRows( B, NonZeroRows( B ) );

Check warning on line 185 in MatricesForHomalg/gap/Service.gi

View check run for this annotation

Codecov / codecov/patch

MatricesForHomalg/gap/Service.gi#L185

Added line #L185 was not covered by tests

ColoredInfoForService( t, "RowEchelonForm", NumberRows( B ) );

Check warning on line 187 in MatricesForHomalg/gap/Service.gi

View check run for this annotation

Codecov / codecov/patch

MatricesForHomalg/gap/Service.gi#L187

Added line #L187 was not covered by tests

return B;

Expand Down Expand Up @@ -252,7 +256,9 @@

B := RP!.ColumnEchelonForm( M );

ColoredInfoForService( t, "ColumnEchelonForm", Length( NonZeroColumns( B ) ) );
B := CertainColumns( B, NonZeroColumns( B ) );

Check warning on line 259 in MatricesForHomalg/gap/Service.gi

View check run for this annotation

Codecov / codecov/patch

MatricesForHomalg/gap/Service.gi#L259

Added line #L259 was not covered by tests

ColoredInfoForService( t, "ColumnEchelonForm", NumberColumns( B ) );

Check warning on line 261 in MatricesForHomalg/gap/Service.gi

View check run for this annotation

Codecov / codecov/patch

MatricesForHomalg/gap/Service.gi#L261

Added line #L261 was not covered by tests

return B;

Expand Down
2 changes: 1 addition & 1 deletion RingsForHomalg/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SetPackageInfo( rec(

PackageName := "RingsForHomalg",
Subtitle := "Dictionaries of external rings",
Version := "2023.09-01",
Version := "2023.11-01",
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
License := "GPL-2.0-or-later",

Expand Down
14 changes: 14 additions & 0 deletions RingsForHomalg/gap/MapleHomalgBasic.gi
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@
## Must only then be provided by the RingPackage in case the default
## "service" function does not match the Ring

RowEchelonForm :=
function( M )
local R, N;

R := HomalgRing( M );

Check warning on line 26 in RingsForHomalg/gap/MapleHomalgBasic.gi

View check run for this annotation

Codecov / codecov/patch

RingsForHomalg/gap/MapleHomalgBasic.gi#L26

Added line #L26 was not covered by tests

N := HomalgVoidMatrix( "unknown_number_of_rows", NumberColumns( M ), R );

Check warning on line 28 in RingsForHomalg/gap/MapleHomalgBasic.gi

View check run for this annotation

Codecov / codecov/patch

RingsForHomalg/gap/MapleHomalgBasic.gi#L28

Added line #L28 was not covered by tests

homalgSendBlocking( [ N, " := ", R, "[-1][matrix](LinearAlgebra[GaussianElimination](Matrix(", M, "), 'method' = 'FractionFree'))" ], "need_command", "ReducedEchelonForm" );

Check warning on line 30 in RingsForHomalg/gap/MapleHomalgBasic.gi

View check run for this annotation

Codecov / codecov/patch

RingsForHomalg/gap/MapleHomalgBasic.gi#L30

Added line #L30 was not covered by tests

return N;

Check warning on line 32 in RingsForHomalg/gap/MapleHomalgBasic.gi

View check run for this annotation

Codecov / codecov/patch

RingsForHomalg/gap/MapleHomalgBasic.gi#L32

Added line #L32 was not covered by tests

end,

BasisOfRowModule :=
function( M )
local R, N;
Expand Down
24 changes: 24 additions & 0 deletions RingsForHomalg/gap/SingularBasic.gi
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,30 @@ BindGlobal( "CommonHomalgTableForSingularBasic",
## Must only then be provided by the RingPackage in case the default
## "service" function does not match the Ring

RowEchelonForm :=
function( M )
local R, v, N;

R := HomalgRing( M );

v := homalgStream( R ).variable_name;

N := HomalgVoidMatrix( "unknown_number_of_rows", NumberColumns( M ), R );

homalgSendBlocking( [ "intvec ", v, "option = option(get); option(none); option(prompt); option(intStrategy)" ], R, "need_command", "initialize" );

homalgSendBlocking(
[ "matrix ", N, " = BasisOfRowModule(", M, ")" ],
"need_command",
"ReducedEchelonForm"
);

homalgSendBlocking( [ "option(set,", v, "option)" ], R, "need_command", "initialize" );

return CertainRows( N, Reversed( [ 1 .. NumberRows( N ) ] ) );

end,

## <#GAPDoc Label="BasisOfRowModule:Singular">
## <ManSection>
## <Func Arg="M" Name="BasisOfRowModule" Label="in the homalg table for Singular"/>
Expand Down