@@ -224,35 +224,143 @@ end
224
224
# ###############
225
225
# Deviations
226
226
227
+ """
228
+ vcounteq(x::AbstractArray, y::AbstractArray; dims=:)
229
+
230
+ Count the number of elements for which `xᵢ == yᵢ` returns `true` on the vectors
231
+ corresponding to the slices along the dimension `dims`.
232
+
233
+ See also: [`vcountne`](@ref)
234
+ """
227
235
vcounteq (x, y; dims= :) = vvmapreduce (== , + , x, y, dims= dims)
236
+
237
+ """
238
+ vtcounteq(x::AbstractArray, y::AbstractArray; dims=:)
239
+
240
+ Count the number of elements for which `xᵢ == yᵢ` returns `true` on the vectors
241
+ corresponding to the slices along the dimension `dims`. Threaded.
242
+
243
+ See also: [`vtcountne`](@ref)
244
+ """
228
245
vtcounteq (x, y; dims= :) = vtmapreduce (== , + , x, y, dims= dims)
246
+
247
+ """
248
+ vcountne(x::AbstractArray, y::AbstractArray; dims=:)
249
+
250
+ Count the number of elements for which `xᵢ != yᵢ` returns `true` on the vectors
251
+ corresponding to the slices along the dimension `dims`.
252
+
253
+ See also: [`vcounteq`](@ref)
254
+ """
229
255
vcountne (x, y; dims= :) = vvmapreduce (!= , + , x, y, dims= dims)
256
+
257
+ """
258
+ vtcountne(x::AbstractArray, y::AbstractArray; dims=:)
259
+
260
+ Count the number of elements for which `xᵢ != yᵢ` returns `true` on the vectors
261
+ corresponding to the slices along the dimension `dims`. Threaded.
262
+
263
+ See also: [`vtcounteq`](@ref)
264
+ """
230
265
vtcountne (x, y; dims= :) = vtmapreduce (!= , + , x, y, dims= dims)
231
266
267
+ """
268
+ vmeanad(x::AbstractArray, y::AbstractArray; dims=:)
269
+
270
+ Compute the mean absolute deviation between the vectors corresponding to the slices along
271
+ the dimension `dims`.
272
+
273
+ See also: [`vmaxad`](@ref)
274
+ """
232
275
function vmeanad (x, y; dims= :)
233
276
c = 1 / _denom (x, dims)
234
277
vmapreducethen ((xᵢ, yᵢ) -> abs (xᵢ - yᵢ) , + , z -> c * z, x, y, dims= dims)
235
278
end
279
+
280
+ """
281
+ vtmeanad(x::AbstractArray, y::AbstractArray; dims=:)
282
+
283
+ Compute the mean absolute deviation between the vectors corresponding to the slices along
284
+ the dimension `dims`. Threaded.
285
+
286
+ See also: [`vtmaxad`](@ref)
287
+ """
236
288
function vtmeanad (x, y; dims= :)
237
289
c = 1 / _denom (x, dims)
238
290
vtmapreducethen ((xᵢ, yᵢ) -> abs (xᵢ - yᵢ) , + , z -> c * z, x, y, dims= dims)
239
291
end
240
292
293
+ """
294
+ vmaxad(x::AbstractArray, y::AbstractArray; dims=:)
295
+
296
+ Compute the maximum absolute deviation between the vectors corresponding to the slices along
297
+ the dimension `dims`.
298
+
299
+ See also: [`vmeanad`](@ref)
300
+ """
241
301
vmaxad (x, y; dims= :) = vvmapreduce ((xᵢ, yᵢ) -> abs (xᵢ - yᵢ) , max, x, y, dims= dims)
302
+
303
+ """
304
+ vtmaxad(x::AbstractArray, y::AbstractArray; dims=:)
305
+
306
+ Compute the maximum absolute deviation between the vectors corresponding to the slices along
307
+ the dimension `dims`. Threaded.
308
+
309
+ See also: [`vtmeanad`](@ref)
310
+ """
242
311
vtmaxad (x, y; dims= :) = vtmapreduce ((xᵢ, yᵢ) -> abs (xᵢ - yᵢ) , max, x, y, dims= dims)
243
312
313
+ """
314
+ vmse(x::AbstractArray, y::AbstractArray; dims=:)
315
+
316
+ Compute the mean squared error between the vectors corresponding to the slices along
317
+ the dimension `dims`.
318
+
319
+ See also: [`vrmse`](@ref)
320
+ """
244
321
function vmse (x, y; dims= :)
245
322
c = 1 / _denom (x, dims)
246
323
vmapreducethen ((xᵢ, yᵢ) -> abs2 (xᵢ - yᵢ) , + , z -> c * z, x, y, dims= dims)
247
324
end
325
+
326
+ """
327
+ vtmse(x::AbstractArray, y::AbstractArray; dims=:)
328
+
329
+ Compute the mean squared error between the vectors corresponding to the slices along
330
+ the dimension `dims`. Threaded.
331
+
332
+ See also: [`vtrmse`](@ref)
333
+ """
248
334
function vtmse (x, y; dims= :)
249
335
c = 1 / _denom (x, dims)
250
336
vtmapreducethen ((xᵢ, yᵢ) -> abs2 (xᵢ - yᵢ) , + , z -> c * z, x, y, dims= dims)
251
337
end
338
+
339
+ """
340
+ vrmse(x::AbstractArray, y::AbstractArray; dims=:)
341
+
342
+ Compute the square root of the mean squared error between the vectors corresponding
343
+ to the slices along the dimension `dims`. More efficient than `sqrt.(vmse(...))`
344
+ as the `sqrt` operation is performed at the point of generation, thereby eliminating the
345
+ full traversal which would otherwise occur.
346
+
347
+ See also: [`vmse`](@ref)
348
+ """
252
349
function vrmse (x, y; dims= :)
253
350
c = 1 / _denom (x, dims)
254
351
vmapreducethen ((xᵢ, yᵢ) -> abs2 (xᵢ - yᵢ) , + , z -> √ (c * z), x, y, dims= dims)
255
352
end
353
+
354
+ """
355
+ vtrmse(x::AbstractArray, y::AbstractArray; dims=:)
356
+
357
+ Compute the square root of the mean squared error between the vectors corresponding
358
+ to the slices along the dimension `dims`. More efficient than `sqrt.(vmse(...))`
359
+ as the `sqrt` operation is performed at the point of generation, thereby eliminating the
360
+ full traversal which would otherwise occur. Threaded.
361
+
362
+ See also: [`vtmse`](@ref)
363
+ """
256
364
function vtrmse (x, y; dims= :)
257
365
c = 1 / _denom (x, dims)
258
366
vtmapreducethen ((xᵢ, yᵢ) -> abs2 (xᵢ - yᵢ) , + , z -> √ (c * z), x, y, dims= dims)
0 commit comments