Skip to content

Commit 0927aae

Browse files
committed
Created concrete types to call syntactic sugar on all kernels
1 parent 0654f2f commit 0927aae

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/generic.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ printshifted(io::IO,κ::Kernel,shift::Int) = print(io,"$κ")
1515
Base.show(io::IO::Kernel) = print(io,nameof(typeof(κ)))
1616

1717
### Syntactic sugar for creating matrices and using kernel functions
18-
for k in subtypes(BaseKernel)
18+
19+
function concretetypes(k, ktypes::Vector)
20+
isempty(subtypes(k)) ? push!(ktypes, k) : concretetypes.(subtypes(k), Ref(ktypes))
21+
return ktypes
22+
end
23+
24+
25+
for k in concretetypes(Kernel, [])
1926
@eval begin
2027
@inline::$k)(d::Real) = kappa(κ,d) #TODO Add test
2128
@inline::$k)(x::AbstractVector{<:Real}, y::AbstractVector{<:Real}) = kappa(κ, x, y)

0 commit comments

Comments
 (0)