public abstract class DimensionSimilarityMatrix extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DimensionSimilarityMatrix.FullDimensionSimilarityMatrix
Complete matrix of pairwise dimension similarities.
|
static class |
DimensionSimilarityMatrix.PartialDimensionSimilarityMatrix
Partial matrix of pairwise dimension similarities.
|
static class |
DimensionSimilarityMatrix.PrimAdapter
Adapter class for running prim's algorithm.
|
Modifier and Type | Field and Description |
---|---|
static DimensionSimilarityMatrix.PrimAdapter |
PRIM_ADAPTER
Adapter class for running Prim's minimum spanning tree algorithm.
|
private double[] |
sim
Flat, symmetric storage.
|
Modifier | Constructor and Description |
---|---|
protected |
DimensionSimilarityMatrix(int dims)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract int |
dim(int idx)
Get the dimension at position idx.
|
double |
get(int x,
int y)
Get the value of the given matrix position.
|
private int |
index(int x,
int y)
Indexing function for triangular matrix.
|
static DimensionSimilarityMatrix |
make(int dims)
Make a full dimension similarity matrix.
|
static DimensionSimilarityMatrix |
make(int[] dims)
Make a partial dimension similarity matrix.
|
void |
set(int x,
int y,
double val)
Set the value of the given matrix position.
|
abstract int |
size()
Number of dimensions.
|
String |
toString() |
public static final DimensionSimilarityMatrix.PrimAdapter PRIM_ADAPTER
private final double[] sim
X S S S S S 0 X S S S S 1 2 X S S S 3 4 5 X S S 6 7 8 9 X S 10 11 12 13 14 X
protected DimensionSimilarityMatrix(int dims)
dims
- Number of dimensions to allocate.public abstract int size()
public abstract int dim(int idx)
idx
- Positionpublic void set(int x, int y, double val)
x == y
is invalid!x
- X index coordinatey
- Y index coordinateval
- Valuepublic double get(int x, int y)
x == y
is invalid!x
- X index coordinatey
- Y index coordinateprivate int index(int x, int y)
x
- X coordinatey
- Y coordinatepublic static DimensionSimilarityMatrix make(int dims)
dims
- Number of dimensions.public static DimensionSimilarityMatrix make(int[] dims)
dims
- Array of relevant dimensions