public class ScaledShortsFloatVectorDescriptor extends Object implements ScaledFvDescriptor, Serializable
Guarded.EnsureThat, Guarded.New
Constructor and Description |
---|
ScaledShortsFloatVectorDescriptor(byte[] fp,
ScaledFvDescriptorGenerator gen,
int length)
Construct.
|
ScaledShortsFloatVectorDescriptor(float[] fp,
ScaledFvDescriptorGenerator gen,
int length)
Construct.
|
Modifier and Type | Method and Description |
---|---|
double |
euclidSqrShorts(short[] other)
Square of euclidean.
|
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.
|
short[] |
getShorts()
Get scaled shorts representation.
|
double |
manhattanShorts(short[] other)
Manhattan.
|
double |
maximumShorts(short[] other)
Maximum.
|
static double |
tanimotoShorts(LinearScaler scaler,
short[] target,
short[] query)
Tanimoto.
|
byte[] |
toByteArray()
Create byte array serialized form.
|
public ScaledShortsFloatVectorDescriptor(float[] fp, ScaledFvDescriptorGenerator gen, int length)
fp
- Float valuesgen
- Scaler to use for projection; also serves as the guard objectlength
- Expected length of descriptorspublic ScaledShortsFloatVectorDescriptor(byte[] fp, ScaledFvDescriptorGenerator gen, int length)
fp
- Bytes serialized representationgen
- Scaler to use for projection; also serves as the guard objectlength
- Expected length of descriptorspublic float[] getFP()
FloatVectorDescriptor
The 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 FloatVectorDescriptor
public double getEuclideanNorm()
FloatVectorDescriptor
Note that the actual implementation might or might not cache the returned value.
getEuclideanNorm
in interface FloatVectorDescriptor
public double getManhattanNorm()
FloatVectorDescriptor
Note that the actual implementation might or might not cache the returned value.
getManhattanNorm
in interface FloatVectorDescriptor
public double getMaximumNorm()
FloatVectorDescriptor
Note that the actual implementation might or might not cache the returned value.
getMaximumNorm
in interface FloatVectorDescriptor
public byte[] toByteArray()
ScaledFvDescriptor
toByteArray
in interface ScaledFvDescriptor
public short[] getShorts()
public double euclidSqrShorts(short[] other)
other
- Scaled shorts representation of the other descriptor.public double manhattanShorts(short[] other)
other
- Scaled shorts representation of the other descriptor.public double maximumShorts(short[] other)
other
- Scaled shorts representation of the other descriptor.public static double tanimotoShorts(LinearScaler scaler, short[] target, short[] query)
scaler
- Underlying scalertarget
- Scaled shorts representation of the target descriptor.query
- Scaled shorts representation of the query descriptor.public Object getGuardObject()
Guarded
This 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 Guarded
null
.