Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "KernelFunctions"
uuid = "ec8451be-7e33-11e9-00cf-bbf324bd1392"
version = "0.10.55"
version = "0.10.56"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
2 changes: 2 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ Base.setindex!(D::ColVecs, v::AbstractVector, i) = setindex!(D.X, v, :, i)

Base.vcat(a::ColVecs, b::ColVecs) = ColVecs(hcat(a.X, b.X))
Base.zero(x::ColVecs) = ColVecs(zero(x.X))
Base.reduce(::typeof(hcat), a::ColVecs) = a.X
Base.reduce(::typeof(vcat), a::ColVecs) = reshape(a.X, :)

dim(x::ColVecs) = size(x.X, 1)

Expand Down
3 changes: 3 additions & 0 deletions test/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@

Y = randn(rng, D, N + 1)
DY = ColVecs(Y)

@test reduce(vcat, DY) == vcat(DY...)
@test reduce(hcat, DY) == hcat(DY...)
@test KernelFunctions.pairwise(SqEuclidean(), DX) ≈
pairwise(SqEuclidean(), X; dims=2)
@test KernelFunctions.pairwise(SqEuclidean(), DX, DY) ≈
Expand Down