Class CFDistanceMatrix


  • public class CFDistanceMatrix
    extends java.lang.Object
    Cluster feature distance matrix, used for clustering.
    Since:
    0.8.0
    Author:
    Andreas Lang
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) ClusterFeature[] cfs
      Cluster features
      (package private) double[] matrix
      Distance matrix (serialized)
      (package private) int size
      Number of entries
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double get​(int x, int y)
      Get a value from the (upper triangular) distance matrix.
      static int triangleSize​(int x)
      Compute the size of a complete x by x triangle (minus diagonal)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • size

        int size
        Number of entries
      • matrix

        double[] matrix
        Distance matrix (serialized)
    • Constructor Detail

      • CFDistanceMatrix

        public CFDistanceMatrix​(ClusterFeature[] cfs)
        Constructor.
        Parameters:
        cfs - Cluster features
    • Method Detail

      • triangleSize

        public static int triangleSize​(int x)
        Compute the size of a complete x by x triangle (minus diagonal)
        Parameters:
        x - Offset
        Returns:
        Size of complete triangle
      • get

        public double get​(int x,
                          int y)
        Get a value from the (upper triangular) distance matrix.

        Note: in many cases, linear iteration over the matrix will be faster than repeated calls to this method!

        Parameters:
        x - First object
        y - Second object
        Returns:
        Distance