Skip to content

Commit

Permalink
Add new hash function for transformations for GAP >= 4.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Neunhoeffer committed May 2, 2013
1 parent 067021f commit f5c84e2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ orb.la
orb_la-orb.lo
src/pkgconfig.h
src/stamp-h1

*.DS_Store
*.swp
*.swo
19 changes: 15 additions & 4 deletions gap/hash.gi
Original file line number Diff line number Diff line change
Expand Up @@ -778,10 +778,21 @@ else
end );
fi;

InstallGlobalFunction( ORB_HashFunctionForTransformations,
function(t,data)
return ORB_HashFunctionForPlainFlatList(t![1],data);
end );
if CompareVersionNumbers(GAPInfo.Version,"4.7") then
InstallGlobalFunction( ORB_HashFunctionForTransformations,
function(t,data)
if IsTrans2Rep(t) then
return HashKeyBag(t,255,0,2*DegreeOfTransformation(t)) mod data + 1;
else
return HashKeyBag(t,255,0,4*DegreeOfTransformation(t)) mod data + 1;
fi;
end );
else
InstallGlobalFunction( ORB_HashFunctionForTransformations,
function(t,data)
return ORB_HashFunctionForPlainFlatList(t![1],data);
end );
fi;

InstallGlobalFunction( MakeHashFunctionForPlainFlatList,
function( len )
Expand Down

0 comments on commit f5c84e2

Please sign in to comment.