Skip to content

Commit cc18eee

Browse files
Sebastien PonceSebastien Ponce
authored andcommitted
Last typo fixes on the talk (essentially mendel->mandel)
1 parent 3340dac commit cc18eee

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

talk/c++11.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
\end{block}
2727
\end{frame}
2828

29-
\subsection[constexpr]{Generalized Constant Expressions}
29+
\subsection[const]{Generalized Constant Expressions}
3030

3131
\begin{frame}[fragile]
3232
\frametitle{Generalized Constant Expressions}
@@ -184,7 +184,7 @@
184184
\end{block}
185185
\end{frame}
186186

187-
\subsection[begin]{non-member begin/end}
187+
\subsection[it]{non-member begin/end}
188188

189189
\begin{frame}[fragile]
190190
\frametitle{non-member begin and end}

talk/python.tex

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
\section{Marrying \cpp and python}
1+
\section[python]{Marrying \cpp and python}
22

33
\subsection[module]{Writing a python module}
44

55
\begin{frame}[fragile]
66
\frametitle{How to build a python module around \cpp code}
7-
\begin{block}{\cpp code : mendel.hpp}
7+
\begin{block}{\cpp code : mandel.hpp}
88
\begin{cppcode*}{}
9-
int mendel(const Complex &a);
9+
int mandel(const Complex &a);
1010
\end{cppcode*}
1111
\end{block}
1212
\end{frame}
1313

1414
\begin{frame}[fragile]
1515
\frametitle{Basic Module(1) : wrap your method}
16-
\begin{block}{mendelModule.cpp}
16+
\begin{block}{mandelModule.cpp}
1717
\begin{cppcode*}{}
1818
#include <Python.h>
19-
#include "mendel.hpp"
20-
static PyObject * mendel_wrapper(PyObject * self,
19+
#include "mandel.hpp"
20+
static PyObject * mandel_wrapper(PyObject * self,
2121
PyObject * args) {
2222
// Parse Input
2323
float r, i;
2424
if (!PyArg_ParseTuple(args, "ff", &r, &i))
2525
return NULL;
2626
// Call C++ function
27-
int result = mendel(Complex(r, i));
27+
int result = mandel(Complex(r, i));
2828
// Build returned objects
2929
return Py_BuildValue("i", result);
3030
}
@@ -34,28 +34,28 @@ \section{Marrying \cpp and python}
3434

3535
\begin{frame}[fragile]
3636
\frametitle{Basic Module(2) : create the python module}
37-
\begin{block}{mendelModule.cpp}
37+
\begin{block}{mandelModule.cpp}
3838
\begin{cppcode*}{}
3939
// declare the modules' methods
40-
static PyMethodDef MendelMethods[] = {
41-
{"mendel", mendel_wrapper, METH_VARARGS,
42-
"computes nb of iterations for mendelbrot set"},
40+
static PyMethodDef MandelMethods[] = {
41+
{"mandel", mandel_wrapper, METH_VARARGS,
42+
"computes nb of iterations for mandelbrot set"},
4343
{NULL, NULL, 0, NULL}
4444
};
4545
// initialize the module
46-
PyMODINIT_FUNC initmendel(void) {
47-
(void) Py_InitModule("mendel", MendelMethods);
46+
PyMODINIT_FUNC initmandel(void) {
47+
(void) Py_InitModule("mandel", MandelMethods);
4848
}
4949
\end{cppcode*}
5050
\end{block}
5151
\end{frame}
5252

5353
\begin{frame}[fragile]
5454
\frametitle{Basic Module(3) : use it}
55-
\begin{block}{mendel.py}
55+
\begin{block}{mandel.py}
5656
\begin{minted}[gobble=4,linenos]{python}
57-
from mendel import mendel
58-
v = mendel(0.7, 1.2)
57+
from mandel import mandel
58+
v = mandel(0.7, 1.2)
5959
\end{minted}
6060
\end{block}
6161
\end{frame}
@@ -157,25 +157,25 @@ \section{Marrying \cpp and python}
157157

158158
\begin{frame}[fragile]
159159
\frametitle{ctypes : usage example}
160-
\begin{block}{\cpp code : mendel.hpp}
160+
\begin{block}{\cpp code : mandel.hpp}
161161
\begin{cppcode*}{}
162-
int mendel(const Complex &a);
162+
int mandel(const Complex &a);
163163
\end{cppcode*}
164164
\end{block}
165-
\begin{block}{``C'' code : mendel\_cwrapper.hpp}
165+
\begin{block}{``C'' code : mandel\_cwrapper.hpp}
166166
\begin{cppcode*}{}
167167
extern "C" {
168-
int mendel(float r, float i) {
169-
return mendel(Complex(r, i));
168+
int mandel(float r, float i) {
169+
return mandel(Complex(r, i));
170170
};
171171
}
172172
\end{cppcode*}
173173
\end{block}
174-
\begin{exampleblock}{calling the mendel library}
174+
\begin{exampleblock}{calling the mandel library}
175175
\begin{minted}[gobble=4,linenos]{python}
176176
from ctypes import *
177-
libmendel = CDLL('libmendelc.so')
178-
v = libmendel.mendel(c_float(0.3), c_float(1.2))
177+
libmandel = CDLL('libmandelc.so')
178+
v = libmandel.mandel(c_float(0.3), c_float(1.2))
179179
\end{minted}
180180
\end{exampleblock}
181181
\end{frame}
@@ -185,14 +185,14 @@ \section{Marrying \cpp and python}
185185
\begin{alertblock}{Exercise Time}
186186
\begin{itemize}
187187
\item go to code/python
188-
\item look at the original python code mendel.py
188+
\item look at the original python code mandel.py
189189
\item time it
190-
\item look at the code in mendel.hpp/cpp
191-
\item look at the python module mendel\_module.cpp
192-
\item compile and modify mendel.py to use it
190+
\item look at the code in mandel.hpp/cpp
191+
\item look at the python module mandel\_module.cpp
192+
\item compile and modify mandel.py to use it
193193
\item see the gain in time
194-
\item look at the C wrapper in mendel\_cwrapper.cpp
195-
\item modify mendel.py to use libmendelc directly with ctypes
194+
\item look at the C wrapper in mandel\_cwrapper.cpp
195+
\item modify mandel.py to use libmandelc directly with ctypes
196196
\end{itemize}
197197
\end{alertblock}
198198
\end{frame}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy