diff --git a/src/common.jl b/src/common.jl index 4d5f6eb93d191ee9b273942b79a1586d8b3056c3..9d0a1a0083c53c7766426fe788a6841e3d539baf 100644 --- a/src/common.jl +++ b/src/common.jl @@ -83,7 +83,7 @@ end i0 = ntuple(_->0, N) i1(k) = ntuple(i->Int(k==i), N) - wi = (:((isnothing(w[$(i0...)]) ? zero(T) : w[$(i0...)][$k]) - + wi = (:((isnothing(w[$(i1(k)...)]) ? zero(T) : w[$(i0...)][$k]) - (isnothing(w[$((.-i1(k))...)]) ? zero(T) : w[$((.-i1(k))...)][$k])) for k in 1:N) return quote Base.@_inline_meta @@ -101,7 +101,7 @@ end slice(k) = (ntuple(_->:, ndims(S)-1)..., k) - wi = (:((isnothing(w[$(i0...)]) ? zero($T) : w[$(i0...)][$(slice(k)...)]) - + wi = (:((isnothing(w[$(i1(k)...)]) ? zero($T) : w[$(i0...)][$(slice(k)...)]) - (isnothing(w[$((.-i1(k))...)]) ? zero($T) : w[$((.-i1(k))...)][$(slice(k)...)])) for k in 1:N) return quote Base.@_inline_meta diff --git a/src/dualtvdd.jl b/src/dualtvdd.jl index 1bb325e83b682da4c50c3ebd456750ebb0eb71ff..b8da778e8bbdb8b38ed178be88724f3588cd68f9 100644 --- a/src/dualtvdd.jl +++ b/src/dualtvdd.jl @@ -153,7 +153,7 @@ function step!(ctx::DualTVDDState) # data: g - Λ(p_don + p_rem) sg = copy(view(alg.problem.g, sax...)) - sp = extend(similar(ctx.p, length.(sax)), StaticKernels.ExtensionNothing()) + sp = extend(similar(ctx.p, length.(sax)), StaticKernels.ExtensionConstant(zero(eltype(ctx.p)))) if alg.parallel sp .= (1. .- theta.(Ref(ax), Ref(sax), Ref(overlap), CartesianIndices(sax))) .* view(ctx.p, sax...) else