Skip to content
Snippets Groups Projects
Commit 754ac5da authored by Stephan Hilb's avatar Stephan Hilb
Browse files

fix divergence kernel function for matrix valued arrays

parent 9ec08b0e
Branches
No related tags found
No related merge requests found
......@@ -98,8 +98,8 @@ function divergence end
end
end
@generated function divergence(w::StaticKernels.Window{S,N}) where {S<:SArray,N}
T = eltype(S)
@generated function divergence(w::StaticKernels.Window{S,N}) where {M,N,S<:SMatrix{M,N}}
T = SVector{M,eltype(S)}
sz = size(S)
sz[end] == N || throw(ArgumentError("last eltype dimension does not match array dimensionality"))
......
......@@ -98,3 +98,9 @@ end
end
@test fetch_u(st) fetch_u(stref)
end
@testset "divergence on extended arrays" begin
k = Kernel{(-1:1,-1:1)}(DualTVDD.divergence)
a = rand(SMatrix{2, 2, Float64}, 3, 3)
map(k, extend(a, StaticKernels.ExtensionNothing()))
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment