Mercurial > repos > public > sbplib_julia
diff stencil.jl @ 132:6b6d921e8f05 cell_based_test
merge
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Thu, 21 Feb 2019 14:19:25 +0100 |
parents | 8569c637d923 66c239678a21 |
children |
line wrap: on
line diff
--- a/stencil.jl Thu Feb 21 14:11:08 2019 +0100 +++ b/stencil.jl Thu Feb 21 14:19:25 2019 +0100 @@ -1,6 +1,11 @@ struct Stencil{T<:Real,N} range::Tuple{Int,Int} weights::NTuple{N,T} + + function Stencil(range::Tuple{Int,Int},weights::NTuple{N,T}) where {T <: Real, N} + @assert range[2]-range[1]+1 == N + new{T,N}(range,weights) + end end function flip(s::Stencil)