Documentation

Aesop.Util.UnionFind

structure Aesop.UnionFind (α : Type u_1) [BEq α] [Hashable α] :
Type u_1
instance Aesop.instInhabitedUnionFind {a✝ : Type u_1} {a✝¹ : BEq a✝} {a✝² : Hashable a✝} :
Equations
Equations
def Aesop.UnionFind.size {α : Type u_1} [BEq α] [Hashable α] (u : UnionFind α) :
Equations
def Aesop.UnionFind.add {α : Type u_1} [BEq α] [Hashable α] (x : α) (u : UnionFind α) :
Equations
  • One or more equations did not get rendered due to their size.
def Aesop.UnionFind.addArray {α : Type u_1} [BEq α] [Hashable α] (xs : Array α) (u : UnionFind α) :
Equations
def Aesop.UnionFind.find? {α : Type u_1} [BEq α] [Hashable α] (x : α) (u : UnionFind α) :
Equations
@[implemented_by _private.Aesop.Util.UnionFind.0.Aesop.UnionFind.mergeUnsafe]
opaque Aesop.UnionFind.merge {α : Type u_1} [BEq α] [Hashable α] (x y : α) :
def Aesop.UnionFind.sets {α : Type v} [BEq α] [Hashable α] (u : UnionFind α) :
Equations
  • One or more equations did not get rendered due to their size.
def Aesop.cluster {α : Type (max u_1 u_2)} {β : Type u_2} [BEq α] [Hashable α] [BEq β] [Hashable β] (f : αArray β) (as : 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.