Mercurial > hg > what-is-octave
comparison FEMTEC2013/what-is-octave.tex @ 6:60233b0075a9
femtec presentation
author | Carlo de Falco <cdf@users.sourceforge.net> |
---|---|
date | Sun, 23 Jun 2013 23:37:41 +0200 |
parents | PoliMI2012/what-is-octave.tex@f8c352d9af2d |
children |
comparison
equal
deleted
inserted
replaced
5:f8c352d9af2d | 6:60233b0075a9 |
---|---|
1 \documentclass[10pt]{beamer} | |
2 | |
3 | |
4 \usetheme{Octave} | |
5 \usepackage{thumbpdf} | |
6 \usepackage{wasysym} | |
7 \usepackage{ucs} | |
8 \usepackage[utf8]{inputenc} | |
9 \usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade} | |
10 \usepackage{verbatim} | |
11 \usepackage{listings} | |
12 \usepackage{attachfile} | |
13 \lstset{ | |
14 language=C++, | |
15 keywordstyle=\bfseries\ttfamily\color[rgb]{0,0,1}, | |
16 identifierstyle=\ttfamily, | |
17 commentstyle=\color[rgb]{0.133,0.545,0.133}, | |
18 stringstyle=\ttfamily\color[rgb]{0.627,0.126,0.941}, | |
19 showstringspaces=false, | |
20 basicstyle=\scriptsize, | |
21 numberstyle=\tiny, | |
22 numbers=left, | |
23 stepnumber=1, | |
24 numbersep=10pt, | |
25 tabsize=2, | |
26 breaklines=true, | |
27 prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}}, | |
28 breakatwhitespace=false, | |
29 aboveskip={1.5\baselineskip}, | |
30 columns=fixed, | |
31 upquote=true, | |
32 extendedchars=true, | |
33 } | |
34 | |
35 %\pdfinfo | |
36 %{ | |
37 % /Title (What is Octave?) | |
38 % /Creator (TeX) | |
39 % /Author (Jordi Guti\'errez Hermoso) | |
40 %} | |
41 | |
42 | |
43 \title{GNU Octave\\ A free high-level tool for Scientific Computing} | |
44 \author[cdf, jgh]{{\bf Carlo de Falco}, Jordi Guti\'errez Hermoso} | |
45 \date{May 21, 2013 - FEMTEC - Las Vegas} | |
46 \begin{document} | |
47 | |
48 \frame[plain]{\titlepage} | |
49 | |
50 \section*{} | |
51 \begin{frame} | |
52 \frametitle{Outline} | |
53 \tableofcontents[section=2] | |
54 \end{frame} | |
55 | |
56 \AtBeginSection[] | |
57 {\frame<handout:0>{\frametitle{Outline}\tableofcontents[currentsection]}} | |
58 | |
59 \AtBeginSubsection[] | |
60 {\frame<handout:0>{\frametitle{Outline}\tableofcontents[sectionstyle=show/hide,subsectionstyle=show/shaded/hide]}} | |
61 | |
62 \newcommand<>{\highlighton}[1]{% | |
63 \alt#2{\structure{#1}}{{#1}}} | |
64 | |
65 \newcommand{\icon}[1]{\pgfimage[height=1em]{#1}} | |
66 | |
67 | |
68 | |
69 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
70 %%%%%%%%%% Content starts here %%%%%%%%%% | |
71 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
72 | |
73 \section{What is Octave?} | |
74 \subsection{Definition} | |
75 \begin{frame} | |
76 \frametitle{What is Octave?} | |
77 \begin{block}{Octave} | |
78 {\it ``A \underline{free} \only<1->{\footnote{``free'' = ``libero'' $\neq$ ``gratis''}} | |
79 numerical environment mostly compatible with \sc{Matlab}''}\\[3mm] | |
80 \begin{itemize} | |
81 \item What is compatibility? A point of much debate... | |
82 \item If it works in | |
83 {\sc{Matlab}}, it should work in Octave. | |
84 \item If it breaks it is considered a bug. | |
85 \item If it works in Octave, it can break in {\sc{Matlab}}. | |
86 \end{itemize} | |
87 \end{block} | |
88 \end{frame} | |
89 | |
90 \begin{frame} | |
91 \frametitle{Lines of code} | |
92 The stuff Octave is made of... | |
93 \pause | |
94 \begin{block}{Core} | |
95 \begin{itemize} | |
96 \item About 600,000 lines of C++ | |
97 \item About 100,000 lines of m-scripts | |
98 \item About 50,000 lines of Fortran | |
99 \end{itemize} | |
100 \end{block} | |
101 \pause | |
102 \begin{block}{Octave-Forge} | |
103 \begin{itemize} | |
104 \item About 200,000 lines of C++ | |
105 \item About 330,000 lines of m-scripts | |
106 \item About 50,000 lines of Fortran | |
107 \end{itemize} | |
108 \end{block} | |
109 \end{frame} | |
110 | |
111 | |
112 \begin{frame} | |
113 \frametitle{Features} | |
114 \begin{block}{Current features} | |
115 \begin{itemize} | |
116 \item N-d arrays, linear algebra, sparse matrices | |
117 \item Nonlinear equations | |
118 \item Partial/Ordinary/Algebraic Differential Equations, | |
119 \item Image processing, statistics, special functions | |
120 \item Many more... | |
121 \end{itemize} | |
122 \end{block} | |
123 | |
124 \begin{block}{Features in development} | |
125 \begin{itemize} | |
126 \item GUI | |
127 \item JIT compiling | |
128 \item classdef OOP | |
129 %\item Least squares spectral analysis | |
130 \end{itemize} | |
131 \end{block} | |
132 \end{frame} | |
133 | |
134 \begin{frame} | |
135 \frametitle{What does it look like} | |
136 \begin{itemize} | |
137 \only<1>{\item Primarily a CLI interface | |
138 \begin{figure} | |
139 \begin{center} | |
140 \includegraphics[height=.6\textheight]{screenshot} | |
141 \caption{CLI screenshot}\end{center} | |
142 \end{figure}} | |
143 \pause | |
144 \item Most requested feature: GUI! | |
145 \pause | |
146 \only<2->{\begin{figure} | |
147 \begin{center} | |
148 \includegraphics[height=.8\textheight]{gui_screenshot} | |
149 \caption{Qt based GUI Will ship with next release (4.0, expected 07/2013)} | |
150 \end{center} | |
151 \end{figure}} | |
152 \end{itemize} | |
153 \end{frame} | |
154 | |
155 | |
156 \subsection{History} | |
157 | |
158 \begin{frame} | |
159 \frametitle{In the beginning... } | |
160 | |
161 | |
162 \begin{itemize} | |
163 \item Companion software for chemical reactor textbook by James B. Rawlings | |
164 and John G. Ekerdt | |
165 \item John W. Eaton (hereafter, jwe) started coding in 1993 | |
166 \end{itemize} | |
167 \pause | |
168 | |
169 \begin{block}{Rawlings said...} | |
170 \begin{quote} | |
171 \center Why don't you call it ``Octave''? | |
172 \end{quote} | |
173 \end{block} | |
174 | |
175 \begin{itemize} | |
176 \item Octave refers to Octave Levenspiel, nothing to do with music ... | |
177 \end{itemize} | |
178 | |
179 \end{frame} | |
180 | |
181 \begin{frame} | |
182 \frametitle{jwe is a lone wolf...} | |
183 | |
184 jwe works almost completely alone for first four or five years. | |
185 | |
186 \pause | |
187 | |
188 \begin{block}{In the very beginning...} | |
189 \begin{itemize} | |
190 \item No mailing lists | |
191 \item No widespread announcements | |
192 \item No VCS (these were dark times) | |
193 \end{itemize} | |
194 \end{block} | |
195 \end{frame} | |
196 | |
197 \begin{frame} | |
198 \frametitle{Contributions slowly trickle in} | |
199 \begin{block}{Timeline} | |
200 \begin{itemize} | |
201 \item[1989] Planning stages | |
202 \item[1992] Development begins | |
203 \item[1993] First public announcement | |
204 \item[1994] Version 1.0 | |
205 \item[1996] Version 2.0 | |
206 \item[1998] Version 2.1 development | |
207 \item[2004] Version 2.9 in preparation for 3.0 release | |
208 \item[2007] Version 3.0 major upgrade | |
209 \item[2010] Version 3.2.4, last before using hg | |
210 \item[2011] Version 3.4.0 | |
211 \item[2012] Version 3.6.4 | |
212 \item[2012] Version 4.0 | |
213 \end{itemize} | |
214 \end{block} | |
215 \end{frame} | |
216 | |
217 \begin{frame} | |
218 \frametitle{Contributions slowly trickle in} | |
219 \begin{block}{Milestones} | |
220 \begin{itemize} | |
221 \item[1994] Most of the current basic functionality already in. | |
222 (Much was written during its first two years!) | |
223 \pause | |
224 \item[1995] Structs, {\sc{Matlab}}-style plot() command. | |
225 \item[1998] Original sparse matrix implementation | |
226 \item[2001] Octave-Forge's first commit | |
227 \item[2006] MEX interface in core | |
228 \item[2007] Implementation of handle graphics, full support for sparse matrices | |
229 \item[2009] OpenGL plotting | |
230 \item[2010] -forge option for pkg.m | |
231 \item[2011] Profiler | |
232 \item[2012] Nested functions | |
233 \pause | |
234 \item[2013] GUI, Java, 64bit indexing | |
235 \end{itemize} | |
236 \end{block} | |
237 \end{frame} | |
238 | |
239 | |
240 \subsection{Community dynamics} | |
241 | |
242 \begin{frame} | |
243 \frametitle{Web resources} | |
244 \begin{block}{Web pages} | |
245 \begin{itemize} | |
246 \item \href{http://www.octave.org/}{Octave website} | |
247 \item \href{http://octave.sf.net/}{Octave-Forge website} | |
248 \item \href{http://wiki.octave.org/}{Octave wiki} | |
249 \end{itemize} | |
250 \end{block} | |
251 | |
252 \begin{block}{Users communication} | |
253 \begin{itemize} | |
254 \item \href{https://mailman.cae.wisc.edu/listinfo/help-octave}{Octave users mailing list} | |
255 \item \href{https://lists.sourceforge.net/lists/listinfo/octave-dev}{Octave-Forge mailing list} | |
256 \item \href{http://webchat.freenode.net/?channels=octave&uio=MT1mYWxzZSYyPXRydWUmMTI9dHJ1ZQda} | |
257 {\#octave channel in Freenode} | |
258 \item \href{http://savannah.gnu.org/bugs/?group=octave}{Savannah bug tracker} | |
259 \end{itemize} | |
260 \end{block} | |
261 \pause | |
262 \begin{block}{Developers collaboration} | |
263 \begin{itemize} | |
264 \item \href{http://hg.savannah.gnu.org/hgweb/octave/shortlog}{Octave Mercurial repository} | |
265 \item \href{http://sourceforge.net/p/octave/code}{Octave-Forge Subversion repository} | |
266 \end{itemize} | |
267 \end{block} | |
268 \end{frame} | |
269 | |
270 \begin{frame} | |
271 \frametitle{Social structure} | |
272 \begin{itemize} | |
273 \item Like all free projects, every user is a potential developer. | |
274 \item 15 current Core developers (with write access to repo) | |
275 \only<1>{\begin{figure} | |
276 \centering | |
277 \includegraphics[width=.5\linewidth]{Core-Developers} | |
278 \end{figure}} | |
279 \only<2->{\item 49 currently registered 'Forge developers (38 active)} | |
280 \only<2>{\begin{figure} | |
281 \centering | |
282 \includegraphics[width=.6\linewidth]{Forge-developers} | |
283 \end{figure}} | |
284 \only<3->{\item 305 total contributors over all time\\} | |
285 {\only<3>{\includegraphics[width=.8\linewidth]{contribs1}} | |
286 \only<4>{\includegraphics[width=.8\linewidth]{contribs2}}} | |
287 \only<5->{\item How many users? Thousands? Millions?} | |
288 \end{itemize} | |
289 \end{frame} | |
290 | |
291 \begin{frame} | |
292 \frametitle{From user to developer} | |
293 This is a FAQ | |
294 \pause | |
295 \begin{block}{How can I contribute?} | |
296 \begin{itemize} | |
297 \item Code (obviously) | |
298 \item Money (pay-what-you-need) | |
299 \item Documentation (especially examples) | |
300 \item Wiki maintenance | |
301 \item Help in the mailing list | |
302 \item Bug reporting | |
303 \end{itemize} | |
304 \end{block} | |
305 \pause | |
306 % Stick around this conference if you want to learn more about how to get involved! | |
307 \end{frame} | |
308 | |
309 \begin{frame} | |
310 \frametitle{Student projects} | |
311 \begin{block}{Google Summer of Code } | |
312 \begin{itemize} | |
313 \item GSoC 2011 | |
314 \begin{itemize} | |
315 \item Daniel Kraft, Profiler | |
316 \end{itemize} | |
317 \item GSoC 2012 | |
318 \begin{itemize} | |
319 \item Jacob Dawid, Qt GUI; Max Brister, JIT; Ben Lewis, LSSA | |
320 \end{itemize} | |
321 \item GSoC 2013 | |
322 \begin{itemize} | |
323 \item 8 Slots this year! | |
324 \item JIT, ILU/ICHOL, FEM, Agora | |
325 \end{itemize} | |
326 \end{itemize} | |
327 \end{block} | |
328 \begin{block}{European Space Agency's Summer of Code in Space} | |
329 \begin{itemize} | |
330 \item SOCIS 2012 | |
331 \begin{itemize} | |
332 \item Wendy Liu, Agora Octave; Andrius Sutas, Instrument-Control | |
333 \end{itemize} | |
334 \item SOCIS 2013 | |
335 \begin{itemize} | |
336 \item Students apply! | |
337 \end{itemize} | |
338 \end{itemize} | |
339 \end{block} | |
340 \pause | |
341 % Stick around this conference if you want to learn more about how to get involved! | |
342 \end{frame} | |
343 | |
344 \section{Octave and ...} | |
345 \subsection{Octave and Octave-Forge} | |
346 | |
347 \begin{frame}[fragile]{Octave-Forge} | |
348 \begin{block}{Octave-Forge} | |
349 \href{http://octave.sf.net}{Octave Forge} Is a place for concurrently developing and distributing | |
350 extension packages for Octave. | |
351 \end{block} | |
352 \begin{itemize} | |
353 \item Each package has a \emph{maintainer} responsible for updating and releasing new versions of the package | |
354 \item Some packages are maintained by \emph{The Community} | |
355 \item Installation via an integrated \emph{package manager} | |
356 \end{itemize} | |
357 \end{frame} | |
358 | |
359 \begin{frame}[fragile]{PKG} | |
360 \begin{lstlisting}[keywordstyle=] | |
361 >> pkg install -forge miscellaneous | |
362 For information about changes from previous versions of the miscellaneous package, run: news ("miscellaneous"). | |
363 >> pkg list | |
364 Package Name | Version | Installation directory | |
365 ---------------------+---------+----------------------- | |
366 bim | 1.1.1 | ~/octave/bim-1.1.1 | |
367 fpl | 1.3.3 | ~/octave/fpl-1.3.3 | |
368 general | 1.3.1 | ~/octave/general-1.3.1 | |
369 geometry | 1.6.0 | ~/octave/geometry-1.6.0 | |
370 miscellaneous | 1.2.0 | ~/octave/miscellaneous-1.2.0 | |
371 >> pkg load miscellaneous | |
372 >> pkg list | |
373 Package Name | Version | Installation directory | |
374 ---------------------+---------+----------------------- | |
375 bim | 1.1.1 | ~/octave/bim-1.1.1 | |
376 fpl | 1.3.3 | ~/octave/fpl-1.3.3 | |
377 general | 1.3.1 | ~/octave/general-1.3.1 | |
378 geometry | 1.6.0 | ~/octave/geometry-1.6.0 | |
379 miscellaneous *| 1.2.0 | ~/octave/miscellaneous-1.2.0 | |
380 \end{lstlisting} | |
381 \end{frame} | |
382 | |
383 \begin{frame}[fragile]{PKG} | |
384 \begin{lstlisting}[keywordstyle=] | |
385 >> pkg describe bim -verbose | |
386 --- | |
387 Package name: | |
388 bim | |
389 Version: | |
390 1.1.1 | |
391 Short description: | |
392 Package for solving Diffusion Advection Reaction (DAR) Partial Differential Equations | |
393 Status: | |
394 Not loaded | |
395 --- | |
396 Provides: | |
397 Matrix assembly | |
398 bim1a_advection_diffusion | |
399 bim1a_advection_upwind | |
400 bim2a_advection_diffusion | |
401 ... | |
402 Pre-processing and Post-processing computations | |
403 bim2c_mesh_properties | |
404 ... | |
405 >> | |
406 \end{lstlisting} | |
407 \end{frame} | |
408 | |
409 | |
410 \subsection{Octave and Matlab} | |
411 \begin{frame}[fragile]{Broadcasting} | |
412 \begin{itemize} | |
413 \item Since 3.6.0, Octave automatically broadcasts arrays when using elementwise binary operators. | |
414 \item Corresponding array dimensions must either be equal or, one of them must be 1. | |
415 \item In case all dimensions are equal, ordinary element-by-element arithmetic takes place. | |
416 \item When one of the dimensions is 1, the array with that singleton dimension gets copied along | |
417 that dimension until it matches the dimension of the other array. | |
418 \end{itemize} | |
419 | |
420 \end{frame} | |
421 | |
422 \begin{frame}[fragile]{Broadcasting} | |
423 \scriptsize | |
424 \begin{lstlisting}[keywordstyle=] | |
425 x = [1 2 3; 4 5 6; 7 8 9]; | |
426 y = [10 20 30]; | |
427 x + y | |
428 11 22 33 | |
429 14 25 36 | |
430 17 28 39 | |
431 \end{lstlisting} | |
432 \begin{itemize} | |
433 \item Without broadcasting, x + y would be an error because dimensions do not agree. | |
434 \item With broadcasting it is as if the following operation were performed | |
435 \end{itemize} | |
436 \scriptsize | |
437 \begin{lstlisting}[keywordstyle=] | |
438 x = [1 2 3;4 5 6;7 8 9]; | |
439 y = [10 20 30; 10 20 30; 10 20 30]; | |
440 x + y | |
441 11 22 33 | |
442 14 25 36 | |
443 17 28 39 | |
444 \end{lstlisting} | |
445 \href{http://wiki.octave.org/FAQ#How_is_Octave_different_from_Matlab.3F}{Other notable differences with Matlab, listed in the wiki} | |
446 \end{frame} | |
447 \subsection{Octave and C++} | |
448 | |
449 \begin{frame}[fragile]{dld-functions} | |
450 Implement an Octave interpreter function in C++ | |
451 \vspace*{-4mm} | |
452 \only<1>{\lstinputlisting[language=C++,linerange=1-15,firstnumber=1]{./examples/dld.cc}} | |
453 \only<2>{\lstinputlisting[language=C++,linerange=16-30,firstnumber=last]{./examples/dld.cc}} | |
454 \only<3>{\lstinputlisting[keywordstyle=]{./examples/dld_run.txt}} | |
455 \vspace*{-4mm} | |
456 \attachfile[icon=Paperclip]{./examples/dld.cc}{source code of the example} | |
457 \end{frame} | |
458 | |
459 \begin{frame}[fragile]{liboctave} | |
460 Use Octave's Matrix/Array Classes in a C++ application | |
461 \vspace*{-4mm} | |
462 \only<1>{\lstinputlisting[language=C++]{./examples/standalone.cc}} | |
463 \only<2>{\lstinputlisting[keywordstyle=]{./examples/standalone_run.txt}} | |
464 \vspace*{-4mm} | |
465 \attachfile[icon=Paperclip]{./examples/standalone.cc}{source code of the example} | |
466 \end{frame} | |
467 | |
468 \begin{frame}[fragile]{Embedding Octave} | |
469 You can embed the Octave interpreter in your C++ application | |
470 \only<1>{\lstinputlisting[language=C++,linerange=1-17,firstnumber=1]{./examples/embedded.cc}} | |
471 \only<2>{\lstinputlisting[language=C++,linerange=18-29,firstnumber=last]{./examples/embedded.cc}} | |
472 \pause | |
473 \attachfile[icon=Paperclip]{./examples/embedded.cc}{source code of the example} | |
474 \end{frame} | |
475 | |
476 \begin{frame}[fragile]{An advanced example} | |
477 Add a new class to the Octave interpreter and work around Octave's pass-by-value semantics\\ | |
478 \attachfile[icon=Paperclip]{./examples/myobject.cc}{source code of the example (.cc)}\\ | |
479 \attachfile[icon=Paperclip]{./examples/myobject.h}{source code of the example (.h)} | |
480 \end{frame} | |
481 | |
482 | |
483 \subsection{Octave and Parallel Computing} | |
484 | |
485 \begin{frame}[fragile]{parcellfun and pararrayfun} | |
486 \scriptsize | |
487 Parcellfun is distributed in the package ``general'' it implements | |
488 parallelization via {\tt fork ()} and {\tt pipe ()} | |
489 \vspace*{-2mm} | |
490 \only<1>{\lstinputlisting[language=Octave,linerange=34-51,firstnumber=1]{./examples/parcellfun_example.m}} | |
491 \only<2>{\lstinputlisting[language=Octave,linerange=61-76,firstnumber=1]{./examples/parcellfun_example.m}} | |
492 %\vspace*{-4mm} | |
493 \attachfile[icon=Paperclip]{./examples/parcellfun_example.m}{source code of the example} | |
494 \end{frame} | |
495 | |
496 \begin{frame}[fragile]{openmpi\_ext} | |
497 The package {\tt openmpi\_ext} provides wrappers for the main MPI functions in {\tt openmpi} | |
498 | |
499 %\vspace*{-4mm} | |
500 \only<1>{\includegraphics[width=.9\linewidth]{openmpi_ext}} | |
501 \only<2>{\scalebox{.8}{\lstinputlisting[language=Octave,firstnumber=1]{./examples/Pi.m}}} | |
502 \only<3>{\scalebox{.8}{\lstinputlisting[language=Octave,firstnumber=1]{./examples/Pi_run.txt}}} | |
503 %\vspace*{-4mm} | |
504 | |
505 \attachfile[icon=Paperclip]{./examples/parcellfun_example.m}{source code of the example} | |
506 \end{frame} | |
507 | |
508 \section{PDEs and Octave} | |
509 | |
510 \subsection{First order FEM/FVM for Diffusion Advection Reaction} | |
511 \begin{frame}[fragile]{Some interesting packages} | |
512 \only<1>{\includegraphics[width=.9\linewidth]{bim}} | |
513 \only<2>{\includegraphics[width=.9\linewidth]{msh}} | |
514 \only<3>{\includegraphics[width=.9\linewidth]{fpl}} | |
515 \href{http://wiki.octave.org/Bim_package}{usage examples in the wiki} | |
516 \end{frame} | |
517 | |
518 \subsection{GeoPDEs - IGA in Octave} | |
519 | |
520 \begin{frame} | |
521 \begin{center} | |
522 \includegraphics[width=.95\linewidth]{OctConf2013-700x214} | |
523 \end{center} | |
524 \begin{itemize} | |
525 \item MOX - Politecnico di Milano 24-26 June 2013 | |
526 \item Register now! | |
527 \end{itemize} | |
528 \end{frame} | |
529 | |
530 \begin{frame} | |
531 \frametitle{How to get Octave} | |
532 \begin{itemize} | |
533 \item Source on www.octave.org | |
534 \item Binaries on octave.sourceforge.net | |
535 \item Through package managers | |
536 \item In NCLab | |
537 \item I'll be available to help with installation. | |
538 \end{itemize} | |
539 | |
540 \end{frame} | |
541 | |
542 | |
543 % | |
544 %\subsection{Octave and LifeV} | |
545 %\frame{} | |
546 % | |
547 % | |
548 | |
549 \end{document} |