Skip to content
Snippets Groups Projects
Commit 405e63f9 authored by Kevin Höllring's avatar Kevin Höllring
Browse files
parents 6a606661 d9f7a6de
No related branches found
No related tags found
No related merge requests found
...@@ -229,7 +229,7 @@ in your command line/shell before executing your program. ...@@ -229,7 +229,7 @@ in your command line/shell before executing your program.
\item Calculate the Hesse matrix once and store its value: \item Calculate the Hesse matrix once and store its value:
$$H_k= \nabla^2f(x_k)$$ $$H_k= \nabla^2f(x_k)$$
\item Calculate the step size: \item Calculate the step size:
$$\alpha_k = \frac{\left\langle g_k, d_k\right\rangle}{\left\langle d_k, H_k \cdot d_k\right\rangle}$$ $$\alpha_k = -\frac{\left\langle g_k, d_k\right\rangle}{\left\langle d_k, H_k \cdot d_k\right\rangle}$$
\item Update the current position: \item Update the current position:
$$x_{k+1} = x_k +\alpha_k \cdot d_k$$ $$x_{k+1} = x_k +\alpha_k \cdot d_k$$
\item Calculate the next gradient: \item Calculate the next gradient:
...@@ -241,6 +241,7 @@ in your command line/shell before executing your program. ...@@ -241,6 +241,7 @@ in your command line/shell before executing your program.
\end{enumerate} \end{enumerate}
\end{enumerate} \end{enumerate}
The resulting $x_n$ is the end approximation of the substep and can afterwards be used as the input for subsequent executions of this subroutine. The resulting $x_n$ is the end approximation of the substep and can afterwards be used as the input for subsequent executions of this subroutine.
(Consider appropriate conditions to end a loop preliminarily. These may contain: numbers being too small to divide by them, gradients/directional vectors being too short,\ldots)
\begin{enumerate} \begin{enumerate}
\item In order to structure your code, implement the method \class{ConjugateGradient::CGstep}, which executes one full iteration of the subroutine as detailed above.\\ \item In order to structure your code, implement the method \class{ConjugateGradient::CGstep}, which executes one full iteration of the subroutine as detailed above.\\
To do that you will need a few extra steps To do that you will need a few extra steps
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment