Partager via


DistanceFunction Class

public final class DistanceFunction
extends ExpandableStringEnum<DistanceFunction>

The distance function to use for distance calculation in between vectors.

Field Summary

Modifier and Type Field and Description
static final DistanceFunction COSINE

Static value cosine for DistanceFunction.

static final DistanceFunction DOTPRODUCT

Static value dotproduct for DistanceFunction.

static final DistanceFunction EUCLIDEAN

Static value euclidean for DistanceFunction.

Constructor Summary

Constructor Description
DistanceFunction()

Deprecated

Use the fromString(String name) factory method.

Creates a new instance of DistanceFunction value.

Method Summary

Modifier and Type Method and Description
static DistanceFunction fromString(String name)

Creates or finds a DistanceFunction from its string representation.

static Collection<DistanceFunction> values()

Gets known DistanceFunction values.

Methods inherited from ExpandableStringEnum

Methods inherited from java.lang.Object

Field Details

COSINE

public static final DistanceFunction COSINE

Static value cosine for DistanceFunction.

DOTPRODUCT

public static final DistanceFunction DOTPRODUCT

Static value dotproduct for DistanceFunction.

EUCLIDEAN

public static final DistanceFunction EUCLIDEAN

Static value euclidean for DistanceFunction.

Constructor Details

DistanceFunction

@Deprecated
public DistanceFunction()

Deprecated

Use the fromString(String name) factory method.

Creates a new instance of DistanceFunction value.

Method Details

fromString

public static DistanceFunction fromString(String name)

Creates or finds a DistanceFunction from its string representation.

Parameters:

name - a name to look for.

Returns:

the corresponding DistanceFunction.

values

public static Collection values()

Gets known DistanceFunction values.

Returns:

known DistanceFunction values.

Applies to