Mercurial > repos > public > sbplib_julia
changeset 1455:6e9ac7925f20 bugfix/sbp_operators/stencil_return_type
Make the op to be promoted more accurate
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sun, 26 Nov 2023 21:14:44 +0100 |
parents | c10c6c3e9247 |
children | b411493597f3 |
files | src/SbpOperators/stencil.jl |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/SbpOperators/stencil.jl Fri Nov 24 22:58:37 2023 +0100 +++ b/src/SbpOperators/stencil.jl Sun Nov 26 21:14:44 2023 +0100 @@ -69,7 +69,7 @@ end Base.@propagate_inbounds @inline function apply_stencil(s::Stencil, v::AbstractVector, i::Int) - T = Base.promote_op(*, eltype(s), eltype(v)) + T = Base.promote_op((a₁,v₁,a₂,v₂)->a₁*v₁ + a₂*v₂, eltype(s), eltype(v), eltype(s), eltype(v)) w = zero(T) @simd for k ∈ 1:length(s) w += s.weights[k]*v[i + s.range[k]]