diff --git a/20240627/ad-20240627.pdf b/20240627/ad-20240627.pdf index a97bce02ea9c403401802eb0778ba1db5fbb46be..624d5aa3b3f3d195b259753daef63096362fc819 100644 Binary files a/20240627/ad-20240627.pdf and b/20240627/ad-20240627.pdf differ diff --git a/20240627/ad-20240627.tex b/20240627/ad-20240627.tex index da0eaf27566a4c8559f42986436ce12e3c058661..e742ec87da1438f0a6211e299790c22864788d90 100644 --- a/20240627/ad-20240627.tex +++ b/20240627/ad-20240627.tex @@ -20,7 +20,7 @@ % Attribution-ShareAlike 3.0 Unported License along with this % document. If not, see <http://creativecommons.org/licenses/>. -% README: Einführung in C++ +% README: Einführung in C++, Datenorganisation \documentclass[10pt,t]{beamer} @@ -59,15 +59,14 @@ \item[\textbf{3}] \textbf{Langzahl-Arithmetik} \item[\textbf{4}] \textbf{Kryptographie} \item[\textbf{5}] \textbf{Datenkompression} - \item[\color{orange}\textbf{6}] \textbf{\color{orange}Einführung in C++} - \item[\color{red}\textbf{7}] \textbf{\color{red}Datenorganisation} - \item[\textbf{8}] \textbf{Hardwarenahe Algorithmen} + \item[\color{orange}\textbf{6}] \textbf{\color{orange}Einführung in C++, Datenorganisation} + \item[\color{red}\textbf{7}] \textbf{\color{red}Hardwarenahe Algorithmen} \end{itemize} \end{frame} \setcounter{section}{5} -\section{Einführung in C++} +\section{Einführung in C++, Datenorganisation} \addtocounter{subsection}{-1} \subsection{Was ist C?} @@ -701,57 +700,100 @@ \end{itemize} \end{frame} -\iffalse +\begin{frame}[fragile] + \showsubsection -\nosectionnonumber{\inserttitle} + \url{http://www.cplusplus.com/doc/tutorial/typecasting/} -\begin{frame} + \begin{itemize} + \item + \lstinline{dynamic_cast<>()}\\ + Zuweisung: Zeiger auf Basisklasse an Zeiger auf abgeleitete Klasse\\ + explizite Typumwandlung mit Prüfung, ggf.\ Exception + \smallskip + \item + \lstinline{static_cast<>()}\\ + Zuweisung: Zeiger auf Basisklasse an Zeiger auf abgeleitete Klasse\\ + explizite Typumwandlung ohne Prüfung + \smallskip + \item + \lstinline{reinterpret_cast<>()}\\ + Typumwandlung ohne Prüfung zwischen Zeigern untereinander\\ + und zwischen Zeigern und Integer-Typen + \smallskip + \item + \lstinline{const_cast<>()}\\ + "`\lstinline{const}"' ein- bzw.\ ausschalten + \end{itemize} +\end{frame} - \shownosectionnonumber +\subsection{Intelligente Zeiger} + +\begin{frame}[fragile] + \showsubsection + \textbf{Warum?} \begin{itemize} - \item[\textbf{1}] \textbf{Einführung} - \underconstruction - \hfill\makebox(0,0)[br]{\raisebox{2.25ex}{\url{https://gitlab.cvh-server.de/pgerwinski/ad.git}}} - \item[\textbf{2}] \textbf{Einführung in C++} - \begin{itemize} - \vspace*{-\smallskipamount} - \item[\dots] - \item[2.6] Namensräume - \color{medgreen} - \item[2.7] Objekte - \item[2.8] Strings - \item[2.9] Templates - \item[2.10] Exceptions - \color{red} - \item[2.11] Typ-Konversionen - \item[2.12] Container-Templates - \item[2.13] Iteratoren - \end{itemize} - \item[\textbf{3}] \textbf{Datenorganisation} -% \begin{itemize} -% \item Listen, Bäume, Hash-Tabellen, \dots -% \end{itemize} - \item[\textbf{4}] \textbf{Datenkodierung} -% \begin{itemize} -% \item Fehlererkennung und -korrektur -% \item Kompression -% \item Kryptographie -% \end{itemize} - \item[\textbf{5}] \textbf{Hardwarenahe Algorithmen} -% \begin{itemize} -% \item FFT, CORDIC, \dots -% \end{itemize} - \item[\textbf{6}] \textbf{Optimierung} -% \begin{itemize} -% \item Wegfindung, \dots -% \end{itemize} - \color{gray} - \item[\textbf{7}] \textbf{Numerik} + \item + bereits freigegebene Zeiger werden u.\,U.\ weiterhin verwendet + \item + Speicherlecks + \item + uninitialisierte Zeiger + \end{itemize} + + \medskip + + \begin{itemize} + \item + \lstinline{shared_ptr} + \item + \lstinline{weak_ptr} + \item + \lstinline{unique_ptr} + \item + \lstinline{move()} + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \showsubsection + + \textbf{Wie?} + \begin{itemize} + \item + R-Wert-Referenztypen: \lstinline{&&} + \item + \lstinline{move()}-Funktion \end{itemize} + \bigskip + + Literatur: + \begin{itemize} + \item + \url{http://thbecker.net/articles/rvalue_references/section_01.html} + \item + \url{http://www.artima.com/cppsource/rvalue.html} + \end{itemize} \end{frame} -\fi +\section{Hardwarenahe Algorithmen} + +\begin{frame} + \showsection + + \textbf{Aufgabe:} + Schreiben Sie die Sinusfunktion selbst. + + \smallskip + + \begin{itemize} + \item + Wir setzen nur die Grundrechenarten voraus. + \item + möglichst effizient + \end{itemize} +\end{frame} \end{document}