0

The following algorithm appears on p. 152 of Boyd and Parikh's book Proximal Algorithms.

I'd like to know how this was written in Latex, so that I can write my own algorithms in the same style. Which algorithm environment (if any) was used? Can anyone guess how this was written?

enter image description here

7

I'm afraid no specialized package has been used:

\documentclass{article}
\usepackage{enumitem,amsmath}

\DeclareMathOperator{\prox}{\mathbf{prox}}

\begin{document}

\noindent
\begin{minipage}{\columnwidth}
\normalfont
\hrule
\vspace{2ex}
\textbf{given} $y^k$, $\lambda^{k-1}$, and parameter $\beta\in(0,1)$.

\medskip

Let $\lambda:=\lambda^{k-1}$.

\medskip

\textbf{repeat}
\begin{enumerate}[nosep,leftmargin=3.5em]
\item Let $z:=\prox_{\lambda g}(y^k-\lambda\nabla f(y^k))$.
\item \textbf{break if} $f(z)\le \hat{f}_\lambda(z,y^k)$.
\item Update $\lambda:=\beta\lambda$.
\end{enumerate}

\medskip

\textbf{return} $\lambda^k:=\lambda$, $x^{k+1}:= z$.

\vspace{2ex}
\hrule
\end{minipage}

\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.