Skip to content

Commit 3b90e79

Browse files
aviateskdkarrasch
andauthored
fix _bhattacharyya_coeff signature type (#248)
Co-authored-by: Daniel Karrasch <[email protected]>
1 parent aae27b2 commit 3b90e79

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Distances"
22
uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
3-
version = "0.10.7"
3+
version = "0.10.8"
44

55
[deps]
66
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/bhattacharyya.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ end
3434
end
3535
return sqab, asum, bsum
3636
end
37-
@inline function _bhattacharyya_coeff(a::AbstractVector{Ta}, b::AbstractVector{Tb}) where {Ta<:Number,Tb<:Number}
38-
T = typeof(sqrt(oneunit(Ta)*oneunit(Tb)))
37+
@inline function _bhattacharyya_coeff(a::AbstractVector, b::AbstractVector)
38+
T = typeof(sqrt(oneunit(eltype(a))*oneunit(eltype(b))))
3939
sqab = zero(T)
40-
asum = zero(Ta)
41-
bsum = zero(Tb)
40+
asum = zero(eltype(a))
41+
bsum = zero(eltype(b))
4242

4343
@simd for i in eachindex(a, b)
4444
@inbounds ai = a[i]
@@ -50,7 +50,7 @@ end
5050
return sqab, asum, bsum
5151
end
5252

53-
@inline function _bhattacharyya_coeff(a::SparseVectorUnion{<:Number}, b::SparseVectorUnion{<:Number})
53+
@inline function _bhattacharyya_coeff(a::SparseVectorUnion, b::SparseVectorUnion)
5454
anzind = nonzeroinds(a)
5555
bnzind = nonzeroinds(b)
5656
anzval = nonzeros(a)

0 commit comments

Comments
 (0)