Skip to content

Commit 21980a9

Browse files
committed
hack avoidance explanation in PR
1 parent 74085db commit 21980a9

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

src/diffKernel.jl

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,6 @@ not allowed for the `(::T)(x,y)` syntax. If we were to only implement
8383
then julia would not know whether to use
8484
`(::SpecialKernel)(x,y)` or `(::Kernel)(x::DiffPt, y::DiffPt)`
8585
```
86-
To avoid this hack, no kernel type T should implement
87-
```julia
88-
(::T)(x,y)
89-
```
90-
and instead implement
91-
```julia
92-
_evaluate(k::T, x, y)
93-
```
94-
Then there should be only a single
95-
```julia
96-
(k::Kernel)(x,y) = _evaluate(k, x, y)
97-
```
98-
which all the kernels would fall back to.
99-
100-
This ensures that evaluate(k::T, x::DiffPt{Dim}, y::DiffPt{Dim}) is always
101-
more specialized and call beforehand.
10286
=#
10387
for T in [SimpleKernel, Kernel] #subtypes(Kernel)
10488
(k::T)(x::DiffPt{Dim}, y::DiffPt{Dim}) where {Dim} = _evaluate(k, x, y)

0 commit comments

Comments
 (0)