From d5d687bedd3e6ca3232e2c98e6dd89592c2661be Mon Sep 17 00:00:00 2001 From: Alexander Hulpke Date: Thu, 27 Sep 2018 09:34:47 -0600 Subject: [PATCH] Added more expensive test. Also included `sisyphus` option to force extra work for testing and minor code cleanup by using `Remove`. --- lib/csetgrp.gi | 29 +++++++++++++++++++++++------ tst/testextra/doublecoset.tst | 19 +++++++++++++++++++ tst/teststandard/permgrp.tst | 8 ++++++++ 3 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 tst/testextra/doublecoset.tst diff --git a/lib/csetgrp.gi b/lib/csetgrp.gi index 5b5d3ac165..95008c2eec 100644 --- a/lib/csetgrp.gi +++ b/lib/csetgrp.gi @@ -851,12 +851,23 @@ local live,orbs,orbset,done,nr,p,o,os,orbitextender,bahn,i,j,enum,dict,map,pam; if IsBound(map[j]) and map[j]>i then map[j]:=map[j]-1; fi; od; - p:=[i..Length(orbs)-1]; - orbs{p}:=orbs{p+1};Unbind(orbs[Length(orbs)]); - orbset{p}:=orbset{p+1};Unbind(orbset[Length(orbset)]); - done{p}:=done{p+1};Unbind(done[Length(done)]); - bahn{p}:=bahn{p+1};Unbind(bahn[Length(bahn)]); - pam{p}:=pam{p+1};Unbind(pam[Length(pam)]); +<<<<<<< HEAD + # Remove entry i, i.e. + #p:=[i..Length(orbs)-1]; + #orbs{p}:=orbs{p+1};Unbind(orbs[Length(orbs)]); +======= + #p:=[i..Length(orbs)-1]; + #orbs{p}:=orbs{p+1};Unbind(orbs[Length(orbs)]); + #orbset{p}:=orbset{p+1};Unbind(orbset[Length(orbset)]); + #done{p}:=done{p+1};Unbind(done[Length(done)]); + #bahn{p}:=bahn{p+1};Unbind(bahn[Length(bahn)]); + #pam{p}:=pam{p+1};Unbind(pam[Length(pam)]); +>>>>>>> 57ac0bd2e... Added `sisyphus` option to force extra work for testing + Remove(orbs,i); + Remove(orbset,i); + Remove(done,i); + Remove(bahn,i); + Remove(pam,i); else done[i]:=-p; fi; @@ -1029,6 +1040,12 @@ local c, flip, maxidx, refineChainActionLimit, cano, tryfct, p, r, t, fi; + elif ValueOption("sisyphus")=true then + # purely to allow for tests of up-step mechanism in smaller examples. + # This is creating unneccessary extra work and thus should never be used + # in practice, but will force some code to be run through. + c:=Concatenation([TrivialSubgroup(G)],c); + cano:=true; fi; r:=[One(G)]; diff --git a/tst/testextra/doublecoset.tst b/tst/testextra/doublecoset.tst new file mode 100644 index 0000000000..3eca30ddee --- /dev/null +++ b/tst/testextra/doublecoset.tst @@ -0,0 +1,19 @@ +############################################################################# +## +#W doublecoset.tst Alexander Hulpke +## +## +#Y Copyright (C) 1997, Lehrstuhl D für Mathematik, RWTH Aachen, Germany +## +## This file tests for double coset calculations +## +gap> START_TEST("doublecoset.tst"); +gap> g:=SimpleGroup("Co3");; +gap> m:=MaximalSubgroupClassReps(g);; +gap> u:=First(m,x->Index(g,x)=17931375);; +gap> dc:=DoubleCosetRepsAndSizes(g,u,u);; +gap> Length(dc);Sum(dc,x->x[2])=Size(g); +913 +true + +gap> STOP_TEST( "doublecoset.tst", 1); diff --git a/tst/teststandard/permgrp.tst b/tst/teststandard/permgrp.tst index 34a0a3df48..fa01da2a92 100644 --- a/tst/teststandard/permgrp.tst +++ b/tst/teststandard/permgrp.tst @@ -26,6 +26,14 @@ gap> p:=Image(IsomorphismPermGroup(g));; gap> s:=SylowSubgroup(p,7);; gap> Length(IntermediateSubgroups(p,s).subgroups); 71 +gap> g:=SymmetricGroup(9);;s:=SylowSubgroup(g,3);; +gap> dc:=DoubleCosetRepsAndSizes(g,s,s);; +gap> Length(dc);Sum(dc,x->x[2])=Size(g); +88 +true +gap> dc1:=DoubleCosetRepsAndSizes(g,s,s:sisyphus);; +gap> Collected(List(dc,x->x[2]))=Collected(List(dc1,x->x[2])); +true # Unbind variables so we can GC memory gap> Unbind(g); Unbind(dc); Unbind(ac); Unbind(g); Unbind(p); Unbind(s);