Skip to content

Commit fec2318

Browse files
authored
Tweak implementation (#140)
* Tweak implementation * Remove type parametrisation
1 parent c48301e commit fec2318

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "KernelFunctions"
22
uuid = "ec8451be-7e33-11e9-00cf-bbf324bd1392"
3-
version = "0.4.2"
3+
version = "0.4.3"
44

55
[deps]
66
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"

src/distances/delta.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
struct Delta <: Distances.PreMetric
22
end
33

4-
@inline function Distances._evaluate(::Delta, a::AbstractVector{Ta}, b::AbstractVector{Tb}) where {Ta, Tb}
4+
@inline function Distances._evaluate(::Delta, a::AbstractVector, b::AbstractVector)
55
@boundscheck if length(a) != length(b)
6-
throw(DimensionMismatch("first array has length $(length(a)) which does not match the length of the second, $(length(b))."))
6+
throw(DimensionMismatch(
7+
"first array has length $(length(a)) which does not match the length of the " *
8+
"second, $(length(b)).",
9+
))
710
end
8-
return convert(promote_type(Ta, Tb), a == b)
11+
return a == b
912
end
1013

1114
Distances.result_type(::Delta, Ta::Type, Tb::Type) = promote_type(Ta, Tb)

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
1414

1515
[compat]
1616
Distances = "0.9"
17-
FiniteDifferences = "0.10"
17+
FiniteDifferences = "0.10.8"
1818
Flux = "0.10, 0.11"
1919
ForwardDiff = "0.10"
2020
Kronecker = "0.4"

0 commit comments

Comments
 (0)