Skip to content

Commit 9455aca

Browse files
committed
Removed _kernel further
1 parent 2b9d20a commit 9455aca

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

src/basekernels/fbm.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,6 @@ function kernelmatrix!(
6666
return K
6767
end
6868

69-
## Apply kernel on two vectors ##
70-
function _kernel(
71-
κ::FBMKernel,
72-
x::AbstractVector,
73-
y::AbstractVector;
74-
obsdim::Int = defaultobs
75-
)
76-
@assert length(x) == length(y) "x and y don't have the same dimension!"
77-
return kappa(κ, x, y)
78-
end
79-
8069
function kappa::FBMKernel, x::AbstractVector{<:Real}, y::AbstractVector{<:Real})
8170
modX = sum(abs2, x)
8271
modY = sum(abs2, y)

src/matrix/kernelmatrix.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function kernelmatrix!(
2121
X::AbstractMatrix;
2222
obsdim::Int = defaultobs,
2323
)
24-
@assert obsdim [1, 2] "obsdim should be 1 or 2 (see docs of `kernelmatrix`))"
24+
@assert obsdim [1, 2] "obsdim should be 1 or 2 (see docs of `kernelmatrix`)"
2525
if !check_dims(K, X, X, feature_dim(obsdim), obsdim)
2626
throw(DimensionMismatch("Dimensions of the target array K $(size(K)) are not consistent with X $(size(X))"))
2727
end
@@ -181,9 +181,9 @@ function kerneldiagmatrix(
181181
)
182182
@assert obsdim [1,2] "obsdim should be 1 or 2 (see docs of kernelmatrix))"
183183
if obsdim == 1
184-
kerneldiagmatrix(κ, ColVecs(X)) #[@views _kernel(κ,X[i,:],X[i,:]) for i in 1:size(X,obsdim)]
184+
kerneldiagmatrix(κ, ColVecs(X))
185185
elseif obsdim == 2
186-
kerneldiagmatrix(κ, ColVecs(X')) #[@views _kernel(κ,X[:,i],X[:,i]) for i in 1:size(X,obsdim)]
186+
kerneldiagmatrix(κ, ColVecs(X'))
187187
end
188188
end
189189

test/basekernels/exponential.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
@test repr(k) == "Gamma Exponential Kernel (γ = $(γ))"
3636

3737
#Coherence :
38-
@test KernelFunctions._kernel(GammaExponentialKernel=1.0),v1,v2) KernelFunctions._kernel(SqExponentialKernel(),v1,v2)
39-
@test KernelFunctions._kernel(GammaExponentialKernel=0.5),v1,v2) KernelFunctions._kernel(ExponentialKernel(),v1,v2)
38+
@test GammaExponentialKernel=1.0)(v1,v2) SqExponentialKernel(v1,v2)
39+
@test GammaExponentialKernel=0.5)(v1,v2) ExponentialKernel(v1,v2)
4040
end
4141
end

test/matrix/kernelmatrix.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
@test kerneldiagmatrix(k,A,obsdim=obsdim) == diag(kernelmatrix(k,A,obsdim=obsdim))
3131
@test k(A,B,obsdim=obsdim) == kernelmatrix(k,A,B,obsdim=obsdim)
3232
@test k(A,obsdim=obsdim) == kernelmatrix(k,A,obsdim=obsdim)
33-
@test KernelFunctions._kernel(k,1.0,2.0) == KernelFunctions._kernel(k,[1.0],[2.0])
33+
# @test KernelFunctions._kernel(k,1.0,2.0) == KernelFunctions._kernel(k,[1.0],[2.0])
3434
@test_throws DimensionMismatch kernelmatrix(k,A,C,obsdim=obsdim)
3535
end
3636
end

0 commit comments

Comments
 (0)