public class ObjectFloatVectorTunable extends ObjectFloatVectorL2
ObjectFloatVector
with an L2 (Euclidean) metric distance.
This object has a tunable time of DC (active loop checking time) and serialization size (fake data is generated).LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
static long |
DC_TIME_MIN_NANOS |
static int |
SERIALIZATION_SIZE_MIN_BYTES |
data
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
protected |
ObjectFloatVectorTunable(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectFloatVectorL2 loaded from binary input buffer.
|
|
ObjectFloatVectorTunable(java.io.BufferedReader stream)
Creates a new instance of ObjectFloatVectorL2 from text stream.
|
|
ObjectFloatVectorTunable(float[] data)
Creates a new instance of ObjectFloatVectorL2.
|
|
ObjectFloatVectorTunable(int dimension,
float min,
float max)
Creates a new instance of ObjectFloatVectorL2 with randomly generated content data.
|
Modifier and Type | Method and Description |
---|---|
int |
binarySerialize(BinaryOutput output,
BinarySerializator serializator)
Binary-serialize this object into the
output . |
int |
getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes.
|
protected float |
getDistanceImpl(LocalAbstractObject obj,
float distThreshold)
The actual implementation of the metric function (see
LocalAbstractObject.getDistance(messif.objects.LocalAbstractObject) for full explanation). |
int |
getSize()
Returns the size of this object in bytes.
|
static void |
setDC_TIME_MIN_NANOS(long DC_TIME_MIN_NANOS) |
static void |
setSERIALIZATION_SIZE_MIN_BYTES(int SERIALIZATION_SIZE_MIN_BYTES) |
cloneRandomlyModify, convertFloatVector, dataEquals, dataHashCode, getDimensionality, getMinMaxForEveryCoord, getMinMaxOverCoords, getMinMaxOverCoords, getVectorData, getVectorDataDimension, getVectorDataItem, getVectorDataItemFloat, parseFloatVector, randomData, toString, translateToUnitCube, translateToUnitCube, writeData, writeFloatVector
clearSurplusData, clone, clone, 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 static long DC_TIME_MIN_NANOS
public static int SERIALIZATION_SIZE_MIN_BYTES
public ObjectFloatVectorTunable(float[] data)
data
- the data content of the new objectpublic ObjectFloatVectorTunable(int dimension, float min, float 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 ObjectFloatVectorTunable(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 ObjectFloatVectorTunable(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the buffer to read the ObjectFloatVector fromserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error reading from the bufferpublic static void setDC_TIME_MIN_NANOS(long DC_TIME_MIN_NANOS)
public static void setSERIALIZATION_SIZE_MIN_BYTES(int SERIALIZATION_SIZE_MIN_BYTES)
protected 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 ObjectFloatVectorL2
obj
- the object to compute distance todistThreshold
- the threshold value on the distancepublic int getSize()
LocalAbstractObject
getSize
in class ObjectFloatVector
public int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws java.io.IOException
LocalAbstractObject
output
.binarySerialize
in interface BinarySerializable
binarySerialize
in class ObjectFloatVector
output
- the output that this object is binary-serialized intoserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error during serializationpublic int getBinarySize(BinarySerializator serializator)
LocalAbstractObject
getBinarySize
in interface BinarySerializable
getBinarySize
in class ObjectFloatVector
serializator
- the serializator used to write objects