Cholesky-Zerlegung.tex 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{2mm}
  4. \usepackage[utf8]{inputenc} % this is needed for umlauts
  5. \usepackage[ngerman]{babel} % this is needed for umlauts
  6. \usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
  7. \usepackage{amssymb,amsmath,amsfonts} % nice math rendering
  8. \usepackage{braket} % needed for \Set
  9. \usepackage{algorithm,algpseudocode}
  10. \begin{document}
  11. \begin{preview}
  12. Sei $n \in \mathbb{N}_{\geq 1}$, $A \in \mathbb{R}^{n \times n}$ und
  13. positiv definit sowie symmetrisch.
  14. Dann existiert eine Zerlegung $A = L \cdot L^T$, wobei $L$ eine
  15. untere Dreiecksmatrix ist. Diese wird von folgendem Algorithmus
  16. berechnet:
  17. \begin{algorithm}[H]
  18. \begin{algorithmic}
  19. \Function{Cholesky}{$A \in \mathbb{R}^{n \times n}$}
  20. \State $L = \Set{0} \in \mathbb{R}^{n \times n}$ \Comment{Initialisiere $L$}
  21. \For{($k=1$; $\;k \leq n$; $\;k$++)}
  22. \State $L_{k,k} = \sqrt{A_{k,k} - \sum_{i=1}^{k-1} L_{k,i}^2}$
  23. \For{($i=k+1$; $\;i \leq n$; $\;i$++)}
  24. \State $L_{i,k} = \frac{A_{i,k} - \sum_{j=1}^{k-1} L_{i,j} \cdot L_{k,j}}{L_{k,k}}$
  25. \EndFor
  26. \EndFor
  27. \State \Return $L$
  28. \EndFunction
  29. \end{algorithmic}
  30. \caption{Cholesky-Zerlegung}
  31. \label{alg:seq1}
  32. \end{algorithm}
  33. \end{preview}
  34. \end{document}