@@ -38,6 +38,7 @@ Base.size(D::ColVecs) = (size(D.X, 2),)
3838Base. getindex (D:: ColVecs , i:: Int ) = view (D. X, :, i)
3939Base. getindex (D:: ColVecs , i:: CartesianIndex{1} ) = view (D. X, :, i)
4040Base. getindex (D:: ColVecs , i) = ColVecs (view (D. X, :, i))
41+ Base. setindex! (D:: ColVecs , v:: AbstractVector , i) = setindex! (D. X, v, :, i)
4142
4243dim (x:: ColVecs ) = size (x. X, 1 )
4344
@@ -76,6 +77,7 @@ Base.size(D::RowVecs) = (size(D.X, 1),)
7677Base. getindex (D:: RowVecs , i:: Int ) = view (D. X, i, :)
7778Base. getindex (D:: RowVecs , i:: CartesianIndex{1} ) = view (D. X, i, :)
7879Base. getindex (D:: RowVecs , i) = RowVecs (view (D. X, i, :))
80+ Base. setindex! (D:: RowVecs , v:: AbstractVector , i) = setindex! (D. X, v, i, :)
7981
8082dim (x:: RowVecs ) = size (x. X, 2 )
8183
@@ -94,17 +96,6 @@ function pairwise!(out::AbstractMatrix, d::PreMetric, x::RowVecs, y::RowVecs)
9496 return Distances. pairwise! (out, d, x. X, y. X; dims= 1 )
9597end
9698
97- """
98- Will be implemented at some point
99- ```julia
100- params(k::Kernel)
101- params(t::Transform)
102- ```
103- For a kernel return a tuple with parameters of the transform followed by the specific parameters of the kernel
104- For a transform return its parameters, for a `ChainTransform` return a vector of `params(t)`.
105- """
106- # params
107-
10899dim (x) = 0 # This is the passes-by-default choice. For a proper check, implement `KernelFunctions.dim` for your datatype.
109100dim (x:: AbstractVector ) = dim (first (x))
110101dim (x:: AbstractVector{<:AbstractVector{<:Real}} ) = length (first (x))
0 commit comments