public class ObjectUnsignedByteVectorL2 extends ObjectUnsignedByteVector
ObjectUnsignedByteVector
with an L2 (Euclidean) metric distance.LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
data
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
protected |
ObjectUnsignedByteVectorL2(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectUnsignedByteVectorL2 loaded from binary input buffer.
|
|
ObjectUnsignedByteVectorL2(java.io.BufferedReader stream)
Creates a new instance of ObjectUnsignedByteVectorL2 from text stream.
|
|
ObjectUnsignedByteVectorL2(int dimension)
Creates a new instance of ObjectUnsignedByteVectorL2 with randomly generated content data.
|
|
ObjectUnsignedByteVectorL2(int dimension,
short min,
short max)
Creates a new instance of ObjectUnsignedByteVectorL2 with randomly generated content data.
|
|
ObjectUnsignedByteVectorL2(short[] data)
Creates a new instance of ObjectUnsignedByteVectorL2.
|
Modifier and Type | Method and Description |
---|---|
protected float |
getDistanceImpl(LocalAbstractObject obj,
float distThreshold)
The actual implementation of the metric function (see
LocalAbstractObject.getDistance(messif.objects.LocalAbstractObject) for full explanation). |
binarySerialize, dataEquals, dataHashCode, getBinarySize, getDimensionality, getSize, getVectorData, toString, writeData
clearSurplusData, clone, clone, cloneRandomlyModify, create, create, createMetaDistancesHolder, excludeUsingPrecompDist, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceLowerBound, getDistanceLowerBoundImpl, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceUpperBound, getDistanceUpperBoundImpl, getFieldsForNames, getMaxDistance, getNormDistance, getPrecomputedDistance, getPrecomputedDistance, getRandomChar, getRandomNormal, chainDestroy, chainFilter, includeUsingPrecompDist, isDistanceCompatible, parseObjectComment, peekNextChar, readAttributesFromStream, readObjectComments, readObjectCommentsWithoutData, unchainFilter, write, write, writeAttributesToStream, writeObjectComment
clone, getLocatorURI, getNoDataObject, getObjectKey, getObjectKey, getObjectLocatorURI, setObjectKey
public ObjectUnsignedByteVectorL2(short[] data)
data
- the data content of the new objectpublic ObjectUnsignedByteVectorL2(int dimension)
dimension
- number of dimensions to generatepublic ObjectUnsignedByteVectorL2(int dimension, short min, short max)
dimension
- number of dimensions to generatemin
- lower bound of the random generated values (inclusive)max
- upper bound of the random generated values (exclusive)public ObjectUnsignedByteVectorL2(java.io.BufferedReader stream) throws java.io.EOFException, java.io.IOException, java.lang.NumberFormatException
stream
- the stream from which to read lines of textjava.io.EOFException
- if the end-of-file of the given stream is reachedjava.io.IOException
- if there was an I/O error during reading from the streamjava.lang.NumberFormatException
- if a line read from the stream does not consist of comma-separated or space-separated numbersprotected ObjectUnsignedByteVectorL2(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the buffer to read the ObjectUnsignedByteVectorL2 fromserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error reading from the bufferprotected float getDistanceImpl(LocalAbstractObject obj, float distThreshold)
LocalAbstractObject
LocalAbstractObject.getDistance(messif.objects.LocalAbstractObject)
for full explanation).
The implementation should not increment distanceComputations statistics.getDistanceImpl
in class LocalAbstractObject
obj
- the object to compute distance todistThreshold
- the threshold value on the distance