public class FullMemoryInputVectorDistanceMatrix extends AbstractMemoryInputVectorDistanceMatrix
AbstractMemoryInputVectorDistanceMatrix
using a two-dimensional double array (i.e.
double[][]).LeightWeightMemoryInputVectorDistanceMatrix
, but also
faster access times for getDistance(int, int)
and getDistances(int)
, while
InputVectorDistanceMatrix.getDistancesFlat()
needs to be generated on the fly.Modifier and Type | Field and Description |
---|---|
protected double[][] |
distanceMatrix |
FILE_TYPE
inputLabels, metric, numVectors
Constructor and Description |
---|
FullMemoryInputVectorDistanceMatrix(InputData data,
DistanceMetric metric) |
FullMemoryInputVectorDistanceMatrix(java.lang.String fileName) |
Modifier and Type | Method and Description |
---|---|
double |
getDistance(int x,
int y)
Return the distance between input vectors x and y.
|
double[] |
getDistances(int x)
Return the distances to all vectors from input x.
|
java.util.ArrayList<InputNameDistance> |
getNamedDistances(int x) |
protected void |
initStorage() |
protected void |
setValue(int x,
int y,
double value) |
columns, equals, flatArraySize, getDistancesFlat, getDistancesFlatAsMatrix, getInputLabels, getMetric, getNNearest, initFromFile, numVectors, rows, toString
public FullMemoryInputVectorDistanceMatrix(InputData data, DistanceMetric metric) throws MetricException
MetricException
public FullMemoryInputVectorDistanceMatrix(java.lang.String fileName) throws java.io.IOException, SOMToolboxException
java.io.IOException
SOMToolboxException
protected void setValue(int x, int y, double value)
setValue
in class AbstractMemoryInputVectorDistanceMatrix
protected void initStorage()
initStorage
in class AbstractMemoryInputVectorDistanceMatrix
public double getDistance(int x, int y)
InputVectorDistanceMatrix
getDistance
in class InputVectorDistanceMatrix
public double[] getDistances(int x)
InputVectorDistanceMatrix
InputVectorDistanceMatrix.getDistance(int, int)
,
sub-classes might provide an optimised implementation.getDistances
in class InputVectorDistanceMatrix
public java.util.ArrayList<InputNameDistance> getNamedDistances(int x)