messif.objects.impl
Class ObjectFloatUnitVectorL2

java.lang.Object
  extended by messif.objects.UniqueID
      extended by messif.objects.AbstractObject
          extended by messif.objects.LocalAbstractObject
              extended by messif.objects.impl.ObjectFloatVector
                  extended by messif.objects.impl.ObjectFloatUnitVector
                      extended by messif.objects.impl.ObjectFloatUnitVectorL2
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<UniqueID>, BinarySerializable, Clearable

public class ObjectFloatUnitVectorL2
extends ObjectFloatUnitVector

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class messif.objects.LocalAbstractObject
LocalAbstractObject.DataEqualObject
 
Field Summary
 
Fields inherited from class messif.objects.impl.ObjectFloatVector
data
 
Fields inherited from class messif.objects.LocalAbstractObject
counterDistanceComputations, counterLowerBoundDistanceComputations, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, UNKNOWN_DISTANCE
 
Constructor Summary
protected ObjectFloatUnitVectorL2(BinaryInput input, BinarySerializator serializator)
          Creates a new instance of ObjectFloatUnitVector loaded from binary input buffer.
  ObjectFloatUnitVectorL2(java.io.BufferedReader stream)
          Creates a new instance of object from stream
  ObjectFloatUnitVectorL2(float[] data)
          Creates a new instance of object
  ObjectFloatUnitVectorL2(int dimension)
          Creates a new instance of randomly generated object
 
Method Summary
protected  float getDistanceImpl(LocalAbstractObject obj, float distThreshold)
          Metric function Implements euclidean distance measure (so-called L2 metric)
 float getMaxDistance()
          Returns a maximal possible distance for this class.
 
Methods inherited from class messif.objects.impl.ObjectFloatVector
binarySerialize, cloneRandomlyModify, dataEquals, dataHashCode, getBinarySize, getDimensionality, getMinMaxForEveryCoord, getMinMaxOverCoords, getMinMaxOverCoords, getSize, getVectorData, toString, translateToUnitCube, translateToUnitCube, writeData
 
Methods inherited from class messif.objects.LocalAbstractObject
clearSurplusData, clone, clone, create, create, createMetaDistancesHolder, excludeUsingPrecompDist, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceLowerBound, getDistanceLowerBoundImpl, getDistanceUpperBound, getDistanceUpperBoundImpl, getNormDistance, getRandomChar, getRandomNormal, chainDestroy, chainFilter, includeUsingPrecompDist, readObjectComments, unchainFilter, write, write
 
Methods inherited from class messif.objects.AbstractObject
clone, getLocatorURI, getNoDataObject, getObjectID, getObjectKey, setObjectKey
 
Methods inherited from class messif.objects.UniqueID
compareTo, equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectFloatUnitVectorL2

public ObjectFloatUnitVectorL2(float[] data)
Creates a new instance of object


ObjectFloatUnitVectorL2

public ObjectFloatUnitVectorL2(int dimension)
Creates a new instance of randomly generated object


ObjectFloatUnitVectorL2

public ObjectFloatUnitVectorL2(java.io.BufferedReader stream)
                        throws java.io.IOException,
                               java.lang.NumberFormatException
Creates a new instance of object from stream

Throws:
java.io.IOException
java.lang.NumberFormatException

ObjectFloatUnitVectorL2

protected ObjectFloatUnitVectorL2(BinaryInput input,
                                  BinarySerializator serializator)
                           throws java.io.IOException
Creates a new instance of ObjectFloatUnitVector loaded from binary input buffer.

Parameters:
input - the buffer to read the ObjectFloatVector from
serializator - the serializator used to write objects
Throws:
java.io.IOException - if there was an I/O error reading from the buffer
Method Detail

getDistanceImpl

protected float getDistanceImpl(LocalAbstractObject obj,
                                float distThreshold)
Metric function Implements euclidean distance measure (so-called L2 metric)

Specified by:
getDistanceImpl in class LocalAbstractObject
Parameters:
obj - the object to compute distance to
distThreshold - the threshold value on the distance
Returns:
the actual distance between obj and this if the distance is lower than distThreshold

getMaxDistance

public float getMaxDistance()
Description copied from class: LocalAbstractObject
Returns a maximal possible distance for this class. This method must return the same value for all instances of this class. Default implementation returns LocalAbstractObject.MAX_DISTANCE.

Overrides:
getMaxDistance in class LocalAbstractObject
Returns:
a maximal possible distance for this class