at.tuwien.ifs.somtoolbox.data.distance
Class FullMemoryInputVectorDistanceMatrix
java.lang.Object
at.tuwien.ifs.somtoolbox.data.distance.InputVectorDistanceMatrix
at.tuwien.ifs.somtoolbox.data.distance.AbstractMemoryInputVectorDistanceMatrix
at.tuwien.ifs.somtoolbox.data.distance.FullMemoryInputVectorDistanceMatrix
public class FullMemoryInputVectorDistanceMatrix
- extends AbstractMemoryInputVectorDistanceMatrix
This class implements an AbstractMemoryInputVectorDistanceMatrix
using a two-dimensional double array (i.e.
double[][]).
This implies a higher memory consumption as compared to LeightWeightMemoryInputVectorDistanceMatrix
, but also
faster access times for getDistance(int, int)
and getDistances(int)
, while
InputVectorDistanceMatrix.getDistancesFlat()
needs to be generated on the fly.
- Version:
- $Id: FullMemoryInputVectorDistanceMatrix.java 3704 2010-07-20 10:42:42Z mayer $
- Author:
- Rudolf Mayer
Methods inherited from class at.tuwien.ifs.somtoolbox.data.distance.InputVectorDistanceMatrix |
columns, equals, flatArraySize, getDistancesFlat, getDistancesFlatAsMatrix, getInputLabels, getMetric, getNNearest, initFromFile, numVectors, rows, toString |
distanceMatrix
protected double[][] distanceMatrix
FullMemoryInputVectorDistanceMatrix
public FullMemoryInputVectorDistanceMatrix(InputData data,
DistanceMetric metric)
throws MetricException
- Throws:
MetricException
FullMemoryInputVectorDistanceMatrix
public FullMemoryInputVectorDistanceMatrix(String fileName)
throws IOException,
SOMToolboxException
- Throws:
IOException
SOMToolboxException
setValue
protected void setValue(int x,
int y,
double value)
- Specified by:
setValue
in class AbstractMemoryInputVectorDistanceMatrix
initStorage
protected void initStorage()
- Specified by:
initStorage
in class AbstractMemoryInputVectorDistanceMatrix
getDistance
public double getDistance(int x,
int y)
- Description copied from class:
InputVectorDistanceMatrix
- Return the distance between input vectors x and y.
- Specified by:
getDistance
in class InputVectorDistanceMatrix
getDistances
public double[] getDistances(int x)
- Description copied from class:
InputVectorDistanceMatrix
- Return the distances to all vectors from input x. This is a basic using
InputVectorDistanceMatrix.getDistance(int, int)
,
sub-classes might provide an optimised implementation.
- Overrides:
getDistances
in class InputVectorDistanceMatrix
getNamedDistances
public ArrayList<InputNameDistance> getNamedDistances(int x)