@@ -122,6 +122,17 @@ function deprecated_dims(dims::Union{Nothing,Integer})
122
122
end
123
123
end
124
124
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
+ """
125
136
function pairwise! (r:: AbstractMatrix , metric:: PreMetric ,
126
137
a:: AbstractMatrix , b:: AbstractMatrix ;
127
138
dims:: Union{Nothing,Integer} = nothing )
@@ -165,6 +176,15 @@ function pairwise!(r::AbstractMatrix, metric::PreMetric, a::AbstractMatrix;
165
176
end
166
177
end
167
178
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
+ """
168
188
function pairwise (metric:: PreMetric , a:: AbstractMatrix , b:: AbstractMatrix ;
169
189
dims:: Union{Nothing,Integer} = nothing )
170
190
dims = deprecated_dims (dims)
0 commit comments