at.tuwien.ifs.somtoolbox.data.distance
Class AbstractMemoryInputVectorDistanceMatrix
java.lang.Object
at.tuwien.ifs.somtoolbox.data.distance.InputVectorDistanceMatrix
at.tuwien.ifs.somtoolbox.data.distance.AbstractMemoryInputVectorDistanceMatrix
- Direct Known Subclasses:
- FullMemoryInputVectorDistanceMatrix, LeightWeightMemoryInputVectorDistanceMatrix
public abstract class AbstractMemoryInputVectorDistanceMatrix
- extends InputVectorDistanceMatrix
This implementation stores the distances in memory. It is constructed either by calculating distances from the given
input data on the fly, or by reading them from an ASCII file. If memory is an issue (consider using
RandomAccessFileInputVectorDistanceMatrix
instead).
- Version:
- $Id: AbstractMemoryInputVectorDistanceMatrix.java 3706 2010-07-20 11:07:54Z mayer $
- Author:
- Rudolf Mayer
Method Summary |
protected abstract void |
initStorage()
|
protected abstract void |
setValue(int x,
int y,
double value)
|
Methods inherited from class at.tuwien.ifs.somtoolbox.data.distance.InputVectorDistanceMatrix |
columns, equals, flatArraySize, getDistance, getDistances, getDistancesFlat, getDistancesFlatAsMatrix, getInputLabels, getMetric, getNNearest, initFromFile, numVectors, rows, toString |
FILE_TYPE
public static final String FILE_TYPE
- See Also:
- Constant Field Values
AbstractMemoryInputVectorDistanceMatrix
public AbstractMemoryInputVectorDistanceMatrix(InputData data,
DistanceMetric metric)
throws MetricException
- Constructs the distance matrix by computing the distances on the fly. Not suited for large data sets, where the
computation time might take long (consider reading it from a file using
AbstractMemoryInputVectorDistanceMatrix(String)
)
- Throws:
MetricException
AbstractMemoryInputVectorDistanceMatrix
public AbstractMemoryInputVectorDistanceMatrix(String fileName)
throws IOException,
SOMToolboxException
- Reads the distance matrix from an ASCII file, and stores it in memory.
- Throws:
IOException
SOMToolboxException
initStorage
protected abstract void initStorage()
setValue
protected abstract void setValue(int x,
int y,
double value)