Skip to content

Commit

Permalink
Make Orb use digraph hashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
reiniscirpons committed Aug 29, 2024
1 parent 1f05fc9 commit 9762d43
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gap/attr.gi
Original file line number Diff line number Diff line change
Expand Up @@ -750,13 +750,23 @@ function(D)
return out;
end);

# Hash related attributes

InstallMethod(DigraphHash, "for a digraph", [IsDigraph], DIGRAPH_HASH);

# To make built in Orbit function use DigraphHash
InstallMethod(SparseIntKey, "for an object and digraph",
[IsObject, IsDigraph],
{coll, D} -> DigraphHash
);

# To make orb package use DigraphHash
InstallMethod(ChooseHashFunction, "for a digraph and positive integer",
[IsDigraph, IsInt],
{D, hashlen} -> rec(func := {x, data} -> 1 + (DigraphHash(x) mod data[1]),
data := [hashlen])
);

# attributes for digraphs . . .

InstallMethod(AsGraph, "for a digraph", [IsDigraph], Graph);
Expand Down

0 comments on commit 9762d43

Please sign in to comment.