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

Introduce RingFilter and RingElementFilter #599

Merged
merged 1 commit into from
Nov 30, 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
3 changes: 2 additions & 1 deletion GaussForHomalg/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SetPackageInfo( rec(

PackageName := "GaussForHomalg",
Subtitle := "Gauss functionality 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 Expand Up @@ -80,6 +80,7 @@ PackageDoc := rec(
Dependencies := rec(
GAP := ">= 4.12.1",
NeededOtherPackages := [
[ "ToolsForHomalg", ">= 2023.11-01" ],
[ "Gauss", ">= 2021.04-01" ],
[ "MatricesForHomalg", ">= 2023.10-01" ],
[ "GAPDoc", ">= 1.0" ] ],
Expand Down
3 changes: 3 additions & 0 deletions GaussForHomalg/gap/GaussRationals.gi
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ InstallGlobalFunction( HomalgFieldOfRationals,

R := CreateHomalgRing( Rationals );

SetRingFilter( R, IsHomalgRing );
SetRingElementFilter( R, IsRat );

SetIsRationalsForHomalg( R, true );

SetRingProperties( R, 0 );
Expand Down
3 changes: 2 additions & 1 deletion HomalgToCAS/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SetPackageInfo( rec(

PackageName := "HomalgToCAS",
Subtitle := "A window to the outer world",
Version := "2023.08-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 Expand Up @@ -160,6 +160,7 @@ PackageDoc := rec(
Dependencies := rec(
GAP := ">= 4.12.1",
NeededOtherPackages := [
[ "ToolsForHomalg", ">= 2023.11-01" ],
[ "MatricesForHomalg", ">= 2023.08-01" ],
[ "GAPDoc", ">= 1.0" ]
],
Expand Down
3 changes: 3 additions & 0 deletions HomalgToCAS/gap/HomalgExternalRing.gi
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,9 @@ InstallGlobalFunction( CreateHomalgExternalRing,
## create the external ring
R := CallFuncList( CreateHomalgRing, ar );

SetRingFilter( R, IsHomalgRing );
SetRingElementFilter( R, IsHomalgRingElement );

## for the view methods:
## <A matrix over an external ring>
R!.description := "n external";
Expand Down
4 changes: 2 additions & 2 deletions 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.11-01",
Version := "2023.11-02",
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 Expand Up @@ -112,7 +112,7 @@ PackageDoc := rec(
Dependencies := rec(
GAP := ">= 4.12.1",
NeededOtherPackages := [
[ "ToolsForHomalg", ">= 2018.12.15" ],
[ "ToolsForHomalg", ">= 2023.11-01" ],
[ "GAPDoc", ">= 1.0" ] ],
SuggestedOtherPackages := [ ],
ExternalConditions := []
Expand Down
2 changes: 2 additions & 0 deletions MatricesForHomalg/gap/HomalgRing.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2078,6 +2078,8 @@ InstallGlobalFunction( HomalgRingOfIntegers,
if nargs = 0 or arg[1] = 0 then
c := 0;
R := CreateHomalgRing( Integers );
SetRingFilter( R, IsHomalgRing );
mohamed-barakat marked this conversation as resolved.
Show resolved Hide resolved
SetRingElementFilter( R, IsInt );
elif IsInt( arg[1] ) then
c := arg[1];
if Length( Collected( FactorsInt( c ) ) ) = 1 and IsPackageMarkedForLoading( "GaussForHomalg", ">= 2018.09.20") then
Expand Down
2 changes: 1 addition & 1 deletion ToolsForHomalg/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "ToolsForHomalg",
Subtitle := "Special methods and knowledge propagation tools",
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
29 changes: 29 additions & 0 deletions ToolsForHomalg/gap/ToolsForHomalg.gd
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,35 @@ DeclareCategory( "IsContainerForWeakPointers",
DeclareCategory( "IsContainerForPointers",
IsComponentObjectRep );

####################################
#
# attributes:
#
####################################

#! @Section Attributes

#! @Description
#! A filter inheriting from `IsRing` which uniquely identifies the ring <A>ring</A>.
#! For example, the ring `Integers` is identified by `IsIntegers`.
#! If no filter uniquely identifying the ring exists,
#! the most special filter available should be chosen.
#! @Arguments ring
DeclareAttribute( "RingFilter",
IsRing );

#! @Description
#! A filter inheriting from `IsRingElement` which uniquely identifies elements of the ring <A>ring</A>.
#! For example, the elements of the ring `Integers` are identified by `IsInt`.
#! If no filter uniquely identifying the elements of the ring exists,
#! the most special filter available should be chosen.
#! @Arguments ring
DeclareAttribute( "RingElementFilter",
IsRing );

SetRingFilter( Integers, IsIntegers );
SetRingElementFilter( Integers, IsInt );

####################################
#
# global functions and operations:
Expand Down