Class DistanceMap

java.lang.Object
ffx.numerics.clustering.DistanceMap

public class DistanceMap extends Object
Container for linkages with the minimal methods needed in the package Created by Alexandre Masselot on 7/18/14.
Since:
1.0
Author:
Lars Behnke, 2013, Michael J. Schnieders
  • Field Details

    • logger

      public static final Logger logger
  • Constructor Details

    • DistanceMap

      public DistanceMap()
  • Method Details

    • list

      public List<ClusterPair> list()
      Returns a snapshot list of all cluster pairs currently stored.
      Returns:
      list of ClusterPair entries in this map
    • findByCodePair

      public ClusterPair findByCodePair(Cluster c1, Cluster c2)
      Finds the ClusterPair for the two provided clusters.
      Parameters:
      c1 - the first cluster
      c2 - the second cluster
      Returns:
      the matching ClusterPair, or null if absent
    • removeFirst

      public ClusterPair removeFirst()
      Removes and returns the minimal-distance pair (according to priority queue ordering).
      Returns:
      the next ClusterPair, or null if none
    • remove

      public boolean remove(ClusterPair link)
      Marks the given ClusterPair as removed (lazy removal) and drops it from the hash index.
      Parameters:
      link - the ClusterPair to remove
      Returns:
      true if the pair was present and marked removed; false otherwise
    • add

      public boolean add(ClusterPair link)
      Adds a new ClusterPair if no equivalent pair already exists.
      Parameters:
      link - the pair to add
      Returns:
      true if added; false if a duplicate existed
    • minDist

      public Double minDist()
      Peek at the minimal linkage distance currently in the map.
      Returns:
      the smallest linkage distance, or null if empty
    • toString

      public String toString()
      Overrides:
      toString in class Object