Documentation

Aesop.Util.UnionFind

structure Aesop.UnionFind (α : Type u_1) [BEq α] [Hashable α] :
Type u_1
  • 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
    def Aesop.instInhabitedUnionFind.default {a✝ : Type u_1} {a✝¹ : BEq a✝} {a✝² : Hashable a✝} :
    Equations
    Instances For
      @[implicit_reducible]
      instance Aesop.UnionFind.instEmptyCollection {α : Type u_1} [BEq α] [Hashable α] :
      EmptyCollection (UnionFind α)
      Equations
      def Aesop.UnionFind.size {α : Type u_1} [BEq α] [Hashable α] (u : UnionFind α) :
      Nat
      Equations
      Instances For
        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.
        Instances For
          def Aesop.UnionFind.addArray {α : Type u_1} [BEq α] [Hashable α] (xs : Array α) (u : UnionFind α) :
          Equations
          Instances For
            def Aesop.UnionFind.ofArray {α : Type u_1} [BEq α] [Hashable α] (xs : Array α) :
            Equations
            Instances For
              def Aesop.UnionFind.find? {α : Type u_1} [BEq α] [Hashable α] (x : α) (u : UnionFind α) :
              Option USize × UnionFind α
              Equations
              Instances For
                @[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 α) :
                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.
                  Instances For