Mercurial > repos > public > sbplib_julia
diff stencil.jl @ 43:ef060ab3b035
remove stride and remove some bugs
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Thu, 10 Jan 2019 16:30:54 +0100 |
parents | 64530c07165b |
children | 7fd4e7a1cd38 8cd8d83b92e7 |
line wrap: on
line diff
--- a/stencil.jl Thu Jan 10 15:53:44 2019 +0100 +++ b/stencil.jl Thu Jan 10 16:30:54 2019 +0100 @@ -24,10 +24,10 @@ end end -function apply(s::Stencil, v::AbstractVector, i::Int; stride::Int = 1) +function apply(s::Stencil, v::AbstractVector, i::Int) w = zero(eltype(v)) - for j ∈ i .+ stride.*(s.range[1]:s.range[2]) - w += v[j] + for j ∈ s.range[1]:s.range[2] + w += s[j]*v[i+j] end return w end