Skip to content
Snippets Groups Projects
Commit e20c2fcc authored by Stephan Hilb's avatar Stephan Hilb
Browse files

make chambolle create views in `step!()`

parent 1b15e99a
No related branches found
No related tags found
No related merge requests found
...@@ -93,17 +93,17 @@ function LinearAlgebra.mul!(Y::AbstractVector{<:SVector}, A, B::AbstractVector{< ...@@ -93,17 +93,17 @@ function LinearAlgebra.mul!(Y::AbstractVector{<:SVector}, A, B::AbstractVector{<
end end
function step!(ctx::ChambolleState) function step!(ctx::ChambolleState)
display(ctx.p)
alg = ctx.algorithm alg = ctx.algorithm
sv = vec(parent(ctx.s))
rv = vec(ctx.r)
# r = div(p) + g # r = div(p) + g
map!(ctx.k1, ctx.r, ctx.p) map!(ctx.k1, ctx.r, ctx.p)
# s = B * r # s = B * r
mul!(ctx.sv, alg.problem.B, ctx.rv) mul!(sv, alg.problem.B, rv)
#display(ctx.algorithm.problem.g)
display(ctx.r)
# p = (p + τ*grad(s)) / (1 + τ/λ|grad(s)|) # p = (p + τ*grad(s)) / (1 + τ/λ|grad(s)|)
ctx.p .= deepcopy(map!(ctx.k2, ctx.p, ctx.s)) map!(ctx.k2, ctx.p, ctx.s)
ctx.p .+= 1
return ctx return ctx
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment