From b106a4421f9dbdaabebe44c3d689c08b939229f1 Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Wed, 22 Jun 2016 17:36:20 +0100 Subject: [PATCH] Fix bug in FixedPoints for a partial perm coll Previously it called MovedPoints! --- lib/pperm.gi | 2 +- lib/semipperm.gi | 2 +- tst/testinstall/semipperm.tst | 41 +++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 tst/testinstall/semipperm.tst diff --git a/lib/pperm.gi b/lib/pperm.gi index 25eeda2e8a..d9ce3970ba 100644 --- a/lib/pperm.gi +++ b/lib/pperm.gi @@ -740,7 +740,7 @@ InstallMethod(MovedPoints, "for a partial perm coll", [IsPartialPermCollection], coll-> Union(List(coll, MovedPoints))); InstallMethod(NrFixedPoints, "for a partial perm coll", -[IsPartialPermCollection], coll-> Length(MovedPoints(coll))); +[IsPartialPermCollection], coll-> Length(FixedPointsOfPartialPerm(coll))); InstallMethod(NrMovedPoints, "for a partial perm coll", [IsPartialPermCollection], coll-> Length(MovedPoints(coll))); diff --git a/lib/semipperm.gi b/lib/semipperm.gi index e5ae6c57f3..24af84a0b9 100644 --- a/lib/semipperm.gi +++ b/lib/semipperm.gi @@ -109,7 +109,7 @@ s-> ImageOfPartialPermCollection(GeneratorsOfSemigroup(s))); InstallMethod(FixedPointsOfPartialPerm, "for a partial perm semigroup", [IsPartialPermSemigroup], -s-> MovedPoints(GeneratorsOfSemigroup(s))); +s-> FixedPointsOfPartialPerm(GeneratorsOfSemigroup(s))); InstallMethod(MovedPoints, "for a partial perm semigroup", [IsPartialPermSemigroup], diff --git a/tst/testinstall/semipperm.tst b/tst/testinstall/semipperm.tst new file mode 100644 index 0000000000..332275e5ee --- /dev/null +++ b/tst/testinstall/semipperm.tst @@ -0,0 +1,41 @@ +############################################################################# +## +#W semipperm.tst +#Y James D. Mitchell +## +############################################################################# +## +gap> START_TEST("semipperm.tst"); + +# Test DisplayString +gap> S := Semigroup(PartialPerm([1, 2, 3], [4, 5, 11]), +> PartialPerm([1], [3]));; +gap> DisplayString(S); +"\><\>partial perm\< \>semigroup\< \>of\< \>rank \>3\<\< \>with\< \>2\< \>gene\ +rators\<>\<" + +# Test Fixed/moved points etc +gap> S := Semigroup(PartialPerm([1, 2, 3, 4, 6, 7, 10], [10, 8, 4, 6, 5, 3, 2]), +> PartialPerm([1, 2, 4, 5, 6, 9, 10], [3, 5, 8, 4, 1, 9, 7]), +> PartialPerm([1, 2, 4, 7, 9], [5, 3, 7, 4, 9]), +> PartialPerm([1, 2, 3, 4, 6, 8], [5, 1, 10, 7, 8, 9])); + +gap> FixedPointsOfPartialPerm(S); +[ 9 ] +gap> MovedPoints(S); +[ 1, 2, 3, 4, 5, 6, 7, 8, 10 ] +gap> NrFixedPoints(S); +1 +gap> NrMovedPoints(S); +9 +gap> LargestMovedPoint(S); +10 +gap> LargestImageOfMovedPoint(S); +10 +gap> SmallestMovedPoint(S); +1 +gap> SmallestImageOfMovedPoint(S); +1 + +# +gap> STOP_TEST( "semipperm.tst", 10000);