package algorithm
This commit is contained in:
parent
44f083eb1d
commit
b380a69cfa
52
algorithmique/cours/algo.txt
Normal file
52
algorithmique/cours/algo.txt
Normal file
@ -0,0 +1,52 @@
|
||||
Algorithmique
|
||||
=============
|
||||
|
||||
Al-Kharezmi, auteur du traité "Kitab al jabr w'al-muqabala", est l'inventeur
|
||||
des manipulations algébriques (algèbre = al jabr).
|
||||
C'est Léonard de Pise, dit Fibonacci, qui emprunta le nom du célèbre
|
||||
mathématicien arabe du 9ème siècle.
|
||||
|
||||
.. glossary::
|
||||
|
||||
|
||||
algorithme
|
||||
|
||||
terme désignant une suite d'opérations constituant un schéma de calcul
|
||||
ou de résolution d'un problème.
|
||||
|
||||
.. raw:: latex
|
||||
|
||||
\begin{algorithm}
|
||||
\caption{My algorithm}\label{euclid}
|
||||
\begin{algorithmic}[1]
|
||||
\Procedure{MyProcedure}{}
|
||||
\State $\textit{stringlen} \gets \text{length of }\textit{string}$
|
||||
\State $i \gets \textit{patlen}$
|
||||
\BState \emph{top}:
|
||||
\If {$i > \textit{stringlen}$} \Return false
|
||||
\EndIf
|
||||
\State $j \gets \textit{patlen}$
|
||||
\BState \emph{loop}:
|
||||
\If {$\textit{string}(i) = \textit{path}(j)$}
|
||||
\State $j \gets j-1$.
|
||||
\State $i \gets i-1$.
|
||||
\State \textbf{goto} \emph{loop}.
|
||||
\State \textbf{close};
|
||||
\EndIf
|
||||
\State $i \gets
|
||||
i+\max(\textit{delta}_1(\textit{string}(i)),\textit{delta}_2(j))$.
|
||||
\State \textbf{goto} \emph{top}.
|
||||
\EndProcedure
|
||||
\end{algorithmic}
|
||||
\end{algorithm}
|
||||
|
||||
|
||||
|
||||
Comment rendre un algorithme lisible
|
||||
------------------------------------
|
||||
|
||||
- Le bon algorithme utilise des identifiants explicites.
|
||||
- Le bon algorithme est structuré.
|
||||
- Le bon algorithme est indenté.
|
||||
|
||||
|
@ -213,7 +213,14 @@ latex_elements = {
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
'preamble': """\usepackage{amsmath}
|
||||
\usepackage{algorithm}
|
||||
\usepackage[noend]{algpseudocode}
|
||||
\makeatletter
|
||||
\def\BState{\State\hskip-\ALG@thistlm}
|
||||
\makeatother
|
||||
|
||||
"""
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#'figure_align': 'htbp',
|
||||
|
Loading…
Reference in New Issue
Block a user