@@ -12,7 +12,7 @@ function kernelmatrix!(
12
12
κ:: Kernel ,
13
13
X:: AbstractVector{<:Real}
14
14
)
15
- kernelmatrix! (K, κ, reshape (X, 1 , :), obsdim = 2 )
15
+ kernelmatrix! (K, κ, ColVecs ( reshape (X, 1 , :)) )
16
16
end
17
17
18
18
function kernelmatrix! (
@@ -47,7 +47,7 @@ function kernelmatrix!(
47
47
κ:: Kernel ,
48
48
X:: AbstractVector
49
49
)
50
- if ( size (K, 1 ) != size (K, 2 )) || ( length (X) != size (K, 1 ) )
50
+ if ! check_dims (K, X, X )
51
51
throw (DimensionMismatch (" Dimensions of the target array K $(size (K)) are not consistent with X $(size (X)) " ))
52
52
end
53
53
K .= κ .(X, X' )
@@ -60,7 +60,7 @@ function kernelmatrix!(
60
60
X:: AbstractVector{<:Real} ,
61
61
Y:: AbstractVector{<:Real}
62
62
)
63
- kernelmatrix! (K, κ, reshape (X, 1 , :), reshape (Y, 1 , :), obsdim = 2 )
63
+ kernelmatrix! (K, κ, ColVecs ( reshape (X, 1 , :)), ColVecs ( reshape (Y, 1 , :)) )
64
64
end
65
65
66
66
function kernelmatrix! (
@@ -98,7 +98,7 @@ function kernelmatrix!(
98
98
X:: AbstractVector ,
99
99
Y:: AbstractVector
100
100
)
101
- if ( size ( K, 1 ) != length (X)) || ( size (K, 2 ) != length (Y) )
101
+ if ! check_dims ( K, X, Y )
102
102
throw (DimensionMismatch (" Dimensions of the target array K $(size (K)) are not consistent with X $(size (X)) and Y $(size (Y)) " ))
103
103
end
104
104
K .= κ .(X, Y' )
147
147
function kernelmatrix (
148
148
κ:: Kernel ,
149
149
X:: AbstractVector{<:Real} ,
150
- Y:: AbstractMatrix {<:Real}
150
+ Y:: AbstractVector {<:Real}
151
151
)
152
- kernelmatrix (κ, reshape (X, 1 , :), reshape (Y, 1 , :), obsdim = 2 )
152
+ kernelmatrix (κ, ColVecs ( reshape (X, 1 , :)), ColVecs ( reshape (Y, 1 , :)) )
153
153
end
154
154
155
155
function kernelmatrix (
@@ -231,5 +231,8 @@ function kerneldiagmatrix!(
231
231
κ:: Kernel ,
232
232
X:: AbstractVector
233
233
)
234
+ if length (K) != length (X)
235
+ throw (DimensionMismatch (" Dimensions of the target array K $(size (K)) are not consistent with X $(length (X)) " ))
236
+ end
234
237
map! (κ, K, X, X)
235
238
end
0 commit comments