public class FloatsComparisonContextFactory extends Object implements FloatVectorComparisonContextFactory
Serializable
instead of float []
. This
allows the efficient implementation of descriptor parameter dependent unguarded form, like scaled/compressed
byte
s, short
s, etc.Guarded.EnsureThat, Guarded.New
FloatVectorMetricFactory.ToLinenote<C>
Constructor and Description |
---|
FloatsComparisonContextFactory(int length,
DescriptorSerializer<FloatVectorDescriptor> serializer)
Instantiate.
|
FloatsComparisonContextFactory(int length,
DescriptorSerializer<FloatVectorDescriptor> serializer,
FloatVectorMetrics defaultMetric)
Instantiate.
|
public FloatsComparisonContextFactory(int length, DescriptorSerializer<FloatVectorDescriptor> serializer, FloatVectorMetrics defaultMetric)
length
- Dimensionalityserializer
- Associated serializerdefaultMetric
- Default metricpublic FloatsComparisonContextFactory(int length, DescriptorSerializer<FloatVectorDescriptor> serializer)
FloatVectorMetrics.EUCLIDEAN
.length
- Dimensionalityserializer
- Associated serializerpublic Class<? extends MetricFactory> metricFactoryClass()
ComparisonContextFactory
Description
annotation.metricFactoryClass
in interface ComparisonContextFactory<DescriptorComparator<FloatVectorDescriptor>,FloatVectorDescriptor,Serializable>
public ComparisonContext<DescriptorComparator<FloatVectorDescriptor>,FloatVectorDescriptor,Serializable> defaultComparison()
MetricFactory
defaultComparison
in interface MetricFactory<ComparisonContext<DescriptorComparator<FloatVectorDescriptor>,FloatVectorDescriptor,Serializable>>
public ComparisonContext<DescriptorComparator<FloatVectorDescriptor>,FloatVectorDescriptor,Serializable> forFloatMetrics(FloatVectorMetrics metric)
FloatVectorMetricFactory
forFloatMetrics
in interface FloatVectorMetricFactory<ComparisonContext<DescriptorComparator<FloatVectorDescriptor>,FloatVectorDescriptor,Serializable>>
metric
- binary metricpublic ComparisonContext<DescriptorComparator<FloatVectorDescriptor>,FloatVectorDescriptor,Serializable> forTverskyCoefficients(double coeffQuery, double coeffTarget)
FloatVectorMetricFactory
forTverskyCoefficients
in interface FloatVectorMetricFactory<ComparisonContext<DescriptorComparator<FloatVectorDescriptor>,FloatVectorDescriptor,Serializable>>
coeffQuery
- Query side coefficientcoeffTarget
- Target side coefficientpublic ComparisonContext<DescriptorComparator<FloatVectorDescriptor>,FloatVectorDescriptor,Serializable> forTversky(TverskyParameters parameters)
FloatVectorMetricFactory
forTversky
in interface FloatVectorMetricFactory<ComparisonContext<DescriptorComparator<FloatVectorDescriptor>,FloatVectorDescriptor,Serializable>>
parameters
- parameters for the comparatorpublic 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
.public DescriptorSerializer<FloatVectorDescriptor> descriptorSerializer()
ComparisonContextFactory
descriptorSerializer
in interface ComparisonContextFactory<DescriptorComparator<FloatVectorDescriptor>,FloatVectorDescriptor,Serializable>
public Linenote<ComparisonContext<DescriptorComparator<FloatVectorDescriptor>,FloatVectorDescriptor,Serializable>> comparisonLinenote()
MetricFactory
comparisonLinenote
in interface MetricFactory<ComparisonContext<DescriptorComparator<FloatVectorDescriptor>,FloatVectorDescriptor,Serializable>>