ILNumerics - Technical Application Development
Assembly: ILNumerics.Computing (in ILNumerics.Computing.dll) Version: 5.5.0.0 (5.5.7503.3146)
Distance matrix D of size [m x n]. Di,j is the squared euclidian distance between data point i in A and data point j in B.
Computes the [m x n] squared pairwise L2 distances between data points provided in A [d x m] and B [d x n].
[ILNumerics Computing Engine]
Namespace: ILNumerics
Assembly: ILNumerics.Computing (in ILNumerics.Computing.dll) Version: 5.5.0.0 (5.5.7503.3146)
Syntax
Parameters
- A
- Type: ILNumericsInArrayDouble
Input data matrix A [d x m], m points are provided as columns of length d. - B
- Type: ILNumericsInArrayDouble
Input data matrix B [d x n], n points are provided as columns of length d.
Return Value
Type: RetArrayDoubleDistance matrix D of size [m x n]. Di,j is the squared euclidian distance between data point i in A and data point j in B.
Remarks
This function computes the square of the pairwise euclidian (L2) distances between data values in A and B.
In order to get the non-squared distances one may use the sqrt(BaseArrayDouble) function on the array returned.
For those coming from languages like Matlab / Octave: the equivalent function there would be: bsxfun(@plus, dot(X, X, 1)',dot(Y,Y,1))-2*(X' * Y)
[ILNumerics Computing Engine]
See Also