@@ -38,6 +38,7 @@ Base.size(D::ColVecs) = (size(D.X, 2),)
38
38
Base. getindex (D:: ColVecs , i:: Int ) = view (D. X, :, i)
39
39
Base. getindex (D:: ColVecs , i:: CartesianIndex{1} ) = view (D. X, :, i)
40
40
Base. getindex (D:: ColVecs , i) = ColVecs (view (D. X, :, i))
41
+ Base. setindex! (D:: ColVecs , v:: AbstractVector , i) = setindex! (D. X, v, :, i)
41
42
42
43
dim (x:: ColVecs ) = size (x. X, 1 )
43
44
@@ -76,6 +77,7 @@ Base.size(D::RowVecs) = (size(D.X, 1),)
76
77
Base. getindex (D:: RowVecs , i:: Int ) = view (D. X, i, :)
77
78
Base. getindex (D:: RowVecs , i:: CartesianIndex{1} ) = view (D. X, i, :)
78
79
Base. getindex (D:: RowVecs , i) = RowVecs (view (D. X, i, :))
80
+ Base. setindex! (D:: RowVecs , v:: AbstractVector , i) = setindex! (D. X, v, i, :)
79
81
80
82
dim (x:: RowVecs ) = size (x. X, 2 )
81
83
@@ -94,17 +96,6 @@ function pairwise!(out::AbstractMatrix, d::PreMetric, x::RowVecs, y::RowVecs)
94
96
return Distances. pairwise! (out, d, x. X, y. X; dims= 1 )
95
97
end
96
98
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
-
108
99
dim (x) = 0 # This is the passes-by-default choice. For a proper check, implement `KernelFunctions.dim` for your datatype.
109
100
dim (x:: AbstractVector ) = dim (first (x))
110
101
dim (x:: AbstractVector{<:AbstractVector{<:Real}} ) = length (first (x))
0 commit comments