public abstract class ObjectFloatVectorNeuralNetwork extends LocalAbstractObject implements BinarySerializable
LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected java.lang.ref.WeakReference<float[]> |
compressedData
A bit array saying which coordinate is zero and which is not
|
protected float[] |
data
Data array (only the non-zero dimensions)
|
protected java.lang.ref.WeakReference<java.util.BitSet> |
zeroes
A bit array saying which coordinate is zero and which is not
|
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
protected |
ObjectFloatVectorNeuralNetwork(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectFloatVector loaded from binary input buffer.
|
|
ObjectFloatVectorNeuralNetwork(java.io.BufferedReader stream)
Creates a new instance of ObjectFloatVector from text stream.
|
|
ObjectFloatVectorNeuralNetwork(float[] data)
Creates a new instance of ObjectFloatVector.
|
|
ObjectFloatVectorNeuralNetwork(java.lang.String locatorURI,
float[] data)
Creates a new instance of ObjectFloatVector.
|
Modifier and Type | Method and Description |
---|---|
int |
binarySerialize(BinaryOutput output,
BinarySerializator serializator)
Binary-serialize this object into the
output . |
boolean |
dataEquals(java.lang.Object obj)
Indicates whether some other object has the same data as this one.
|
int |
dataHashCode()
Returns a hash code value for the data of this object.
|
int |
getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes.
|
protected float[] |
getCompressedData(java.util.BitSet zeroesToInit)
Create the compressed data + zeroes bit set from a full float array.
|
float[] |
getRawData() |
protected static float[] |
getRawData(int length,
java.util.BitSet zeroes,
float[] compressedData)
Create the uncompressed data given the compressed data.
|
int |
getSize()
Returns the size of this object in bytes.
|
protected void |
writeData(java.io.OutputStream stream)
Store this object's data to a text stream.
|
clearSurplusData, clone, clone, cloneRandomlyModify, create, create, createMetaDistancesHolder, excludeUsingPrecompDist, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceImpl, 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, toString
protected transient java.lang.ref.WeakReference<java.util.BitSet> zeroes
protected transient java.lang.ref.WeakReference<float[]> compressedData
protected final float[] data
public ObjectFloatVectorNeuralNetwork(float[] data)
data
- the data content of the new objectpublic ObjectFloatVectorNeuralNetwork(java.lang.String locatorURI, float[] data)
locatorURI
- the locator URI for the new objectdata
- the data content of the new objectpublic ObjectFloatVectorNeuralNetwork(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 ObjectFloatVectorNeuralNetwork(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 bufferprotected void writeData(java.io.OutputStream stream) throws java.io.IOException
LocalAbstractObject
writeData
in class LocalAbstractObject
stream
- the stream to store this object tojava.io.IOException
- if there was an error while writing to streamprotected float[] getCompressedData(java.util.BitSet zeroesToInit) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
protected static float[] getRawData(int length, java.util.BitSet zeroes, float[] compressedData)
public float[] getRawData()
public boolean dataEquals(java.lang.Object obj)
LocalAbstractObject
dataEquals
in class LocalAbstractObject
obj
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.public int getSize()
LocalAbstractObject
getSize
in class LocalAbstractObject
public int dataHashCode()
LocalAbstractObject
dataHashCode
in class LocalAbstractObject
public int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws java.io.IOException
LocalAbstractObject
output
.binarySerialize
in interface BinarySerializable
binarySerialize
in class LocalAbstractObject
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 LocalAbstractObject
serializator
- the serializator used to write objects