Package elki.index.tree.betula
Class CFDistanceMatrix
- java.lang.Object
-
- elki.index.tree.betula.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
-
Constructor Summary
Constructors Constructor Description CFDistanceMatrix(ClusterFeature[] cfs)
Constructor.
-
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)
-
-
-
Field Detail
-
size
int size
Number of entries
-
cfs
ClusterFeature[] cfs
Cluster features
-
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 objecty
- Second object- Returns:
- Distance
-
-