public class ScaledBytesFloatVectorDescriptorImpl extends Object implements ScaledFvDescriptor
Guarded.EnsureThat, Guarded.New| Constructor and Description |
|---|
ScaledBytesFloatVectorDescriptorImpl(byte[] bytes,
ScaledFvDescriptorGenerator gen,
int length)
Construct.
|
ScaledBytesFloatVectorDescriptorImpl(float[] fp,
ScaledFvDescriptorGenerator gen,
int length)
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
static double |
euclidSqrBytes(LinearScaler scaler,
byte[] target,
byte[] query)
Square of euclidean.
|
byte[] |
getBytes()
Get scaled bytes representation.
|
double |
getEuclideanNorm()
Euclidean norm of the represented vector.
|
float[] |
getFP()
Gets the float array representation of the fingerprint.
|
Object |
getGuardObject()
Gets the guard object associated to the generated descriptors/utilities.
|
double |
getManhattanNorm()
Manhattan norm of the represented vector.
|
double |
getMaximumNorm()
Maximum norm of the represented vector.
|
double |
manhattanBytes(byte[] other)
Manhattan.
|
double |
maximumBytes(byte[] other)
Maximum.
|
double |
tanimotoBytes(byte[] other)
Tanimoto.
|
byte[] |
toByteArray()
Create byte array serialized form.
|
public ScaledBytesFloatVectorDescriptorImpl(float[] fp,
ScaledFvDescriptorGenerator gen,
int length)
fp - Float valuesgen - Scaler to use for projection; also serves as the guard objectlength - Expected length of descriptorspublic ScaledBytesFloatVectorDescriptorImpl(byte[] bytes,
ScaledFvDescriptorGenerator gen,
int length)
bytes - Scaled bytes representationgen - Scaler to use for projection; also serves as the guard objectlength - Expected length of desriptorspublic float[] getFP()
FloatVectorDescriptorThe returned array might be the the internal representation array so changing the values is forbidden. Please note that this behavior is not guaranteed, the returned array can be a non cached copy of the represented vector generated on every invocation.
getFP in interface FloatVectorDescriptorpublic double getEuclideanNorm()
FloatVectorDescriptorNote that the actual implementation might or might not cache the returned value.
getEuclideanNorm in interface FloatVectorDescriptorpublic double getManhattanNorm()
FloatVectorDescriptorNote that the actual implementation might or might not cache the returned value.
getManhattanNorm in interface FloatVectorDescriptorpublic double getMaximumNorm()
FloatVectorDescriptorNote that the actual implementation might or might not cache the returned value.
getMaximumNorm in interface FloatVectorDescriptorpublic byte[] toByteArray()
ScaledFvDescriptortoByteArray in interface ScaledFvDescriptorpublic byte[] getBytes()
public static double euclidSqrBytes(LinearScaler scaler, byte[] target, byte[] query)
scaler - Underlying scalertarget - Scaled bytes representation of the target descriptorquery - Scaled bytes representation of the query descriptorpublic double manhattanBytes(byte[] other)
other - Scaled bytes representation of the other descriptor.public double maximumBytes(byte[] other)
other - Scaled bytes representation of the other descriptor.public double tanimotoBytes(byte[] other)
other - Scaled bytes representation of the other descriptor.public Object getGuardObject()
GuardedThis method is intended to use only for ensuring the compatibility of manipulated objects.
Implementations might use the associated DescriptorGenerator or DescriptorParameters reference as
the guard object, however it is a non recommended practice to use this method to access the associated generator
to perform further operations on it.
getGuardObject in interface Guardednull.