public static class ObjectIntMultiVector.MultiWeightIgnoreProvider extends ObjectIntMultiVector.MultiWeightProvider
ObjectIntMultiVector.WeightProvider
that has a single weight for every data array of the ObjectIntMultiVector
and it ignores a specified list of integers (created from a given list of keywords) - the ignore weight is specified in the
last weight in the weight array.weights
Constructor and Description |
---|
ObjectIntMultiVector.MultiWeightIgnoreProvider(float[] weights,
float ignoreWeight,
java.util.Set<java.lang.Integer> ignoredItems)
Creates a new instance of MultiWeightProvider with the the given array of weights.
|
Modifier and Type | Method and Description |
---|---|
float |
getWeight(ObjectIntMultiVector.SortedDataIterator iterator)
Returns the weight for the item that the
iterator points to. |
double |
getWeightNorm(ObjectIntMultiVector obj)
Returns the square root of the sum of all weight squares for the given object.
|
float |
getWeightSum(ObjectIntMultiVector obj)
Returns the sum of all weights for the given object.
|
getWeight, getWeights
public ObjectIntMultiVector.MultiWeightIgnoreProvider(float[] weights, float ignoreWeight, java.util.Set<java.lang.Integer> ignoredItems)
weights
- the weights for the data arraysignoreWeight
- weight used for the ignoredKeywords
ignoredItems
- set of IDs to be ignoredpublic float getWeight(ObjectIntMultiVector.SortedDataIterator iterator)
ObjectIntMultiVector.WeightProvider
iterator
points to.getWeight
in interface ObjectIntMultiVector.WeightProvider
getWeight
in class ObjectIntMultiVector.MultiWeightProvider
iterator
- this iterator's current object weight is to be retrievedpublic float getWeightSum(ObjectIntMultiVector obj)
ObjectIntMultiVector.WeightProvider
ObjectIntMultiVector.WeightProvider.getWeight(messif.objects.impl.ObjectIntMultiVector.SortedDataIterator)
,
i.e. the returned sum is the sum of the weight retrieved by iterating over
all items from the obj.getSortedIterator()
.getWeightSum
in interface ObjectIntMultiVector.WeightProvider
getWeightSum
in class ObjectIntMultiVector.MultiWeightProvider
obj
- the object for which the weights are givenpublic double getWeightNorm(ObjectIntMultiVector obj)
ObjectIntMultiVector.WeightProvider
ObjectIntMultiVector.WeightProvider.getWeight(messif.objects.impl.ObjectIntMultiVector.SortedDataIterator)
,
i.e. the returned number is the square root of the sum of all weight squares retrieved by iterating over
all items from the obj.getSortedIterator()
.getWeightNorm
in interface ObjectIntMultiVector.WeightProvider
getWeightNorm
in class ObjectIntMultiVector.MultiWeightProvider
obj
- the object for which the weights are given