Mercurial > repos > public > sbplib_julia
changeset 808:9479c03f413b operator_storage_array_of_table
Merge
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sat, 18 Sep 2021 23:31:50 +0200 |
parents | 3881386f25e6 (current diff) 1fc6c4daec44 (diff) |
children | 219c9661e700 |
files | |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/SbpOperators/stencil.jl Wed Sep 15 21:39:47 2021 +0200 +++ b/src/SbpOperators/stencil.jl Sat Sep 18 23:31:50 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{T}; center::Int) where T # Type parameter T makes sure the weights are valid for the Stencil constuctors and throws an earlier, more readable, error N = length(weights) range = (1, N) .- center