- parents : Array USize
- sizes : Array USize
- toRep : Std.HashMap α USize
Instances For
@[implicit_reducible]
instance
Aesop.instInhabitedUnionFind
{a✝ : Type u_1}
{a✝¹ : BEq a✝}
{a✝² : Hashable a✝}
:
Inhabited (UnionFind a✝)
Equations
- Aesop.instInhabitedUnionFind = { default := Aesop.instInhabitedUnionFind.default }
def
Aesop.instInhabitedUnionFind.default
{a✝ : Type u_1}
{a✝¹ : BEq a✝}
{a✝² : Hashable a✝}
:
UnionFind a✝
Equations
- Aesop.instInhabitedUnionFind.default = { parents := default, sizes := default, toRep := default }
Instances For
@[implicit_reducible]
instance
Aesop.UnionFind.instEmptyCollection
{α : Type u_1}
[BEq α]
[Hashable α]
:
EmptyCollection (UnionFind α)
Equations
- Aesop.UnionFind.instEmptyCollection = { emptyCollection := { parents := #[], sizes := #[], toRep := ∅ } }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Aesop.UnionFind.addArray xs u = Array.foldl (fun (u : Aesop.UnionFind α) (x : α) => Aesop.UnionFind.add x u) u xs
Instances For
Equations
Instances For
def
Aesop.UnionFind.find?
{α : Type u_1}
[BEq α]
[Hashable α]
(x : α)
(u : UnionFind α)
:
Option USize × UnionFind α
Equations
- Aesop.UnionFind.find? x u = match u.toRep[x]? with | none => (none, u) | some rep => match Aesop.UnionFind.findRep✝ rep u with | (rep, u) => (some rep, u)
Instances For
@[implemented_by _private.Aesop.Util.UnionFind.0.Aesop.UnionFind.mergeUnsafe]
def
Aesop.UnionFind.sets
{α : Type v}
[BEq α]
[Hashable α]
(u : UnionFind α)
:
Array (Array α) × UnionFind α
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Aesop.cluster
{α : Type (max u_1 u_2)}
{β : Type u_2}
[BEq α]
[Hashable α]
[BEq β]
[Hashable β]
(f : α → Array β)
(as : Array α)
:
Array (Array α)
Cluster the as according to which bs are associated to them by f. Two
members a₁, a₂ of as are put in the same cluster iff f a₁ ∩ f a₂ ≠ ∅.
Equations
- One or more equations did not get rendered due to their size.