public static class ObjectIntMultiVector.ArrayMultiWeightProvider extends java.lang.Object implements ObjectIntMultiVector.WeightProvider, java.io.Serializable
ObjectIntMultiVector.WeightProvider
that has a given weight for every
item of every data array of ObjectIntMultiVector
.
Note that the number of weights must be equal to the
number of data items in the respective data array of the
ObjectIntMultiVector
.Constructor and Description |
---|
ObjectIntMultiVector.ArrayMultiWeightProvider(float[][] weights)
Creates a new instance of ArrayWeightProvider with the two given 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.
|
public ObjectIntMultiVector.ArrayMultiWeightProvider(float[][] weights)
weights
- the weights for the items in the data arrayspublic float getWeight(ObjectIntMultiVector.SortedDataIterator iterator)
ObjectIntMultiVector.WeightProvider
iterator
points to.getWeight
in interface ObjectIntMultiVector.WeightProvider
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
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
obj
- the object for which the weights are given