언어

SqlServerDbFunctionsExtensions.VectorDistance<T> 메서드

정의

지정된 거리 메트릭을 사용하여 두 벡터 사이의 거리를 계산합니다.

public static double VectorDistance<T>(this Microsoft.EntityFrameworkCore.DbFunctions _, string distanceMetric, Microsoft.Data.SqlTypes.SqlVector<T> vector1, Microsoft.Data.SqlTypes.SqlVector<T> vector2) where T : struct;
static member VectorDistance : Microsoft.EntityFrameworkCore.DbFunctions * string * Microsoft.Data.SqlTypes.SqlVector<'T (requires 'T : struct)> * Microsoft.Data.SqlTypes.SqlVector<'T (requires 'T : struct)> -> double (requires 'T : struct)
<Extension()>
Public Function VectorDistance(Of T As Structure) (_ As DbFunctions, distanceMetric As String, vector1 As SqlVector(Of T), vector2 As SqlVector(Of T)) As Double

형식 매개 변수

T

매개 변수

_
DbFunctions

DbFunctions 인스턴스입니다.

distanceMetric
String

지정된 두 벡터 간의 거리를 계산하는 데 사용할 거리 메트릭의 이름을 가진 문자열입니다. 지원 cosineeuclideandot되는 거리 메트릭은 다음과 같습니다.

vector1
SqlVector<T>

첫 번째 벡터입니다.

vector2
SqlVector<T>

두 번째 벡터입니다.

반품

설명

벡터 거리는 항상 정확하며 사용 가능한 경우에도 벡터 인덱스는 사용하지 않습니다.

적용 대상