ILNumerics - Technical Application Development

pairwise L1 distances between the data point provided in the input vector B and the data points stored in the matrix A.

..

Pairwise L1 distance. Aka: Manhattan distance.

[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: ILNumericsInArrayInt64

Input points (matrix). - B
- Type: ILNumericsInArrayInt64

Input point (vector).

#### Return Value

Type: RetArrayInt64pairwise L1 distances between the data point provided in the input vector B and the data points stored in the matrix A.

Remarks

If B is a colum vector, the distances between B and the columns of A are calculated. The number of rows of A must match the length of vector B than. Therefore, the length of the returned vector of distances matches the number of columns of A:

`A.S[1]`

If B is a row vector, the distances between B and the rows of A are calculated. The number of columns of A must match the length of vector B than. Therefore, the length of the returned vector of distances matches the number of rows of A:

`A.S[0]`

This function is commutative, the single data point may be provided in A and the data point matrix may be provided in B as well.

[ILNumerics Computing Engine]

See Also