Package ffx.numerics.clustering
Class DistanceMap
java.lang.Object
ffx.numerics.clustering.DistanceMap
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(ClusterPair link) Adds a new ClusterPair if no equivalent pair already exists.findByCodePair
(Cluster c1, Cluster c2) Finds the ClusterPair for the two provided clusters.list()
Returns a snapshot list of all cluster pairs currently stored.minDist()
Peek at the minimal linkage distance currently in the map.boolean
remove
(ClusterPair link) Marks the given ClusterPair as removed (lazy removal) and drops it from the hash index.Removes and returns the minimal-distance pair (according to priority queue ordering).toString()
-
Field Details
-
logger
-
-
Constructor Details
-
DistanceMap
public DistanceMap()
-
-
Method Details
-
list
Returns a snapshot list of all cluster pairs currently stored.- Returns:
- list of ClusterPair entries in this map
-
findByCodePair
Finds the ClusterPair for the two provided clusters.- Parameters:
c1
- the first clusterc2
- the second cluster- Returns:
- the matching ClusterPair, or null if absent
-
removeFirst
Removes and returns the minimal-distance pair (according to priority queue ordering).- Returns:
- the next ClusterPair, or null if none
-
remove
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
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
Peek at the minimal linkage distance currently in the map.- Returns:
- the smallest linkage distance, or null if empty
-
toString
-