Skip to content

Commit 00fb5b7

Browse files
authored
Fix uses of sumabs2, abs2 and abs in docstrings (#801)
`sumabs2` has been removed from Julia a long time ago. Also fix vectorized uses of `abs` and `abs2` as these methods no longer either either.
1 parent fec8d07 commit 00fb5b7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/deviation.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ end
4444
sqL2dist(a, b)
4545
4646
Compute the squared L2 distance between two arrays: ``\\sum_{i=1}^n |a_i - b_i|^2``.
47-
Efficient equivalent of `sumabs2(a - b)`.
47+
Efficient equivalent of `sum(abs2, a - b)`.
4848
"""
4949
function sqL2dist(a::AbstractArray{T}, b::AbstractArray{T}) where T<:Number
5050
n = length(a)
@@ -62,7 +62,7 @@ end
6262
L2dist(a, b)
6363
6464
Compute the L2 distance between two arrays: ``\\sqrt{\\sum_{i=1}^n |a_i - b_i|^2}``.
65-
Efficient equivalent of `sqrt(sumabs2(a - b))`.
65+
Efficient equivalent of `sqrt(sum(abs2, a - b))`.
6666
"""
6767
L2dist(a::AbstractArray{T}, b::AbstractArray{T}) where {T<:Number} = sqrt(sqL2dist(a, b))
6868

@@ -135,7 +135,7 @@ end
135135
"""
136136
meanad(a, b)
137137
138-
Return the mean absolute deviation between two arrays: `mean(abs(a - b))`.
138+
Return the mean absolute deviation between two arrays: `mean(abs, a - b)`.
139139
"""
140140
meanad(a::AbstractArray{T}, b::AbstractArray{T}) where {T<:Number} =
141141
L1dist(a, b) / length(a)
@@ -154,7 +154,7 @@ maxad(a::AbstractArray{T}, b::AbstractArray{T}) where {T<:Number} = Linfdist(a,
154154
"""
155155
msd(a, b)
156156
157-
Return the mean squared deviation between two arrays: `mean(abs2(a - b))`.
157+
Return the mean squared deviation between two arrays: `mean(abs2, a - b)`.
158158
"""
159159
msd(a::AbstractArray{T}, b::AbstractArray{T}) where {T<:Number} =
160160
sqL2dist(a, b) / length(a)

0 commit comments

Comments
 (0)