Mercurial > repos > public > sbplib_julia
changeset 806:9fc6d38da03f refactor/sbp_operators_method_signatures
Remove type requirement for stencil weights
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 15 Sep 2021 22:09:23 +0200 |
parents | fd84ba4f8742 |
children | 1fc6c4daec44 |
files | src/SbpOperators/stencil.jl |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
diff -r fd84ba4f8742 -r 9fc6d38da03f src/SbpOperators/stencil.jl --- a/src/SbpOperators/stencil.jl Sat Jul 17 18:14:48 2021 +0200 +++ b/src/SbpOperators/stencil.jl Wed Sep 15 22:09:23 2021 +0200 @@ -1,10 +1,10 @@ export CenteredStencil -struct Stencil{T<:Real,N} +struct Stencil{T,N} range::Tuple{Int,Int} weights::NTuple{N,T} - function Stencil(range::Tuple{Int,Int},weights::NTuple{N,T}) where {T <: Real, N} + function Stencil(range::Tuple{Int,Int},weights::NTuple{N,T}) where {T, N} @assert range[2]-range[1]+1 == N new{T,N}(range,weights) end @@ -15,7 +15,7 @@ Create a stencil with the given weights with element `center` as the center of the stencil. """ -function Stencil(weights::Vararg{Number}; center::Int) +function Stencil(weights::Vararg; center::Int) N = length(weights) range = (1, N) .- center