Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132938 views
License: OTHER
1
\documentclass[aspectratio=169,hyperref={pdfpagelabels=false}]{beamer}
2
\usepackage{lmodern}
3
4
\usepackage[utf8]{inputenc} % this is needed for german umlauts
5
\usepackage[ngerman]{babel} % this is needed for german umlauts
6
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
7
8
\usepackage{braket} % needed for \Set
9
\usepackage{algorithm,algpseudocode}
10
11
\usepackage{verbatim}
12
\usepackage{tikz}
13
\usetikzlibrary{arrows,shapes}
14
15
% Define some styles for graphs
16
\tikzstyle{vertex}=[circle,fill=black!25,minimum size=20pt,inner sep=0pt]
17
\tikzstyle{selected vertex} = [vertex, fill=red!24]
18
\tikzstyle{blue vertex} = [vertex, fill=blue!24]
19
\tikzstyle{edge} = [draw,thick,-]
20
\tikzstyle{weight} = [font=\small]
21
\tikzstyle{selected edge} = [draw,line width=5pt,-,red!50]
22
\tikzstyle{ignored edge} = [draw,line width=5pt,-,black!20]
23
24
% see http://deic.uab.es/~iblanes/beamer_gallery/index_by_theme.html
25
%\usetheme{Frankfurt}
26
\usefonttheme{professionalfonts}
27
28
% disables bottom navigation bar
29
\beamertemplatenavigationsymbolsempty
30
31
% http://tex.stackexchange.com/questions/23727/converting-beamer-slides-to-animated-images
32
\setbeamertemplate{navigation symbols}{}%
33
34
\newcommand{\alertline}{%
35
\usebeamercolor[fg]{normal text}%
36
\only{\usebeamercolor[fg]{alerted text}}}
37
38
39
\begin{document}
40
\pgfdeclarelayer{background}
41
\pgfsetlayers{background,main}
42
\newcommand\hlight[1]{\tikz[overlay, remember picture,baseline=-\the\dimexpr\fontdimen22\textfont2\relax]\node[rectangle,fill=blue!50,rounded corners,fill opacity = 0.2,draw,thick,text opacity =1] {$#1$};}
43
\newcommand\tocalculate[1]{\tikz[overlay, remember picture,baseline=-\the\dimexpr\fontdimen22\textfont2\relax]\node[rectangle,fill=green!50,rounded corners,fill opacity = 0.2,draw,thick,text opacity =1] {$#1$};}
44
45
\begin{frame}
46
\begin{minipage}[b]{0.30\linewidth}
47
\centering
48
\begin{align*}
49
A &= \begin{pmatrix}
50
1 & 2 & 3\\
51
2 & 8 & 14\\
52
3 & 14 & 34
53
\end{pmatrix}\\
54
\alertline<1> L &= \alertline<1>\begin{pmatrix}
55
0 & 0 & 0\\
56
0 & 0 & 0\\
57
0 & 0 & 0
58
\end{pmatrix}\\
59
tmp &= 0
60
\end{align*}
61
\end{minipage}
62
\hspace{0.5cm}
63
\begin{minipage}[b]{0.60\linewidth}
64
\centering
65
\begin{algorithm}[H]
66
\begin{algorithmic}
67
\Function{Cholesky}{$A \in \mathbb{R}^{n \times n}$}
68
\alertline<1>\State $L = \Set{0} \in \mathbb{R}^{n \times n}$ \Comment{Initialisiere $L$}\\
69
70
\alertline<2>\alertline<4>\For{($k=1$; $\;k \leq n$; $\;k$++)}
71
\alertline<3>\State $L_{k,k} = \sqrt{A_{k,k} - \sum_{i=1}^{k-1} L_{k,i}^2}$
72
\For{($i=k+1$; $\;i \leq n$; $\;i$++)}
73
\State $L_{i,k} = \frac{A_{i,k} - \sum_{j=1}^{k-1} L_{i,j} \cdot L_{k,j}}{L_{k,k}}$
74
\EndFor
75
\EndFor
76
\alertline<5>\State \Return $L$
77
\EndFunction
78
\end{algorithmic}
79
\caption{Cholesky-Zerlegung}
80
\label{alg:seq1}
81
\end{algorithm}
82
\end{minipage}
83
\end{frame}
84
\begin{frame}
85
\begin{align*}
86
A &= \begin{pmatrix}
87
\hlight{1} & 2 & 3\\
88
2 & 8 & 14\\
89
3 & 14 & 34
90
\end{pmatrix}\\
91
L &= \begin{pmatrix}
92
\tocalculate{0} & 0 & 0\\
93
0 & 0 & 0\\
94
0 & 0 & 0
95
\end{pmatrix}\\
96
tmp &= 0
97
\end{align*}
98
\end{frame}
99
\begin{frame}
100
\begin{align*}
101
A &= \begin{pmatrix}
102
1 & 2 & 3\\
103
2 & 8 & 14\\
104
3 & 14 & 34
105
\end{pmatrix}\\
106
L &= \begin{pmatrix}
107
\tocalculate{1} & 0 & 0\\
108
0 & 0 & 0\\
109
0 & 0 & 0
110
\end{pmatrix}\\
111
tmp &= 0
112
\end{align*}
113
\end{frame}
114
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
115
% Calculate L_2,1
116
\begin{frame}
117
\begin{align*}
118
A &= \begin{pmatrix}
119
1 & 2 & 3\\
120
\hlight{2} & 8 & 14\\
121
3 & 14 & 34
122
\end{pmatrix}\\
123
L &= \begin{pmatrix}
124
1 & 0 & 0\\
125
\tocalculate{0} & 0 & 0\\
126
0 & 0 & 0
127
\end{pmatrix}\\
128
tmp &= 0
129
\end{align*}
130
\end{frame}
131
132
\begin{frame}
133
\begin{align*}
134
A &= \begin{pmatrix}
135
1 & 2 & 3\\
136
2 & 8 & 14\\
137
3 & 14 & 34
138
\end{pmatrix}\\
139
L &= \begin{pmatrix}
140
\hlight{1} & 0 & 0\\
141
\tocalculate{2} & 0 & 0\\
142
0 & 0 & 0
143
\end{pmatrix}\\
144
tmp &= 0
145
\end{align*}
146
\end{frame}
147
148
\begin{frame}
149
\begin{align*}
150
A &= \begin{pmatrix}
151
1 & 2 & 3\\
152
2 & 8 & 14\\
153
3 & 14 & 34
154
\end{pmatrix}\\
155
L &= \begin{pmatrix}
156
1 & 0 & 0\\
157
\tocalculate{2} & 0 & 0\\
158
0 & 0 & 0
159
\end{pmatrix}\\
160
tmp &= 0
161
\end{align*}
162
\end{frame}
163
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164
% Calculate L_3,1
165
\begin{frame}
166
\begin{align*}
167
A &= \begin{pmatrix}
168
1 & 2 & 3\\
169
2 & 8 & 14\\
170
\hlight{3} & 14 & 34
171
\end{pmatrix}\\
172
L &= \begin{pmatrix}
173
1 & 0 & 0\\
174
2 & 0 & 0\\
175
\tocalculate{0} & 0 & 0
176
\end{pmatrix}\\
177
tmp &= 0
178
\end{align*}
179
\end{frame}
180
181
\begin{frame}
182
\begin{align*}
183
A &= \begin{pmatrix}
184
\hlight{1} & 2 & 3\\
185
2 & 8 & 14\\
186
3 & 14 & 34
187
\end{pmatrix}\\
188
L &= \begin{pmatrix}
189
1 & 0 & 0\\
190
2 & 0 & 0\\
191
\tocalculate{3} & 0 & 0
192
\end{pmatrix}\\
193
tmp &= 0
194
\end{align*}
195
\end{frame}
196
197
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
198
% Calculate L_2,2
199
\begin{frame}
200
\begin{align*}
201
A &= \begin{pmatrix}
202
1 & 2 & 3\\
203
2 & \hlight{8} & 14\\
204
3 & 14 & 34
205
\end{pmatrix}\\
206
L &= \begin{pmatrix}
207
1 & 0 & 0\\
208
2 & \tocalculate{0} & 0\\
209
3 & 0 & 0
210
\end{pmatrix}\\
211
tmp &= 0
212
\end{align*}
213
\end{frame}
214
215
\begin{frame}
216
\begin{align*}
217
A &= \begin{pmatrix}
218
1 & 2 & 3\\
219
2 & 8 & 14\\
220
3 & 14 & 34
221
\end{pmatrix}\\
222
L &= \begin{pmatrix}
223
1 & 0 & 0\\
224
\hlight{2} & \tocalculate{8} & 0\\
225
3 & 0 & 0
226
\end{pmatrix}\\
227
tmp &= 0
228
\end{align*}
229
\end{frame}
230
231
\begin{frame}
232
\begin{align*}
233
A &= \begin{pmatrix}
234
1 & 2 & 3\\
235
2 & 8 & 14\\
236
3 & 14 & 34
237
\end{pmatrix}\\
238
L &= \begin{pmatrix}
239
1 & 0 & 0\\
240
2 & \tocalculate{8} & 0\\
241
3 & 0 & 0
242
\end{pmatrix}\\
243
tmp &= \hlight{4}
244
\end{align*}
245
\end{frame}
246
247
\begin{frame}
248
\begin{align*}
249
A &= \begin{pmatrix}
250
1 & 2 & 3\\
251
2 & 8 & 14\\
252
3 & 14 & 34
253
\end{pmatrix}\\
254
L &= \begin{pmatrix}
255
1 & 0 & 0\\
256
2 & \tocalculate{4} & 0\\
257
3 & 0 & 0
258
\end{pmatrix}\\
259
tmp &= 0
260
\end{align*}
261
\end{frame}
262
263
264
\begin{frame}
265
\begin{align*}
266
A &= \begin{pmatrix}
267
1 & 2 & 3\\
268
2 & 8 & 14\\
269
3 & 14 & 34
270
\end{pmatrix}\\
271
L &= \begin{pmatrix}
272
1 & 0 & 0\\
273
2 & \tocalculate{2} & 0\\
274
3 & 0 & 0
275
\end{pmatrix}\\
276
tmp &= 0
277
\end{align*}
278
\end{frame}
279
\end{document}
280
281