@@ -122,6 +122,17 @@ function deprecated_dims(dims::Union{Nothing,Integer})
122122 end
123123end
124124
125+ """
126+ pairwise!(r::AbstractMatrix, metric::PreMetric,
127+ a::AbstractMatrix, b::AbstractMatrix=a; dims)
128+
129+ Compute distances between each pair of rows (if `dims=1`) or columns (if `dims=2`)
130+ in `a` and `b` according to distance `metric`, and store the result in `r`.
131+ If a single matrix `a` is provided, compute distances between its rows or columns.
132+
133+ `a` and `b` must have the same numbers of columns if `dims=1`, or of rows if `dims=2`.
134+ `r` must be a square matrix with size `size(a, dims) == size(b, dims)`.
135+ """
125136function pairwise! (r:: AbstractMatrix , metric:: PreMetric ,
126137 a:: AbstractMatrix , b:: AbstractMatrix ;
127138 dims:: Union{Nothing,Integer} = nothing )
@@ -165,6 +176,15 @@ function pairwise!(r::AbstractMatrix, metric::PreMetric, a::AbstractMatrix;
165176 end
166177end
167178
179+ """
180+ pairwise(metric::PreMetric, a::AbstractMatrix, b::AbstractMatrix=a; dims)
181+
182+ Compute distances between each pair of rows (if `dims=1`) or columns (if `dims=2`)
183+ in `a` and `b` according to distance `metric`. If a single matrix `a` is provided,
184+ compute distances between its rows or columns.
185+
186+ `a` and `b` must have the same numbers of columns if `dims=1`, or of rows if `dims=2`.
187+ """
168188function pairwise (metric:: PreMetric , a:: AbstractMatrix , b:: AbstractMatrix ;
169189 dims:: Union{Nothing,Integer} = nothing )
170190 dims = deprecated_dims (dims)
0 commit comments