comparison stencil.jl @ 37:5cefb9a55a50

merge with default
author Ylva Rydin <ylva.rydin@telia.com>
date Thu, 10 Jan 2019 14:49:30 +0100
parents 64530c07165b
children ef060ab3b035
comparison
equal deleted inserted replaced
36:8a30ea842c8e 37:5cefb9a55a50
22 else 22 else
23 return 0 23 return 0
24 end 24 end
25 end 25 end
26 26
27 function apply(s::Stencil, v::AbstractVector, i::Int) 27 function apply(s::Stencil, v::AbstractVector, i::Int; stride::Int = 1)
28 w = zero(v[0]) 28 w = zero(eltype(v))
29 for j ∈ i+(s.range[1]:s.range[2]) 29 for j ∈ i .+ stride.*(s.range[1]:s.range[2])
30 w += v[j] 30 w += v[j]
31 end 31 end
32 return w 32 return w
33 end 33 end