diff --git a/init.g b/init.g index 4801060..2e70fd9 100644 --- a/init.g +++ b/init.g @@ -28,6 +28,22 @@ if not IsBound(MultVector) then DeclareSynonym( "MultVector", MultRowVector ); fi; +# +# GAP >= 4.17 has unchecked NC variants of the PreImages operations +# +if not IsBound( PreImagesNC ) then + BindGlobal( "PreImagesNC", PreImages ); +fi; +if not IsBound( PreImagesElmNC ) then + BindGlobal( "PreImagesElmNC", PreImagesElm ); +fi; +if not IsBound( PreImagesSetNC ) then + BindGlobal( "PreImagesSetNC", PreImagesSet ); +fi; +if not IsBound( PreImagesRepresentativeNC ) then + BindGlobal( "PreImagesRepresentativeNC", PreImagesRepresentative ); +fi; + ReadPackage("fining","lib/geometry.gd"); ReadPackage("fining","lib/liegeometry.gd"); diff --git a/lib/gpolygons.gi b/lib/gpolygons.gi index c8014fc..69989da 100644 --- a/lib/gpolygons.gi +++ b/lib/gpolygons.gi @@ -4020,7 +4020,7 @@ InstallMethod( EGQByBLTSet, [0,0,0,1,0,0],[0,0,0,0,1,0]]*One(f)); q4qcanonical := Range(duality)!.geometry; iso := IsomorphismPolarSpaces(q4q, q4qcanonical); - bltdual := PreImagesSet(duality, ImagesSet(iso, blt)); + bltdual := PreImagesSetNC(duality, ImagesSet(iso, blt)); Info(InfoFinInG, 1, "Now embedding dual BLT-set into W(5,q)..."); @@ -4301,7 +4301,7 @@ InstallMethod( FlockGQByqClan, [ IsqClanObj ], imgs := Filtered([1..Size(omega)], x -> omega[x] in blt);; stabblt := Stabilizer(Image(hom), imgs, OnSets); gens := GeneratorsOfGroup(stabblt); - gens := List(gens, x -> PreImagesRepresentative(hom, x)); + gens := List(gens, x -> PreImagesRepresentativeNC(hom, x)); stabblt := GroupWithGenerators(gens); Info(InfoFinInG, 1, "..computed stabiliser of BLT set"); diff --git a/lib/morphisms.gi b/lib/morphisms.gi index bbc585e..77dc81d 100644 --- a/lib/morphisms.gi +++ b/lib/morphisms.gi @@ -204,15 +204,25 @@ InstallOtherMethod( PreImageElm, # CHECKED 27/09/11 jdb ############################################################################# -#O PreImagesSet( , ) +#O PreImagesSetNC( , ) ## -InstallOtherMethod( PreImagesSet, +InstallOtherMethod( PreImagesSetNC, "for a geometry morphism and an element of an incidence structure", [IsGeometryMorphism, IsElementOfIncidenceStructureCollection], function(em, x) return List(x, t -> em!.prefun(t)); end ); +# The generic PreImagesSet fails its IsSubset( Range( em ), x ) check for +# geometry morphisms. Without PreImagesSetNC in GAP, both names denote the +# same operation, see init.g. +if not IsIdenticalObj( PreImagesSet, PreImagesSetNC ) then + InstallOtherMethod( PreImagesSet, + "for a geometry morphism and an element of an incidence structure", + [IsGeometryMorphism, IsElementOfIncidenceStructureCollection], + PreImagesSetNC ); +fi; + ########################################################## ## User methods for the "natural geometry morphisms" ########################################################## diff --git a/lib/orbits-stabilisers.gi b/lib/orbits-stabilisers.gi index e6174af..8d0f753 100644 --- a/lib/orbits-stabilisers.gi +++ b/lib/orbits-stabilisers.gi @@ -411,7 +411,7 @@ InstallMethod( FiningStabiliserPerm, [IsProjectiveGroupWithFrob, IsElementOfInci nr:=Position(enum,el); stab:=Stabilizer(Image(hom),nr); gens:=GeneratorsOfGroup(stab);; - gens:=List(gens,x->PreImagesRepresentative(hom,x)); + gens:=List(gens,x->PreImagesRepresentativeNC(hom,x)); stab:=GroupWithGenerators(gens); return stab; end ); @@ -433,7 +433,7 @@ InstallMethod( FiningStabiliserPerm2, stab:=Stab(im,nr,OnPoints,rec( DoEstimate := size )).stab; #stab:=Stabiliser(Image(hom),nr); gens:=GeneratorsOfGroup(stab);; - gens:=List(gens,x->PreImagesRepresentative(hom,x)); + gens:=List(gens,x->PreImagesRepresentativeNC(hom,x)); stab:=GroupWithGenerators(gens); return stab; end ); diff --git a/tst/bugfix.tst b/tst/bugfix.tst index 413e85e..75a7986 100644 --- a/tst/bugfix.tst +++ b/tst/bugfix.tst @@ -20,5 +20,13 @@ gap> ElationOfProjectiveSpace(l, p, q); gap> SingerCycleCollineation(2, 2^6); < a collineation: , F^0> +# GAP >= 4.17 calls PreImagesSetNC internally +gap> d := NaturalDuality(SymplecticSpace(3, 3));; +gap> pts := AsList(Points(Range(d)!.geometry)){[1..3]};; +gap> PreImagesSetNC(d, pts) = List(pts, x -> PreImageElm(d, x)); +true +gap> PreImagesSet(d, pts) = PreImagesSetNC(d, pts); +true + # gap> STOP_TEST("bugfix.tst", 1 );