Fix listing spacing

This commit is contained in:
2023-10-04 10:14:13 +02:00
parent ea52390910
commit e70fd9ea79
2 changed files with 2 additions and 3 deletions

View File

@ -39,8 +39,7 @@
showspaces = false, showspaces = false,
showstringspaces = true, showstringspaces = true,
showtabs = false, showtabs = false,
tabsize = 3, tabsize = 3
belowskip = -0.8\baselineskip
} }
\lstset{style=mystyle} \lstset{style=mystyle}
\lstset{language=Python} \lstset{language=Python}

View File

@ -106,7 +106,7 @@ Note: descent methods usually converge to a local minimum.
\item[Backtracking procedure] \marginnote{Backtracking procedure} \item[Backtracking procedure] \marginnote{Backtracking procedure}
$\alpha_k$ is chose such that it respects the Wolfe condition\footnote{\url{https://en.wikipedia.org/wiki/Wolfe_conditions}}: $\alpha_k$ is chose such that it respects the Wolfe condition\footnote{\url{https://en.wikipedia.org/wiki/Wolfe_conditions}}:
\begin{lstlisting}[mathescape=true] \begin{lstlisting}[mathescape=true, belowskip = -0.8\baselineskip]
def backtracking($\tau$, $c_1$): def backtracking($\tau$, $c_1$):
$\alpha_k$ = 1 # Initial guess $\alpha_k$ = 1 # Initial guess
while $f(x_k - \alpha_k \nabla f(\vec{x}_k))$ > $f(\vec{x}_k)$ + $c_1 \alpha_k \nabla f(\vec{x}_k)^T \nabla f(\vec{x}_k)$: while $f(x_k - \alpha_k \nabla f(\vec{x}_k))$ > $f(\vec{x}_k)$ + $c_1 \alpha_k \nabla f(\vec{x}_k)^T \nabla f(\vec{x}_k)$: