Skip to content

Commit

Permalink
Merge branch 'pr-5' into devel
Browse files Browse the repository at this point in the history
* pr-5:
  Shortened global function ConvertToMapOfFinSets using PositionsProperty
  • Loading branch information
mohamed-barakat committed Apr 13, 2020
2 parents 82a118e + 02d0770 commit 5bb4c21
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions gap/CatRepsWithCAP.gi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
##
InstallGlobalFunction( ConvertToMapOfFinSets,
function( objects, gen )
local O, T, isb, S, G, j, i;
local O, T, S, G, j, i;

for O in objects do
if Length(Intersection(gen,O)) > 0 then
Expand All @@ -20,21 +20,7 @@ InstallGlobalFunction( ConvertToMapOfFinSets,
Error( "unable to find target set\n" );
fi;

## returns the positions i in L where L[i] is bound as a dense list.
isb := function(L)
local M,i,j;
j := 1;
M := [];
for i in [1..Length(L)] do
if IsBound(L[i]) then
M[j] := i;
j := j+1;
fi;
od;
return M;
end;

S := FinSet(isb(gen));
S := FinSet(PositionsProperty(Flat(objects),i->IsBound(gen[i])));

G := [];
j := 1;
Expand Down

0 comments on commit 5bb4c21

Please sign in to comment.