Projected-gradient dual total variation algorithm (source code)

= Projected-gradient dual total variation algorithm

Minimize $F(p)=\tfrac12\|g-D^*p\|_2^2$ over $P=\{p:|p_i|_2\le\lambda\}$ using
$$
p^{k+1}=\Pi_P\bigl(p^k+\tau D(g-D^*p^k)\bigr).
$$
The pointwise <Euclidean projection onto a convex set> sends a block $r$ to $r/\max(1,|r|_2/\lambda)$. The <gradient> of $F$ has <Lipschitz constant> $\|D\|^2$, so finite-dimensional <projected gradient descent> converges for $0<\tau<2/\|D\|^2$. On an unscaled square grid with $N>1$, $0<\tau<1/4$ is safe. Reconstruct $u^k=g-D^*p^k$; unused dual directions may make the minimizing $p$ nonunique while the primal minimizer is unique.