com.aliasi.cluster
Class LinkDendrogram<E>

java.lang.Object
  extended by com.aliasi.cluster.Dendrogram<E>
      extended by com.aliasi.cluster.LinkDendrogram<E>
Type Parameters:
E - the type of objects being clustered
All Implemented Interfaces:
Scored

public class LinkDendrogram<E>
extends Dendrogram<E>

A LinkDendrogram consists of a pair of sub-dendrograms which are joined at a specified cost. Although typically used in the case where the sub-dendrograms have lower costs than their parent dendrograms, this condition is not enforced by this implementation.

Since:
LingPipe2.0
Version:
3.9.1
Author:
Bob Carpenter

Field Summary
 
Fields inherited from interface com.aliasi.util.Scored
REVERSE_SCORE_COMPARATOR, SCORE_COMPARATOR
 
Constructor Summary
LinkDendrogram(Dendrogram<E> dendrogram1, Dendrogram<E> dendrogram2, double cost)
          Construct a link dendrogram containing the specified object.
 
Method Summary
 Dendrogram<E> dendrogram1()
          Returns the first dendrogram in the linked dendrogram.
 Dendrogram<E> dendrogram2()
          Returns the second dendrogram in the linked dendrogram.
 Set<E> memberSet()
          Returns the members of this dendrogram.
 double score()
          Returns the cost of this dendogram.
 
Methods inherited from class com.aliasi.cluster.Dendrogram
contains, copheneticCorrelation, dereference, parent, partitionDistance, partitionK, prettyPrint, size, structurallyEquivalent, toString, withinClusterScatter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinkDendrogram

public LinkDendrogram(Dendrogram<E> dendrogram1,
                      Dendrogram<E> dendrogram2,
                      double cost)
Construct a link dendrogram containing the specified object.

Parameters:
dendrogram1 - First dendrogram in cluster.
dendrogram2 - Second dendrogram in cluster.
cost - Cost of creating this dendrogram from the specified dendrograms.
Throws:
IllegalArgumentException - If the cost is less than 0.0.
Method Detail

score

public double score()
Returns the cost of this dendogram. The cost is specified at construction time and is meant to indicate the proximity between the elements.

Specified by:
score in interface Scored
Specified by:
score in class Dendrogram<E>
Returns:
The proximity between the pair of component dendrograms making up this dendrogram.

memberSet

public Set<E> memberSet()
Description copied from class: Dendrogram
Returns the members of this dendrogram.

Specified by:
memberSet in class Dendrogram<E>
Returns:
The members of this dendrogram.

dendrogram1

public Dendrogram<E> dendrogram1()
Returns the first dendrogram in the linked dendrogram. This is the first dendrogram in constructor argument order, but the order is irrelevant in the semantics of dendrograms as they represent unordered trees.

Returns:
The first dendrogram linked.

dendrogram2

public Dendrogram<E> dendrogram2()
Returns the second dendrogram in the linked dendrogram. This is the second dendrogram in constructor argument order, but the order is irrelevant in the semantics of dendrograms as they represent unordered trees.

Returns:
The second dendrogram linked.