public enum DistanceFunctionMultiObjectAggregation extends java.lang.Enum<DistanceFunctionMultiObjectAggregation> implements DistanceFunctionMultiObject<LocalAbstractObject>
multi-object distance function
.
It computes a regular LocalAbstractObject
's distance to the given object
and aggregates the resulting distances into a single distance.Enum Constant and Description |
---|
AVG
Computes the overall distance as the average distance from all the query objects
|
MAX
Computes the overall distance as the maximal distance from all the query objects
|
MIN
Computes the overall distance as the minimal distance from all the query objects
|
SUM
Computes the overall distance as the sum of the distances to all the query objects
|
Modifier and Type | Method and Description |
---|---|
protected float |
evaluate(float[] distances)
Computes the overall distance on the given array of individual distances to the query objects.
|
float |
getDistanceMultiObject(java.util.Collection<? extends LocalAbstractObject> objects,
LocalAbstractObject object,
float[] individualDistances)
Measures the distance between all the objects in set (the first argument) and
the specified object (the second argument).
|
java.lang.Class<? extends LocalAbstractObject> |
getDistanceObjectClass()
Returns the type of objects that this distance function accepts as arguments.
|
static DistanceFunctionMultiObjectAggregation |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static DistanceFunctionMultiObjectAggregation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DistanceFunctionMultiObjectAggregation SUM
public static final DistanceFunctionMultiObjectAggregation MAX
public static final DistanceFunctionMultiObjectAggregation AVG
public static final DistanceFunctionMultiObjectAggregation MIN
public static DistanceFunctionMultiObjectAggregation[] values()
for (DistanceFunctionMultiObjectAggregation c : DistanceFunctionMultiObjectAggregation.values()) System.out.println(c);
public static DistanceFunctionMultiObjectAggregation valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullprotected float evaluate(float[] distances)
distances
- the individual distances to the query objectspublic float getDistanceMultiObject(java.util.Collection<? extends LocalAbstractObject> objects, LocalAbstractObject object, float[] individualDistances) throws java.lang.IndexOutOfBoundsException
DistanceFunctionMultiObject
individualDistances
will be filled with the
distances to the individual objects in the set.getDistanceMultiObject
in interface DistanceFunctionMultiObject<LocalAbstractObject>
objects
- the set of objects for which to measure the distance to the second parameterobject
- the object for which to measure the distanceindividualDistances
- the array to fill with the distances to the respective objects from the set;
if not null, it must have the same number of allocated elements as the number of the set of objectsobjects
and the object
java.lang.IndexOutOfBoundsException
- if the passed individualDistances
array is not big enoughpublic java.lang.Class<? extends LocalAbstractObject> getDistanceObjectClass()
DistanceFunctionMultiObject
getDistanceObjectClass
in interface DistanceFunctionMultiObject<LocalAbstractObject>