Compare commits

...

10 Commits

23 changed files with 2153 additions and 172 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
*.ascii.txt *.ascii.txt
/tipe /tipe
.directory .directory
gaussV2.png

35
Code.ml
View File

@ -22,8 +22,8 @@
* on représente un vecteur dans F_2 par un entier dont la décomposition binaire correspond aux composantes du vecteur * on représente un vecteur dans F_2 par un entier dont la décomposition binaire correspond aux composantes du vecteur
* on représente une matrice par un liste d'entier, il s'agit de la liste de ses colonnes (qui sont donc des vecteurs) * on représente une matrice par un liste d'entier, il s'agit de la liste de ses colonnes (qui sont donc des vecteurs)
*)
(*
#cd "/home/mysaa/Documents/Arbeiten/TIPE2021/";; #cd "/home/mysaa/Documents/Arbeiten/TIPE2021/";;
#load "Math.cmo";; #load "Math.cmo";;
*) *)
@ -132,6 +132,37 @@ let decoder code z =
;; ;;
(*** Décodage avec stockage des syndromes ***)
(* syndr est une fonction qui à un vecteur associe son syndrome.
En effet, la notion de syndrome dépend de quelle matrice H nous avons choisi.
Créer cette fonction ici permet de ne plus dépendre de la matrice H de code_lineaire *)
type classesLaterales = {syndr : Math.vecteur -> Math.vecteur;
erreur : Math.vecteur -> Math.vecteur;
babr : Math.vecteur Math.binabr};;
let genererClasses code =
let syndr = function z -> Math.produit code.h z in
let compacteur babr v = if BFeuille<>babr && not (appartenir code v)
then (print_int v;putWho babr (syndr v)) v false
else BFeuille in
let rec iter babr0 lst =
let svts = suivants code.n lst in
let babr = List.fold_left compacteur babr0 svts in
if babr<>BFeuille
then iter babr svts
else babr0 (* On a depasse la capacite de correction *)
in
let babr = iter (put BFeuille 0 0) [0] in
let erreur = function z -> get babr z
in {syndr=syndr;erreur=erreur;babr=babr}
;;
let decoder2 classes z :vecteur=
let s = classes.syndr z in
let e = classes.erreur s in
z lxor e;;
end;; end;;
(*************************************************************) (*************************************************************)

View File

@ -6,12 +6,24 @@ type t = {
g : Math.matrice; g : Math.matrice;
h : Math.matrice; } h : Math.matrice; }
type code_lineaire = t type code_lineaire = t
exception PasDansLeCodeException
exception IndecodableException
val antecedent : code_lineaire -> Math.vecteur -> Math.vecteur
val encoder : code_lineaire -> Math.vecteur -> Math.vecteur val encoder : code_lineaire -> Math.vecteur -> Math.vecteur
val systematiqueFromRedondance : int -> int -> matrice -> code_lineaire val systematiqueFromRedondance : int -> int -> Math.matrice -> code_lineaire
val distance_minimale : code_lineaire -> int val distance_minimale : code_lineaire -> int
val decoder : code_lineaire -> int -> Math.vecteur val decoder : code_lineaire -> Math.vecteur -> Math.vecteur
val appartenir : code_lineaire -> Math.vecteur -> bool val appartenir : code_lineaire -> Math.vecteur -> bool
type classesLaterales = {
syndr : Math.vecteur -> Math.vecteur;
erreur : Math.vecteur -> Math.vecteur;
babr : Math.vecteur Math.binabr;
}
val genererClasses : t -> classesLaterales
val decoder2 : classesLaterales -> Math.vecteur -> Math.vecteur
end end
module CCyclique : module CCyclique :

View File

@ -6,3 +6,11 @@
*.toc *.toc
*.thm *.thm
svg-inkscape/ svg-inkscape/
*_path.svg
*.bbl
*.bcf
*.blg
*.run.xml
*.nav
*.out
*.snm

View File

@ -3,6 +3,7 @@
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
\usepackage[margin=0.5in]{geometry} \usepackage[margin=0.5in]{geometry}
\usepackage{csquotes}
\usepackage[french]{babel} \usepackage[french]{babel}
\usepackage{tabularx} \usepackage{tabularx}
\usepackage{theorem} \usepackage{theorem}
@ -17,12 +18,17 @@
\usepackage{bashful} \usepackage{bashful}
\usepackage{pdfpages}
\bibliographystyle{plain}
\theorembodyfont{\upshape} \theorembodyfont{\upshape}
% Assure que les nouvelles parties commencent toujours sur une nouvelle page. % Ajoute le joli séparateur entre les parties
\let\oldpart\part \let\oldpart\part
\renewcommand\part{\clearpage\oldpart} \renewcommand\part{\hsep\oldpart}
% Un peu plus d'interligne, c'est plus lisible % Un peu plus d'interligne, c'est plus lisible
\onehalfspacing \onehalfspacing
@ -31,8 +37,9 @@
\newcommand{\hsep}{\centerline{\rule{0.8\linewidth}{.05pt}}} \newcommand{\hsep}{\centerline{\rule{0.8\linewidth}{.05pt}}}
% Racourcis % Racourcis
\newcommand{\FD}{\mathbb{F}_2\hspace{-.2em}} \newcommand{\FD}{\mathbb{F}_2}
\newcommand\fsign[3]{\item \textbf{#1} : \textit{#2} \qquad Complexité en $\mathcal{O}(#3)$\\} \newcommand\fsign[3]{\item \textbf{#1} : \textit{#2} \qquad Complexité en $\mathcal{O}(#3)$\\}
\newcommand\fsignz[2]{\item \textbf{#1} : \textit{#2}\\}
\newcommand\into{\textrightarrow\:} \newcommand\into{\textrightarrow\:}
\newtheoremstyle{break} \newtheoremstyle{break}
@ -46,22 +53,60 @@
\theoremstyle{remark} \theoremstyle{remark}
\newtheorem*{remarque}{Remarque} \newtheorem*{remarque}{Remarque}
% Compter les mots
\author{Samy AVRILLON, Victor BELLOT, Dylan THEVENET} %% Choose your 5/2
\title{Études des codes cycliques} % 1: Dylan
% 2: Samy
% 3: Victor
\newcounter{cqd}
\setcounter{cqd}{2}
\newcommand\lequel[3]{
\ifnum\value{cqd}=1
#1
\else\ifnum\value{cqd}=2
#2
\else
#3
\fi\fi
}
%\usepackage[pdfauthor={\lequel{Dylan THEVENET}{Samy AVRILLON}{Victor BELLOT}}, pdftitle={Compte rendu du TIPE 2021}, pdftex]{hyperref}
\author{\lequel{Dylan THEVENET}{Samy AVRILLON}{Victor BELLOT}}
\title{Étude des codes correcteur d'erreurs}
\begin{document} \begin{document}
\lequel{
\includepdf[pages=-,linktodoc=false]{PageDeGarde-THEVENET.pdf}
}{
\includepdf[pages=-,linktodoc=false]{PageDeGarde-AVRILLON.pdf}
}{
\includepdf[pages=-,linktodoc=false]{PageDeGarde-BELLOT.pdf}
}
\maketitle \maketitle
\hsep \hsep
\tableofcontents \section*{Introduction}
\pagebreak \lequel{
Ce document est le compte rendu de mon TIPE fait pour l'année 2021.
Dans une société où de plus en plus d'échanges se font informatiquement, il est préférable d'avoir des algorithmes de transmission qui soient robustes aux erreurs, afin que l'information reçue soit la plus conforme possible à l'information envoyée.
Dans ce TIPE nous allons donc nous attacher à présenter quelques codes correcteurs d'erreurs, en particulier les codes cycliques, et nous développerons en particulier les outils mathématiques et les théorèmes qui nous assurent que ces codes sont efficaces.
}{
Puisque des erreurs de communication peuvent avoir des conséquences désastreuses, nous devons nous assurer que les nombreux échanges informatiques effectues chaque seconde se fassent sans dégradation de l'information. C'est pourquoi j'ai étudié pour mon TIPE les codes correcteurs d'erreurs, palliant en partie la défaillance naturelle des canaux de transmission (Exemple figure~\ref{gaussEx}). L'objectif premier est de créer un ensemble de modules OCaml permettant de manipuler et d'utiliser ces codes. Une première partie va donc s'intéresser aux différents concepts mathématiques derrière la théorie des codes correcteurs, ainsi qu'aux théorèmes qui permettront d'obtenir des algorithmes efficaces. La seconde partie va décrire les algorithmes et structures de données crées et décrire succinctement leur fonctionnement.
}{
Deutsches Ipsum Dolor sit Herr Doktor consectetur Nackenheim elit, danke do Guten Tag tempor Herr Doktor ut Hochzeit et Reise magna Gemeinsamkeit Ut Deutsche Mark ad Entschuldigung veniam, Danke nostrud Lukas Podolski ullamco Gesundheit nisi Die unendliche Geschichte aliquip Angela Merkel ea danke consequat. Grimms Märchen aute Entschuldigung dolor Schnaps reprehenderit Knappwurst voluptate Gesundheit esse Entschuldigung dolore Herr Doktor fugiat Kartoffelkopf pariatur. Joachim Löw sint Flughafen cupidatat Weltschmerz proident, Audi in Bezirksschornsteinfegermeister qui Stuttgart deserunt Die Ärzte anim Deutsche Mark est Aufschnitt
}
\ifnum\value{cqd}=1\else % Dylan n'a pas besoin de première partie
\part{Contexte mathématique} \part{Contexte mathématique}
\fi
\section{Codes} \section{Codes}
\begin{definition}[Code, Codage] \begin{definition}[Code, Codage]
@ -78,15 +123,15 @@
\begin{definition}[Capacités d'un code]\label{thMinDist} \begin{definition}[Capacités d'un code]\label{thMinDist}
Étant donné un code $C$, on appelle capacité de détection $e_d$ et capacité de correction $e_c$ le plus grand nombre de bits erronés que l'on puisse détecter, respectivement corriger dans le code. Étant donné un code $C$, on appelle capacité de détection $e_d$ et capacité de correction $e_c$ le plus grand nombre de bits erronés que l'on puisse détecter, respectivement corriger dans le code.
La distance minimale d'un code est la plus grande distance entre deux mots du code. La distance minimale d'un code est la plus petite distance entre deux mots distincts du code.
$$d_C = \min_{x,y\in C\times C}\left(d(x,y)\right)$$ $$d_C = \min_{x,y\in C\times C,x\neq y}\left(d(x,y)\right)$$
\end{definition} \end{definition}
\begin{theoreme}\label{thCapacité} \begin{theoreme}\label{thCapacité}
On peut alors exprimer $e_d$ et $e_c$ en fonction de $d_C$ : On peut alors exprimer $e_d$ et $e_c$ en fonction de $d_C$ :
$$ e_c = d_C - 1 \qquad e_d = \left\lfloor\frac{d_C - 1}{2}\right\rfloor$$ $$ e_d = d_C - 1 \qquad e_c = \left\lfloor\frac{d_C - 1}{2}\right\rfloor$$
\end{theoreme} \end{theoreme}
\begin{definition}[Code Parfait] \begin{definition}[Code Parfait]
@ -111,18 +156,19 @@
\end{definition} \end{definition}
\begin{definition}[Matrice de contrôle] \begin{definition}[Matrice de contrôle]
On appelle \textbf{matrice de contrôle} n'importe quelle matrice de $\mathcal{M}_{n-k,k}(\FD)$ ayant $C$ pour noyau. On appelle \textbf{matrice de contrôle} n'importe quelle matrice de $\mathcal{M}_{n-k,n}(\FD)$ ayant $C$ pour noyau.
Tout code a au moins une matrice de contrôle. Tout code a au moins une matrice de contrôle.
\end{definition} \end{definition}
\begin{theoreme}[Calcul de distances] \begin{theoreme}[Calcul de distances]
La structure d'espace vectoriel ainsi que la définition \ref{thMinDist} nous permettent de dire que la distance minimale d'un code linéaire est le plus petit poids non nul de ses vecteurs. La structure d'espace vectoriel ainsi que la définition~\ref{thMinDist} permettent de dire que la distance minimale d'un code linéaire est le plus petit poids non nul de ses vecteurs.
On peux aussi utiliser la borne de Singleton qui assure: On peux aussi utiliser la borne de Singleton qui assure:
$$d_C \leqslant n+1-k$$ $$d_C \leqslant n+1-k$$
Enfin, on peut utiliser que la distance minimale d'un code linéaire est le nombre minimal de colonnes linéairement dépendantes de la matrice de contrôle $H$.
\end{theoreme} \end{theoreme}
Voici ici quelques concepts qui seront utiles au décodage. Voici ici quelques concepts qui seront utiles au décodage.
@ -140,30 +186,88 @@
\section{Codes cycliques} \section{Codes cycliques}
\begin{definition}[Code cyclique] \begin{definition}[Code cyclique]
Un code linéaire est dit cyclique si il est stable par décalage binaire cyclique. C'est à dire que si $w_1w_2w_2\ldots w_n$ est dans $C$ alors $w_2w_3w_4\ldots w_{n-1}w_nw_1$ appartient aussi à $C$. Un code linéaire est dit cyclique s'il est stable par décalage binaire cyclique. C'est à dire que si $w_1w_2w_3\ldots w_n$ est dans $C$ alors $w_2w_3w_4\ldots w_{n-1}w_nw_1$ appartient aussi à $C$.
On peut aussi définir le \textbf{code cyclique engendrée} par un mot $w$, qui est le plus petit espace vectoriel stable par décalage cyclique qui contienne $w$. On peut aussi définir le \textbf{code cyclique engendré} par un mot $w$, qui est le plus petit espace vectoriel stable par décalage cyclique qui contienne $w$.
\end{definition} \end{definition}
\begin{definition} \begin{definition}
On définit le mot binaire associé au polynôme $P=\displaystyle\sum_{i=0}^{n-1}{a_i\cdotp X^i}$ comme étant le mot $a_0a_1\cdots a_{n-1}$. Le polynôme réciproquement associé à un mot binaire par ce procédé est appelé \textbf{représentation polynomiale} du mot. On définit le mot binaire associé au polynôme $P=\displaystyle\sum_{i=0}^{n-1}{a_i\cdotp X^i}$ comme étant le mot $a_0a_1\cdots a_{n-1}$. Le polynôme réciproquement associé à un mot binaire par ce procédé est appelé \textbf{représentation polynomiale} du mot.
\end{definition} \end{definition}
\begin{definition}[Polynôme générateur]
Un polynôme $P$ de $\FD\,[X]$ de degré $n-k$ est dit \textbf{générateur du code cyclique $C$ de paramètre $(k,n)$} lorsque $P | X^n + 1$ et que $(\sigma^i(w))_{i\in \llbracket 0,k-1\rrbracket}$ est une base de $C$ avec $\sigma$ l'opérateur de décalage binaire cyclique est $w$ le mot associé à $P$
\end{definition}
\begin{theoreme}[Théorème fondamental des codes cycliques] \begin{theoreme}[Théorème fondamental des codes cycliques]
Tout code cyclique admet un et un seul polynôme générateur. Pour tout code cyclique $C$ de paramètres $(n,k)$, il existe un unique polynôme $g$ tel que le mot associé à $g$ engendre $C$ et que $g|X^n-1$. Ce polynôme est alors appelé \textbf{polynôme générateur du code cyclique $C$}.
On démontre que ce $g$ est alors de degré $n-k$ et que $(\sigma^i(w))_{i\in \llbracket 0,k-1\rrbracket}$ est une base de $C$ avec $\sigma$ l'opérateur de décalage binaire cyclique et $w$ le mot associé à $g$
\end{theoreme} \end{theoreme}
\begin{remarque} \begin{remarque}
Un codage naturel pour un code cyclique apparaît avec le polynôme générateur. Le codage appliqué à un mot $w$ est le mot associé au produit du polynôme générateur et du polynôme associé à $w$. Un codage naturel pour un code cyclique apparaît avec le polynôme générateur. Le codage appliqué à un mot $w$ est le mot associé au produit du polynôme générateur et du polynôme associé à $w$.
\end{remarque} \end{remarque}
\part{Algorithmes} \ifnum\value{cqd}=1
\section{Codes BCH}
\begin{definition}[Racine primitive n-ième de l'unité]
On appelle \textbf{racine primitive n-ième de lunité} un nouveau nombre $\alpha$, tel que $\alpha^n = 1$ et $\forall k \in \llbracket1,n-1\rrbracket\,\alpha^k \neq 1$.
Ce nest pas un élément de $\FD$.
On peut donc factoriser $X^n+1 = \displaystyle\prod_{k=0}^{n-1}{\left(X-\alpha^k\right)}$, mais les termes ne sont malheureusement pas dans $\FD[X]$.
\end{definition}
\begin{definition}
On définit $\FD(\alpha)$ comme le plus petit corps contenant à la fois $\FD$ et le nouvel élément $\alpha$.
Alors, $\FD(\alpha) = \left\{P(\alpha) | P\in\FD[X]\right\}$
\end{definition}
\begin{definition}
$I = \left\{P \in \FD [X] | P(\alpha) = 0\right\}$ est un idéal de $\FD[X]$ engendré par un unique polynôme unitaire $M_\alpha$
\end{definition}
\begin{theoreme}
$\FD(\alpha)$ contient $2^q$ éléments, où $q = deg(M_\alpha)$
On peut de la même manière construire des corps de taille $p^m$, où $p$ est un nombre premier et $m$ est un entier naturel non nul.
\end{theoreme}
\begin{theoreme}
Soit $P$ un polynôme à coefficients dans $\FD (\alpha)$. On a léquivalence :
$$P\text{ est un polynôme à coefficients dans } \FD \iff P(X)^2 = P(X^2)$$
\end{theoreme}
\begin{theoreme}
Soit $P(X)= \displaystyle\prod_{i\in\Sigma} (X - \alpha^i)$
Alors $P(X) \in \FD [X]$ $\iff$ $\Sigma$ est stable par multiplication par 2 modulo n.
\end{theoreme}
Doù la définition suivante :
\begin{definition}[Classes cyclotomiques]
On appelle \textbf{classe cyclotomique engendrée par $j$} lensemble $\left\{j, 2j,\cdots, 2^{s-1}j\right\}$ (où les entiers sont réduits modulo n) avec $2^s j \equiv j\mod\,n$
Cest une partie de ${0,..., n - 1}$ stable par multiplication par 2 et minimale pour linclusion.
\end{definition}
Les classes cyclotomiques permettent donc de factoriser complètement $X^n + 1 dans \FD [X]$
\begin{theoreme}[Théorème BCH]
On note $C$ le code cyclique associé à la partie stable $\Sigma = \left\{i_1 ,\cdots, i_{n-k} \right\}$ (donc de polynôme générateur $\displaystyle\prod_{i\in\Sigma}{(X-\alpha^i)}$)
Sil existe des entiers $a$ et $s$ tels que $\Sigma$ contienne $a, a + 1, \cdots, a + s$ alors la distance minimale de $C$ est supérieure ou égale à $s+1$.
\end{theoreme}
\else
\part{Réalisation informatique}
\section{Des structures de données} \section{Des structures de données}
La première étape était de créer des structures de données adéquates, c'est à dire permettant d'effectuer les calculs nécessaire à l'utilisation des codes cycliques à moindre coût (temporel). La première étape était de créer des structures de données adéquates, c'est à dire permettant d'effectuer les calculs nécessaire à l'utilisation des codes linéaires à moindre coût (temporel). Pour cela, on considère en temps constant les opérations suivantes: (\verb|lor,land,lxor,lsl,lsr,=,<,>| et les opérations internes aux structures de contrôle, comme \verb|if, for, match|...)
\subsection{Matrices et vecteurs} \subsection{Matrices et vecteurs}
Puisque nous avons affaire à des vecteurs de $\FD^n$ on peut les stocker sous forme d'entier «informatique». Nous sommes alors limités par la taille des mots du processeur, typiquement 32 bits ou 64 bits. Mais il est toujours possible de créer des entiers binaires virtuellement plus «grand». Un autre problème est qu'on ne peut pas récupérer la dimension d'un vecteur, et nous devons donc transmettre la donnée à coté. Puisque nous avons affaire à des vecteurs de $\FD^n$ on peut les stocker sous forme d'entier «informatique». Nous sommes alors limités par la taille des mots du processeur, typiquement 32 bits ou 64 bits. Mais il est toujours possible de créer des entiers binaires virtuellement plus «grand». Un autre problème est qu'on ne peut pas récupérer la dimension d'un vecteur, et nous devons donc transmettre la donnée à coté.
@ -171,13 +275,13 @@
Les matrices sont elles, des listes de vecteurs et sont donc naturellement stockées comme listes d'entiers binaires. On utilisera la structure de liste chainée native d'OCaml. Les matrices sont elles, des listes de vecteurs et sont donc naturellement stockées comme listes d'entiers binaires. On utilisera la structure de liste chainée native d'OCaml.
Nous avons ensuite codé les fonctions suivantes: (Les complexités sont données pour des matrices de $\mathcal{M}_{n,k}(\FD)$, les opérations bit à bit se faisant à temps constant, ce qui est vrai pour les entiers natifs). J'ai ensuite codé les fonctions suivantes: (Les complexités sont données pour des matrices de $\mathcal{M}_{n,k}(\FD)$, les opérations bit à bit se faisant à temps constant, ce qui est vrai pour les entiers natifs).
\begin{itemize} \begin{itemize}
\fsign{produit}{matrice \into vecteur \into vecteur}{k} Renvoie simplement le vecteur produit $Y = M \cdot X$ \fsign{produit}{matrice \into vecteur \into vecteur}{k} Renvoie simplement le vecteur produit $Y = M \cdot X$
\fsign{identite}{int \into matrice}{n} Renvoie la matrice identité de $\mathcal{M}_n(\FD)$ \fsign{identite}{int \into matrice}{n} Renvoie la matrice identité de $\mathcal{M}_n(\FD)$
\fsign{print\_matrice}{int \into matrice \into unit}{nk} Affiche la matrice dans le terminal. Il faut spécifier la dimension verticale (des vecteurs). Un exemple de valeur de sortie est donnée figure \ref{print_matriceExemple} \fsign{print\_matrice}{int \into matrice \into unit}{nk} Affiche la matrice dans le terminal. Il faut spécifier la dimension verticale (des vecteurs). Un exemple de valeur de sortie est donnée figure~\ref{print_matriceExemple}
\fsign{print\_vecteur}{int \into vecteur \into unit}{n} Affiche le vecteur dans le terminal, vu comme une matrice de $\mathcal{M}_{n,1}(\FD)$ (Exemple figure \ref{print_matriceExemple}) \fsign{print\_vecteur}{int \into vecteur \into unit}{n} Affiche le vecteur dans le terminal, vu comme une matrice de $\mathcal{M}_{n,1}(\FD)$ (Exemple figure~\ref{print_matriceExemple})
\end{itemize} \end{itemize}
\subsection{Polynômes} \subsection{Polynômes}
@ -190,7 +294,7 @@
\fsign{polmul}{polynome \into polynome \into polynome}{\min(p,q)} Effectue le produit de deux polynômes dans l'algèbre $\FD[X]$ \fsign{polmul}{polynome \into polynome \into polynome}{\min(p,q)} Effectue le produit de deux polynômes dans l'algèbre $\FD[X]$
\fsign{poldiveuc}{polynome \into polynome \into polynome $\times$ polynome}{p^2} Effectue la division euclidienne de $P$ par $Q$. \fsign{poldiveuc}{polynome \into polynome \into polynome $\times$ polynome}{p^2} Effectue la division euclidienne de $P$ par $Q$.
\fsign{print\_polynome}{polynome \into unit}{p}(Exemple figure \ref{print_matriceExemple}) \fsign{print\_polynome}{polynome \into unit}{p}(Exemple figure~\ref{print_matriceExemple})
\end{itemize} \end{itemize}
\subsection{Codes} \subsection{Codes}
@ -209,24 +313,66 @@
\section{Liste des fonctions} \section{Liste des fonctions}
Nous avons ensuite écrit des fonctions permettant de manipuler les codes linéaires: J'ai ensuite écrit des fonctions permettant de manipuler les codes linéaires:
\begin{itemize} \begin{itemize}
\fsign{encoder}{code\_lineaire \into Math.vecteur \into Math.vecteur}{} \fsign{encoder}{code\_lineaire \into vecteur \into vecteur}{k}
Encode le vecteur de $\FD^k$ suivant le code linéaire spécifié, il s'agit alors d'un simple produit avec la matrice génératrice. Encode le vecteur de $\FD^k$ suivant le code linéaire spécifié, il s'agit alors d'un simple produit avec la matrice génératrice.
\fsign{appartenir}{code_lineaire -> Math.vecteur -> bool} \fsign{appartenir}{code\_lineaire -> vecteur -> bool}{n}
Renvoie \textit{vrai} si et seulement si le vecteur appartient au code, c'est à dire, si et seulement si $HX=0$ avec $H$ la matrice de contrôle et $X$ le vecteur de $\FD^n$ en question. Renvoie \textit{vrai} si et seulement si le vecteur appartient au code, c'est à dire, si et seulement si $HX=0$ avec $H$ la matrice de contrôle et $X$ le vecteur de $\FD^n$ en question.
\fsign{distance\_minimale}{code\_lineaire -> int}{} \fsign{distance\_minimale}{code\_lineaire -> int}{n2^{d_C}}
Renvoie la distance minimale du code, utilisée pour calculer les capacités de détéction et de correction du code (voir \ref{thCapacité}) Renvoie la distance minimale du code, utilisée pour calculer les capacités de détection et de correction du code (voir théorème~\ref{thCapacité}). Le calcul s'effectue en recherchant le plus petit mot (au sens du poids) qui soit dans le code.
\fsign{decoder}{code\_lineaire \into int \into Math.vecteur}{} \fsignz{decoder}{code\_lineaire \into vecteur \into Math.vecteur}
Décode le mot de $\FD^n$ donné. L'algorithme recherche le mot le plus proche du mot reçu qui soit dans le code et à une distance inférieure à la distance de correction. Si il est impossible de décoder, renvoie une exception du type \verb|IndecodableException|.
\fsign{genererClasses}{code\_lineaire \into classes\_latérales}{n\cdot2^k}Génère les classes latérales associées au code spécifié. Parcours les vecteurs par poids croissant (d'abord ceux de poids 1, puis 2, etc…) et référence leur syndrome dans \verb|classes.rpz : vecteur -> vecteur| qui à un syndrome associe le représentant de la classe latérale de poids le plus faible. Cette fonction est enregistrée comme un arbre binaire de recherche vis à vis de l'ordre lexicographique sur $\FD^n$, permettant un stockage et une recherche en $\mathcal{O}(n)$
\fsign{decoder2}{classes\_latérales \into vecteur \into vecteur}{n} Décode le mot $Z$ de $\FD^n$ donné. L'algorithme calcule le syndrome du mot, obtient le représentant de la classe latérale associée à ce vecteur $E$. Dans l'hypothèse où le mot reçu est effectivement décodable, alors, son «erreur» $E = Z-Y$, avec $Y$ le mot du code initialement envoyé, a la même classe latérale que $Z$. Donc $Y = Z+E$, on obtient un mot du code que l'on peut décoder.
\end{itemize} \end{itemize}
\pagebreak
\part*{Annexes} \part*{Annexes}
\begin{figure}[h] \begin{figure}[h]
\begin{center} \begin{center}
\label{print_matriceExemple} \includegraphics[width=.2\linewidth]{gaussV0-llow.png}
\includesvg[scale=.3]{print_output.svg} \includegraphics[width=.2\linewidth]{gaussVH-llow.png}
\caption{Exemple d'affichage de vecteur,matrice et polynômes} \hspace{.1\linewidth}
\includegraphics[width=.2\linewidth]{gaussV0-low.png}
\includegraphics[width=.2\linewidth]{gaussVH-low.png}
\small
Le codage utilisé est un codage d'Hamming (4,7).
Les images à gauche des paires correspondent à une transmission sans aucune correction.
\end{center} \end{center}
\caption{Exemple d'application de codes correcteurs}
\label{gaussEx}
\end{figure} \end{figure}
\begin{figure}[h]
\begin{center}
\includesvg[scale=.3]{print_output_path.svg}
\caption{Exemple d'affichage de vecteur,matrice et polynômes}
\label{print_matriceExemple}
\end{center}
\end{figure}
\begin{figure}
\lstinputlisting[basicstyle=\scriptsize,language=Caml,frame=single]{../Math.mli}
\end{figure}
\begin{figure}
\lstinputlisting[basicstyle=\scriptsize,language=Caml,frame=single]{../Code.mli}
\end{figure}
\begin{figure}
\lstinputlisting[basicstyle=\scriptsize,linerange={48-59,105-128,133-134},language=Caml,frame=single]{../Math.ml}
\end{figure}
\begin{figure}
\lstinputlisting[basicstyle=\scriptsize,linerange={140-166},language=Caml,frame=single]{../Code.ml}
\end{figure}
\nocite{*}
\fi
\pagebreak
\bibliography{biblio}
\end{document} \end{document}

View File

@ -0,0 +1,460 @@
% !TeX encoding = UTF-8
\documentclass[10pt,a4paper]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[french]{babel}
\usepackage{tabularx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{calrsfs}
\usepackage{setspace}
\usepackage{stmaryrd}
\usepackage{svg}
\usepackage{bashful}
\usepackage{pdfpages}
\uselanguage{French}
\languagepath{French}
\lstset{
numbers=left,
breaklines=true,
tabsize=2,
basicstyle=\ttfamily,
}
% Racourcis
\newcommand{\FD}{\mathbb{F}_2}
\newcommand\fsign[3]{\item \textbf{#1} : \textit{#2} \hfill Complexité~en~$\mathcal{O}(#3)$\\}
\newcommand\fsignz[2]{\item \textbf{#1} : \textit{#2}\\}
\newcommand{\into}{\textrightarrow\:}
%\newtheorem{definition}{Définition}[section]
%\newtheorem{theoreme}{Théorème}[section]
%\theoremstyle{remark}
\newtheorem*{remarque}{Remarque}
\renewcommand\unskip\relax
\usetheme{Madrid}
%\hypersetup{pdfpagemode=FullScreen}
% Transition en fade-in par défaut
%\addtobeamertemplate{background canvas}{\transfade[duration=0.4]}{}
\author{Samy AVRILLON}
\title{Étude des codes correcteur d'erreurs}
\begin{document}
\begin{frame}
\maketitle
\end{frame}
\section*{Introduction}
\begin{frame}
\frametitle{Introduction}
\pause
\begin{figure}[h]
\begin{center}
\includegraphics[width=.2\linewidth]{gaussV0-llow.png}
\includegraphics[width=.2\linewidth]{gaussVH-llow.png}
\hspace{.1\linewidth}
\includegraphics[width=.2\linewidth]{gaussV0-low.png}
\includegraphics[width=.2\linewidth]{gaussVH-low.png}
\small
\end{center}
\caption{Exemple d'application de codes correcteurs}
\label{gaussEx}
\end{figure}
\end{frame}
\section*{Sommaire}
\begin{frame}
\frametitle{Sommaire}
\pause
\tableofcontents[pausesections]
\end{frame}
\addcontentsline{toc}{section}{Principe}
\begin{frame}
\frametitle{Transmission simple}
\includesvg[width=0.98\textwidth]{diagramme_transmission_simplet_path.svg}
\end{frame}
\begin{frame}
\frametitle{Transmission avec code correcteur}
\includesvg[width=0.98\textwidth]{diagramme_transmission_corrige_path.svg}
\end{frame}
\begin{frame}
\centering\Huge Contexte mathématique
\end{frame}
\section{Contexte mathématique}
\subsection{Codes}
\begin{frame}
\frametitle{Codes sur $\FD$}
\begin{definition}[Code, Codage]
\pause
Code $(n,k)$: partie de $\FD^n$
\pause
Codage: application $\FD^k \rightarrow \FD^n$ injective.
\pause
Codage systématique
\end{definition}
\pause
\begin{definition}[Distance de Hamming, Poids d'un mot]
$$ d(v,w) = \operatorname{card}(i\in \llbracket1,n\rrbracket,v_i \neq w_i)$$
\pause
$$ w(v) = d(v,0) = \operatorname{card}(i\in \llbracket1,n\rrbracket,v_i = 0)$$
\end{definition}
\end{frame}
\begin{frame}
\[
\scalebox{1.7}{
$
\begin{bmatrix}
1\\0\\0\\1\\1\\0\\1\\1\\0\\0\\1
\end{bmatrix}
\begin{bmatrix}
0\\1\\0\\1\\0\\0\\1\\1\\1\\1\\1
\end{bmatrix}
$
}\]
\end{frame}
\begin{frame}
\[
\scalebox{1.7}{
$
\begin{bmatrix}
\color{blue}1\\\color{blue}0\\0\\1\\\color{blue}1\\0\\1\\1\\\color{blue}0\\\color{blue}0\\1
\end{bmatrix}
\begin{bmatrix}
\color{blue}0\\\color{blue}1\\0\\1\\\color{blue}0\\0\\1\\1\\\color{blue}1\\\color{blue}1\\1
\end{bmatrix}
$
}\]
\end{frame}
\begin{frame}
\[
\scalebox{1.7}{
$
\begin{bmatrix}
\color{red}1\\0\\0\\\color{red}1\\\color{red}1\\0\\\color{red}1\\\color{red}1\\0\\0\\\color{red}1
\end{bmatrix}
\begin{bmatrix}
0\\\color{red}1\\0\\\color{red}1\\0\\0\\\color{red}1\\\color{red}1\\\color{red}1\\\color{red}1\\\color{red}1
\end{bmatrix}
$
}\]
\end{frame}
\begin{frame}
\frametitle{Propriétés des codes}
\begin{definition}
\pause
Capacité de détection $e_d$ et capacité de correction $e_c$.
\pause
La distance minimale.
$$d_C = \min_{x,y\in C\times C,x\neq y}\left(d(x,y)\right)$$
\end{definition}
\end{frame}
\begin{frame}
\frametitle{Distance minimale}
\begin{theorem}[Distance minimale]
\pause
$$ e_d = d_C - 1 \qquad\pause e_c = \left\lfloor\frac{d_C - 1}{2}\right\rfloor$$
\end{theorem}
\end{frame}
\begin{frame}
\frametitle{Code parfait}
\begin{definition}[Code Parfait]
\pause
Jamais d'ambigüité sur la façon de décoder un mot érroné.
\end{definition}
\pause
\textit{Exemple: Code de répétition (n,1)}
$$C = \left\{\begin{bmatrix}
0\\\vdots\\0
\end{bmatrix},
\begin{bmatrix}
1\\\vdots\\1
\end{bmatrix}\right\}$$
\pause
$$d_C = n\pause,e_d = n-1\pause,e_c = \left\lfloor \frac{n-1}{2} \right\rfloor$$
\pause\centering
parfait \underline{si et seulement si} $n$ impair
\end{frame}
\subsection{Codes linéaires}
\begin{frame}
\frametitle{Codes linéaire}
\begin{definition}
\pause
$C$ sous-espace vectoriel de $\FD^n$
\pause
Codage linéaire
\end{definition}
\end{frame}
\begin{frame}
\frametitle{Matrices du code linéaire}
\begin{definition}[Matrice génératrice]
\pause
$$G \in \mathcal{M}_{n,k}(\FD)$$
$$Im(G) = C$$
\end{definition}
\pause
\begin{definition}[Matrice de contrôle]
$$H \in \mathcal{M}_{n-k,n}(\FD)$$
$$H\cdot X = 0 \quad\text{\underline{ssi}}\quad X \in C$$
\end{definition}
\end{frame}
\begin{frame}
\frametitle{Calcul de distances}
\begin{theorem}[Calcul de distances]
\pause
$$d_C = \min_{X\in C, X\neq 0}(w(X))$$
\pause
Borne de Singleton:
$$d_C \leqslant n+1-k$$
\end{theorem}
\pause
\begin{definition}[Erreur et syndrome]
\pause
$$E = Z' - Y'$$
\pause
$$S(Z) = H \cdot Z$$
\pause
$$S(E) = S(Z)$$
\end{definition}
\end{frame}
\subsection{Codes cycliques}
\begin{frame}
\frametitle{Codes cycliques}
\begin{definition}[Code cyclique]
\pause
$w_1w_2w_3\ldots w_n \in C \implies w_2w_3w_4\ldots w_{n-1}w_nw_1 \in C$.
\end{definition}
\pause
\begin{definition}[Mot binaire associé à un polynôme]
\pause
\[
\begin{bmatrix}
1\\0\\0\\1\\1\\0\\1\\1\\0\\0\\1
\end{bmatrix}\mapsto 1 + X^3+X^4+X^6 + X^7 + X^{10} \]
\end{definition}
\end{frame}
\begin{frame}
\frametitle{Des polynômes bien utiles}
\begin{theorem}[Théorème fondamental des codes cycliques]
\pause
\underline{Unique} polynôme $g$ tel que le mot associé à $g$ engendre $C$ et $g|X^n-1$.
\vspace{0.4cm}
$g$ de degré $n-k$
\vspace{0.4cm}
$(\sigma^i(w))_{i\in \llbracket 0,k-1\rrbracket}$ base de $C$
\vspace{0.4cm}
\pause
Codage naturel associé au polynôme.
\end{theorem}
\end{frame}
\section{Réalisation informatique}
\begin{frame}
\centering\Huge Réalisation Informatique
\end{frame}
\subsection{Des structures de données}
\begin{frame}
\frametitle{Créer les structures}
\pause
Temps constant :
\begin{itemize}
\item\texttt{lor,land,lxor,lsl,lsr,=,<,>}
\item\texttt{if, for, match, \&\&}
\end{itemize}
\end{frame}
\subsubsection{Matrices et vecteurs}
\begin{frame}
\frametitle{Matrices et vecteurs}
\pause
\centering\texttt{type vecteur = int}
\centering\texttt{type matrice = int list}
\pause
\begin{itemize}
\item Calculs binaires rapides
\pause
\item Limitation par l'architecture
\pause
\item Possibilité de dépasser virtuellement.
\end{itemize}
\pause
\underline{Fonctions dévelopées: }
\pause
\begin{itemize}
\fsign{produit}{matrice \into vecteur \into vecteur}{k}
\pause
\fsign{identite}{int \into matrice}{n}
\pause
\fsign{print\_matrice}{int \into matrice \into unit}{nk}
\fsign{print\_vecteur}{int \into vecteur \into unit}{n}
\end{itemize}
\end{frame}
\subsubsection{Polynômes}
\begin{frame}
\frametitle{Polynômes}
\pause
\centering\texttt{type polynome = int}
\pause
\vspace{0.4cm}
Mêmes remarques.
\pause
\vspace{0.5cm}
\underline{Fonctions dévelopées: }
\pause
\begin{itemize}
\fsign{degre}{polynome \into int}{p}
\pause
\fsign{polmul}{polynome \into polynome \into polynome}{\min(p,q)}
\pause
\fsign{poldiveuc}{polynome \into polynome \into polynome $\times$ polynome}{p^2}
\pause
\fsign{print\_polynome}{polynome \into unit}{p}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Fonctions d'affichages}
\begin{figure}[h]
\begin{center}
\includesvg[scale=.3]{print_output_path.svg}
\caption{Exemple d'affichage de vecteur,matrice et polynômes}
\end{center}
\end{figure}
\end{frame}
\subsubsection{Codes}
\begin{frame}
\frametitle{Structures des codes}
\pause
\texttt{type code\_lineaire = \{\\\hspace{0.4cm}
k : int;\\\hspace{0.4cm}
n : int;\\\hspace{0.4cm}
g : Math.matrice;\\\hspace{0.4cm}
h : Math.matrice; \\\}
}
\pause
\vspace{0.4cm}
\texttt{type code\_cyclique = \{\\\hspace{0.4cm}
k : int;\\\hspace{0.4cm}
n : int;\\\hspace{0.4cm}
pol : Math.polynome;\\ \}
}
\pause
\vspace{0.4cm}
\begin{itemize}
\fsign{systematiqueFromRedondance}{int \into int \into matrice \into code\_lineaire}{k}
\end{itemize}
\end{frame}
\subsection{Liste des fonctions}
\begin{frame}
\frametitle{Fonctions de codage/décodage}
\pause
\begin{itemize}
\fsign{encoder}{code\_lineaire \into vecteur \into vecteur}{k}
\pause
\fsign{appartenir}{code\_lineaire -> vecteur -> bool}{n}
\pause
\fsign{distance\_minimale}{code\_lineaire -> int}{n2^{d_C}}
\pause
\fsignz{decoder}{code\_lineaire \into vecteur \into Math.vecteur}
\pause
\fsign{genererClasses}{code\_lineaire \into classes\_latérales}{n\cdot2^k}
\pause
\fsign{decoder2}{classes\_latérales \into vecteur \into vecteur}{n}
\end{itemize}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\frametitle{Annexes}
\end{frame}
\begin{frame}
\lstinputlisting[basicstyle=\scriptsize,breaklines=true,language=Caml,frame=single,linerange={1-26}]{../Math.mli}
\end{frame}
\begin{frame}
\lstinputlisting[basicstyle=\scriptsize,breaklines=true,language=Caml,frame=single,linerange={29-34}]{../Math.mli}
\end{frame}
\begin{frame}
\lstinputlisting[basicstyle=\scriptsize,breaklines=true,language=Caml,frame=single,linerange={1-27}]{../Code.mli}
\end{frame}
\begin{frame}
\lstinputlisting[basicstyle=\scriptsize,breaklines=true,language=Caml,frame=single,linerange={29-39}]{../Code.mli}
\end{frame}
\begin{frame}
\lstinputlisting[basicstyle=\scriptsize,breaklines=true,linerange={48-59},language=Caml,frame=single]{../Math.ml}
\end{frame}
\begin{frame}
\lstinputlisting[basicstyle=\scriptsize,breaklines=true,linerange={105-128},language=Caml,frame=single]{../Math.ml}
\end{frame}
\begin{frame}
\lstinputlisting[basicstyle=\scriptsize,breaklines=true,linerange={140-166},language=Caml,frame=single]{../Code.ml}
\end{frame}
\end{document}

23
CompteRendu/Makefile Normal file
View File

@ -0,0 +1,23 @@
all:
$(MAKE) dylan
cp CompteRendu.pdf CompteRendu-dylan.pdf
$(MAKE) samy
cp CompteRendu.pdf CompteRendu-samy.pdf
$(MAKE) victor
cp CompteRendu.pdf CompteRendu-victor.pdf
dylan:
sed 's/\\setcounter{cqd}{[0-9]}/\\setcounter{cqd}{1}/' -i CompteRendu.tex
$(MAKE) build
samy: print_output_path.svg
sed 's/\\setcounter{cqd}{[0-9]}/\\setcounter{cqd}{2}/' -i CompteRendu.tex
$(MAKE) build
victor: print_output_path.svg
sed 's/\\setcounter{cqd}{[0-9]}/\\setcounter{cqd}{3}/' -i CompteRendu.tex
$(MAKE) build
print_output_path.svg:
inkscape --export-plain-svg=print_output_path.svg --export-text-to-path print_output.svg
build:
pdflatex -synctex=1 -shell-escape -interaction=nonstopmode "CompteRendu".tex

33
CompteRendu/biblio.bib Normal file
View File

@ -0,0 +1,33 @@
@book{PAintro,
author = {Pierre Abbrugiatti},
title = {Introduction aux codes correcteurs derreurs},
date = {23 janvier 2006},
year = 2006,
}
@book{AB001,
author = {Alexis Bonnecaze},
title = {Introduction à lalgèbre pour les Codes cycliques},
date = {2006-2007},
year = {2006-2007}
}
@online{Wiki,
author = {Les contributeurs},
title = {Codes correcteurs},
date = {2008-2019},
url = {https://fr.wikipedia.org/wiki/Codes_correcteurs},
}
@online{3b1bH,
author = {Grand Sanderson},
title = {Hamming codes and error detection},
date = {4 septembre 2020},
url = {http://youtube.com/watch?v=X8jsijhllIa},
year = {2020}
}
@misc{m89lm1ea,
author = {E.N.S. de LYON},
title = {Première composition de mathématique },
date = {1989},
year = 1989,
}

View File

@ -0,0 +1,374 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="207.54962mm"
height="85.49041mm"
viewBox="0 0 207.54962 85.49041"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="diagramme_transmission_corrige.svg">
<defs
id="defs2">
<marker
inkscape:stockid="Arrow1Send"
orient="auto"
refY="0"
refX="0"
id="Arrow1Send"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path855"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#1909ff;fill-opacity:1;fill-rule:evenodd;stroke:#1909ff;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.2,0,0,-0.2,-1.2,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible"
id="marker5484"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Lend">
<path
transform="matrix(-0.8,0,0,-0.8,-10,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path5482"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path843"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend-3"
style="overflow:visible"
inkscape:isstock="true"
inkscape:collect="always">
<path
inkscape:connector-curvature="0"
id="path843-5"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend-3-9"
style="overflow:visible"
inkscape:isstock="true">
<path
inkscape:connector-curvature="0"
id="path843-5-1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Send"
orient="auto"
refY="0"
refX="0"
id="Arrow1Send-7"
style="overflow:visible"
inkscape:isstock="true">
<path
inkscape:connector-curvature="0"
id="path855-0"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#1909ff;fill-opacity:1;fill-rule:evenodd;stroke:#1909ff;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.2,0,0,-0.2,-1.2,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Send"
orient="auto"
refY="0"
refX="0"
id="Arrow1Send-7-3"
style="overflow:visible"
inkscape:isstock="true">
<path
inkscape:connector-curvature="0"
id="path855-0-6"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#1909ff;fill-opacity:1;fill-rule:evenodd;stroke:#1909ff;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.2,0,0,-0.2,-1.2,0)" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="265.20904"
inkscape:cy="153.84876"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1366"
inkscape:window-height="703"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-0.1889881,-4.646442)">
<rect
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.60300004;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817"
width="31.56101"
height="19.087799"
x="7.1015"
y="9.1107006" />
<rect
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.60300004;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-3"
width="31.561012"
height="19.087799"
x="7.1015"
y="65.017113" />
<rect
style="opacity:1;fill:#efff07;fill-opacity:1;stroke:none;stroke-width:1.8350811;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect836"
width="207.54962"
height="2.4568453"
x="0.1889881"
y="43" />
<rect
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.60300004;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-6"
width="31.561001"
height="19.087799"
x="83.851517"
y="9.1107006" />
<rect
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.60300004;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-7"
width="31.561012"
height="19.087799"
x="83.851517"
y="65.017113" />
<rect
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.60300004;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-5"
width="31.561012"
height="19.087799"
x="151.89478"
y="65.016701" />
<path
style="fill:none;stroke:#000000;stroke-width:0.57855141;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend-3)"
d="m 99.51534,29.039903 67.37527,34.390145"
id="path838-6"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
sodipodi:type="star"
style="opacity:1;fill:#ffc407;fill-opacity:1;stroke:none;stroke-width:0.46499997;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path1280-2"
sodipodi:sides="16"
sodipodi:cx="99.785713"
sodipodi:cy="44.322914"
sodipodi:r1="6.6576414"
sodipodi:r2="3.3288207"
sodipodi:arg1="0.96704699"
sodipodi:arg2="1.1633965"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 103.56548,49.80357 -2.46081,-2.424285 0.0757,3.453547 -1.345752,-3.181457 -1.251648,3.219643 -0.02582,-3.45428 -2.388476,2.495577 1.298038,-3.201222 -3.16168,1.391584 2.424285,-2.460807 -3.453548,0.07573 3.181457,-1.345754 -3.219643,-1.251648 3.454281,-0.02582 -2.495578,-2.388476 3.201222,1.298038 -1.391583,-3.16168 2.460806,2.424284 -0.07573,-3.453547 1.345755,3.181457 1.251651,-3.219643 0.0258,3.454281 2.38848,-2.495578 -1.29804,3.201222 3.16168,-1.391583 -2.42429,2.460806 3.45355,-0.07573 -3.18146,1.345755 3.21965,1.251647 -3.45428,0.02582 2.49557,2.388475 -3.20122,-1.298037 z"
transform="rotate(20.694563,115.05958,127.97772)" />
<path
style="fill:none;stroke:#1909ff;stroke-width:2.48587942;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Send)"
d="M 38.931548,18.242559 H 78.251484"
id="path5474"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#1909ff;stroke-width:2.47601247;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Send-7)"
d="M 82.388078,75.22247 H 43.379661"
id="path5474-9"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#1909ff;stroke-width:2.26204824;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Send-7-3)"
d="M 150.46669,75.505951 H 117.90878"
id="path5474-9-0"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:9.35350132px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#2609ff;fill-opacity:1;stroke:none;stroke-width:0.23383752"
x="52.158733"
y="10.745277"
id="text8270"
transform="scale(0.90747576,1.1019578)"><tspan
sodipodi:role="line"
id="tspan8268"
x="52.158733"
y="10.745277"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Linux Libertine Display O';-inkscape-font-specification:'Linux Libertine Display O';fill:#2609ff;fill-opacity:1;stroke-width:0.23383752">Codage</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:8.8114109px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#2609ff;fill-opacity:1;stroke:none;stroke-width:0.22028522"
x="136.60857"
y="72.858261"
id="text8270-6"
transform="scale(0.85488207,1.169752)"><tspan
sodipodi:role="line"
id="tspan8268-2"
x="136.60857"
y="72.858261"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Linux Libertine Display O';-inkscape-font-specification:'Linux Libertine Display O';fill:#2609ff;fill-opacity:1;stroke-width:0.22028522">Correction</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:8.44891262px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#2609ff;fill-opacity:1;stroke:none;stroke-width:0.21122278"
x="51.402302"
y="77.988083"
id="text8270-61"
transform="scale(0.88827728,1.1257746)"><tspan
sodipodi:role="line"
x="51.402302"
y="77.988083"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Linux Libertine Display O';-inkscape-font-specification:'Linux Libertine Display O';fill:#2609ff;fill-opacity:1;stroke-width:0.21122278"
id="tspan8298">Décodage</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="18.16637"
y="23.195908"
id="text8304"><tspan
sodipodi:role="line"
id="tspan8302"
x="18.16637"
y="23.195908"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.8166666px;font-family:'Linux Libertine Mono O';-inkscape-font-specification:'Linux Libertine Mono O';stroke-width:0.26458332">X</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:'Linux Libertine Display O';-inkscape-font-specification:'Linux Libertine Display O';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="94.842758"
y="23.195908"
id="text8308"><tspan
sodipodi:role="line"
x="94.842758"
y="23.195908"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.8166666px;font-family:'Linux Libertine Mono O';-inkscape-font-specification:'Linux Libertine Mono O';stroke-width:0.26458332"
id="tspan8310">Y</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="18.166372"
y="79.102318"
id="text8304-7"><tspan
sodipodi:role="line"
id="tspan8302-7"
x="18.166372"
y="79.102318"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.8166666px;font-family:'Linux Libertine Mono O';-inkscape-font-specification:'Linux Libertine Mono O';stroke-width:0.26458332">X</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:'Linux Libertine Display O';-inkscape-font-specification:'Linux Libertine Display O';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="94.842766"
y="79.102318"
id="text8308-9"><tspan
sodipodi:role="line"
x="94.842766"
y="79.102318"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.8166666px;font-family:'Linux Libertine Mono O';-inkscape-font-specification:'Linux Libertine Mono O';stroke-width:0.26458332"
id="tspan8310-4">Y</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:'Linux Libertine Display O';-inkscape-font-specification:'Linux Libertine Display O';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="163.08952"
y="79.138947"
id="text8308-9-0"><tspan
sodipodi:role="line"
x="163.08952"
y="79.138947"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.8166666px;font-family:'Linux Libertine Mono O';-inkscape-font-specification:'Linux Libertine Mono O';stroke-width:0.26458332"
id="tspan8378">Z</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="25.117966"
y="76.780655"
id="text9038"><tspan
sodipodi:role="line"
id="tspan9036"
x="25.117966"
y="76.780655"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Linux Libertine Mono O';-inkscape-font-specification:'Linux Libertine Mono O';stroke-width:0.26458332">'</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="101.90678"
y="76.885681"
id="text9038-8"><tspan
sodipodi:role="line"
id="tspan9036-2"
x="101.90678"
y="76.885681"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Linux Libertine Mono O';-inkscape-font-specification:'Linux Libertine Mono O';stroke-width:0.26458332">'</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="168.99142"
y="76.618408"
id="text9038-1"><tspan
sodipodi:role="line"
id="tspan9036-1"
x="168.99142"
y="76.618408"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Linux Libertine Mono O';-inkscape-font-specification:'Linux Libertine Mono O';stroke-width:0.26458332">'</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,244 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="207.54962mm"
height="85.49041mm"
viewBox="0 0 207.54962 85.49041"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="diagramme_transmission_simplet.svg">
<defs
id="defs2">
<marker
inkscape:stockid="Arrow1Send"
orient="auto"
refY="0"
refX="0"
id="Arrow1Send"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path855"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#1909ff;fill-opacity:1;fill-rule:evenodd;stroke:#1909ff;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.2,0,0,-0.2,-1.2,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible"
id="marker5484"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Lend">
<path
transform="matrix(-0.8,0,0,-0.8,-10,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path5482"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path843"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend-3-9"
style="overflow:visible"
inkscape:isstock="true">
<path
inkscape:connector-curvature="0"
id="path843-5-1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Send"
orient="auto"
refY="0"
refX="0"
id="Arrow1Send-7"
style="overflow:visible"
inkscape:isstock="true">
<path
inkscape:connector-curvature="0"
id="path855-0"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#1909ff;fill-opacity:1;fill-rule:evenodd;stroke:#1909ff;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.2,0,0,-0.2,-1.2,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Send"
orient="auto"
refY="0"
refX="0"
id="Arrow1Send-7-3"
style="overflow:visible"
inkscape:isstock="true">
<path
inkscape:connector-curvature="0"
id="path855-0-6"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#1909ff;fill-opacity:1;fill-rule:evenodd;stroke:#1909ff;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.2,0,0,-0.2,-1.2,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend-3-3"
style="overflow:visible"
inkscape:isstock="true"
inkscape:collect="always">
<path
inkscape:connector-curvature="0"
id="path843-5-6"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="266.21919"
inkscape:cy="103.30859"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1366"
inkscape:window-height="703"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-0.1889881,-4.646442)">
<rect
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.60300004;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817"
width="31.56101"
height="19.087799"
x="7.1015"
y="9.1107006" />
<rect
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.60300004;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-3"
width="31.561012"
height="19.087799"
x="7.1015"
y="65.017113" />
<rect
style="opacity:1;fill:#efff07;fill-opacity:1;stroke:none;stroke-width:1.8350811;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect836"
width="207.54962"
height="2.4568453"
x="0.1889881"
y="43" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="18.16637"
y="23.195908"
id="text8304"><tspan
sodipodi:role="line"
id="tspan8302"
x="18.16637"
y="23.195908"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.8166666px;font-family:'Linux Libertine Mono O';-inkscape-font-specification:'Linux Libertine Mono O';stroke-width:0.26458332">X</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="18.166372"
y="79.102318"
id="text8304-7"><tspan
sodipodi:role="line"
id="tspan8302-7"
x="18.166372"
y="79.102318"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.8166666px;font-family:'Linux Libertine Mono O';-inkscape-font-specification:'Linux Libertine Mono O';stroke-width:0.26458332">X</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="25.117966"
y="76.780655"
id="text9038"><tspan
sodipodi:role="line"
id="tspan9036"
x="25.117966"
y="76.780655"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Linux Libertine Mono O';-inkscape-font-specification:'Linux Libertine Mono O';stroke-width:0.26458332">'</tspan></text>
<path
style="fill:none;stroke:#000000;stroke-width:0.57855141;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend-3-3)"
d="m 21.926248,27.91401 0.290618,37.330111"
id="path838-6-7"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
sodipodi:type="star"
style="opacity:1;fill:#ffc407;fill-opacity:1;stroke:none;stroke-width:0.46499997;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path1280-2"
sodipodi:sides="16"
sodipodi:cx="99.785713"
sodipodi:cy="44.322914"
sodipodi:r1="6.6576414"
sodipodi:r2="3.3288207"
sodipodi:arg1="0.96704699"
sodipodi:arg2="1.1633965"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 103.56548,49.80357 -2.46081,-2.424285 0.0757,3.453547 -1.345752,-3.181457 -1.251648,3.219643 -0.02582,-3.45428 -2.388476,2.495577 1.298038,-3.201222 -3.16168,1.391584 2.424285,-2.460807 -3.453548,0.07573 3.181457,-1.345754 -3.219643,-1.251648 3.454281,-0.02582 -2.495578,-2.388476 3.201222,1.298038 -1.391583,-3.16168 2.460806,2.424284 -0.07573,-3.453547 1.345755,3.181457 1.251651,-3.219643 0.0258,3.454281 2.38848,-2.495578 -1.29804,3.201222 3.16168,-1.391583 -2.42429,2.460806 3.45355,-0.07573 -3.18146,1.345755 3.21965,1.251647 -3.45428,0.02582 2.49557,2.388475 -3.20122,-1.298037 z"
transform="rotate(20.694563,60.937501,-168.44616)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
CompteRendu/gaussV0-low.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
CompteRendu/gaussVH-low.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

View File

@ -25,9 +25,9 @@
borderopacity="1.0" borderopacity="1.0"
inkscape:pageopacity="0.0" inkscape:pageopacity="0.0"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:zoom="1.979899" inkscape:zoom="0.35"
inkscape:cx="10.04794" inkscape:cx="-109.9148"
inkscape:cy="216.89603" inkscape:cy="-17.849234"
inkscape:document-units="mm" inkscape:document-units="mm"
inkscape:current-layer="layer1" inkscape:current-layer="layer1"
showgrid="false" showgrid="false"
@ -48,7 +48,7 @@
<dc:format>image/svg+xml</dc:format> <dc:format>image/svg+xml</dc:format>
<dc:type <dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title /> <dc:title></dc:title>
</cc:Work> </cc:Work>
</rdf:RDF> </rdf:RDF>
</metadata> </metadata>
@ -58,120 +58,178 @@
id="layer1" id="layer1"
transform="translate(-0.53453934,-1.3999026)"> transform="translate(-0.53453934,-1.3999026)">
<rect <rect
style="opacity:1;fill:#686868;fill-opacity:1;stroke:none;stroke-width:1.76637125;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" style="opacity:1;fill:#686868;fill-opacity:1;stroke:none;stroke-width:3.70219326;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect827" id="rect827"
width="66.282837" width="256.40485"
height="117.06406" height="132.93906"
x="0.53453934" x="-1.7333201"
y="1.3999026" /> y="-5.4036703" />
<g <text
aria-label="┌011┐ xml:space="preserve"
│101│ style="font-style:normal;font-weight:normal;font-size:13.04045963px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.32601148"
│111│ x="2.3512421"
│100│ y="89.607773"
└001┘" id="text841"><tspan
style="font-style:normal;font-weight:normal;font-size:17.08358955px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" sodipodi:role="line"
id="text12"> id="tspan839"
<path x="2.3512421"
d="m 12.454936,16.851757 h 5.980925 v 1.434754 h -4.646269 v 9.576153 h -1.334656 z" y="89.607773"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.32601148">X^1 + X^2 + X^3</tspan><tspan
id="path822" /> sodipodi:role="line"
<path x="2.3512421"
d="m 23.399111,23.683524 q -2.001983,0 -3.011317,-1.634953 -1.017674,-1.643294 -1.017674,-4.821442 0,-3.18649 1.017674,-4.829785 1.009334,-1.634953 3.011317,-1.634953 2.001983,0 3.019658,1.634953 0.500495,0.800794 0.759085,2.001983 0.258589,1.192849 0.258589,2.827802 0,1.634953 -0.258589,2.827801 -0.25859,1.192848 -0.759085,1.993641 -1.026017,1.634953 -3.019658,1.634953 z m 0,-1.334655 q 1.192848,0 1.768418,-1.267923 0.57557,-1.267922 0.57557,-3.853817 0,-2.602578 -0.57557,-3.853818 -0.57557,-1.276264 -1.768418,-1.276264 -1.176165,0 -1.751735,1.267922 -0.291956,0.62562 -0.442105,1.576562 -0.141807,0.942601 -0.141807,2.285598 0,2.610919 0.583912,3.853817 0.583911,1.267923 1.751735,1.267923 z m 0.01668,-2.210523 q -0.25859,0 -0.408738,-0.358689 -0.150149,-0.358689 -0.250248,-0.842501 -0.08342,-0.392055 -0.141807,-0.925917 -0.05005,-0.542204 -0.05005,-0.825818 0,-0.200199 0.03337,-0.717378 0.03337,-0.517179 0.133465,-0.975966 0.241906,-1.192849 0.650645,-1.192849 0.233564,0 0.392055,0.316981 0.166832,0.316981 0.283614,0.900892 0.08342,0.408739 0.133465,0.925918 0.05005,0.517179 0.05005,0.809134 0,0.166832 -0.03337,0.658987 -0.02502,0.492154 -0.108441,1.009333 -0.20854,1.217873 -0.684011,1.217873 z" y="105.90835"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.32601148"
id="path824" /> id="tspan843">1 + X^2</tspan><tspan
<path sodipodi:role="line"
d="m 30.789765,22.023547 h 2.619262 v -8.93385 l -1.9853,2.260572 -0.917576,-1.117774 2.886192,-3.244881 h 1.685003 v 11.035933 h 2.585895 v 1.418071 h -6.873476 z" x="2.3512421"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" y="122.20892"
id="path826" /> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.32601148"
<path id="tspan845">1 + X^1 + X^4 + X^6 + X^9</tspan></text>
d="m 41.066611,22.023547 h 2.619262 v -8.93385 l -1.9853,2.260572 -0.917576,-1.117774 2.886192,-3.244881 h 1.685003 v 11.035933 h 2.585895 v 1.418071 h -6.873476 z" <flowRoot
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" xml:space="preserve"
id="path828" /> id="flowRoot847"
<path style="fill:black;fill-opacity:1;stroke:none;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;letter-spacing:0px;word-spacing:0px"><flowRegion
d="m 53.562324,18.286511 h -4.637928 v -1.434754 h 5.972583 v 11.010907 h -1.334655 z" id="flowRegion849"><rect
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" id="rect851"
id="path830" /> width="137.14285"
<path height="50"
d="m 12.454936,28.529992 h 1.334656 v 20.687159 h -1.334656 z" x="291.42856"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" y="16.732544" /></flowRegion><flowPara
id="path832" /> id="flowPara853"></flowPara></flowRoot> <text
<path xml:space="preserve"
d="m 20.512918,43.378034 h 2.619262 v -8.93385 l -1.9853,2.260572 -0.917576,-1.117774 2.886192,-3.244881 h 1.685003 v 11.035933 h 2.585895 v 1.418071 h -6.873476 z" style="font-style:normal;font-weight:normal;font-size:13.04045963px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.32601148"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" x="151.86282"
id="path834" /> y="13.561927"
<path id="text841-2"><tspan
d="m 33.675958,45.038011 q -2.001983,0 -3.011317,-1.634953 -1.017674,-1.643294 -1.017674,-4.821442 0,-3.18649 1.017674,-4.829785 1.009334,-1.634953 3.011317,-1.634953 2.001983,0 3.019658,1.634953 0.500495,0.800793 0.759085,2.001983 0.258589,1.192849 0.258589,2.827802 0,1.634952 -0.258589,2.827801 -0.25859,1.192848 -0.759085,1.993641 -1.026017,1.634953 -3.019658,1.634953 z m 0,-1.334655 q 1.192848,0 1.768418,-1.267923 0.57557,-1.267923 0.57557,-3.853817 0,-2.602579 -0.57557,-3.853818 -0.57557,-1.276264 -1.768418,-1.276264 -1.176165,0 -1.751736,1.267922 -0.291955,0.62562 -0.442104,1.576562 -0.141807,0.942601 -0.141807,2.285598 0,2.610919 0.583911,3.853817 0.583912,1.267923 1.751736,1.267923 z m 0.01668,-2.210523 q -0.25859,0 -0.408738,-0.358689 -0.150149,-0.358689 -0.250248,-0.842501 -0.08342,-0.392055 -0.141807,-0.925917 -0.05005,-0.542204 -0.05005,-0.825818 0,-0.200199 0.03337,-0.717378 0.03337,-0.517179 0.133466,-0.975967 0.241906,-1.192848 0.650644,-1.192848 0.233565,0 0.392055,0.316981 0.166832,0.316981 0.283615,0.900892 0.08342,0.408738 0.133465,0.925917 0.05005,0.517179 0.05005,0.809135 0,0.166832 -0.03337,0.658986 -0.02502,0.492155 -0.108441,1.009334 -0.20854,1.217873 -0.684011,1.217873 z" sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" x="151.86282"
id="path836" /> y="13.561927"
<path style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.32601148"
d="m 41.066611,43.378034 h 2.619262 v -8.93385 l -1.9853,2.260572 -0.917576,-1.117774 2.886192,-3.244881 h 1.685003 v 11.035933 h 2.585895 v 1.418071 h -6.873476 z" id="tspan845-9">┌011┐</tspan><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" sodipodi:role="line"
id="path838" /> x="151.86282"
<path y="29.862503"
d="m 53.562324,28.529992 h 1.334655 v 20.687159 h -1.334655 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.32601148"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" id="tspan883">│101│</tspan><tspan
id="path840" /> sodipodi:role="line"
<path x="151.86282"
d="m 12.454936,49.884479 h 1.334656 v 20.687159 h -1.334656 z" y="46.163078"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.32601148"
id="path842" /> id="tspan885">│111│</tspan><tspan
<path sodipodi:role="line"
d="m 20.512918,64.73252 h 2.619262 v -8.933849 l -1.9853,2.260572 -0.917576,-1.117774 2.886192,-3.244881 h 1.685003 V 64.73252 h 2.585895 v 1.418072 h -6.873476 z" x="151.86282"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" y="62.463654"
id="path844" /> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.32601148"
<path id="tspan887">│100│</tspan><tspan
d="m 30.789765,64.73252 h 2.619262 v -8.933849 l -1.9853,2.260572 -0.917576,-1.117774 2.886192,-3.244881 h 1.685003 V 64.73252 h 2.585895 v 1.418072 h -6.873476 z" sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" x="151.86282"
id="path846" /> y="78.764229"
<path style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.32601148"
d="m 41.066611,64.73252 h 2.619262 v -8.933849 l -1.9853,2.260572 -0.917576,-1.117774 2.886192,-3.244881 h 1.685003 V 64.73252 h 2.585895 v 1.418072 h -6.873476 z" id="tspan889">└001┘</tspan></text>
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" <text
id="path848" /> xml:space="preserve"
<path style="font-style:normal;font-weight:normal;font-size:11.29124641px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28228116"
d="m 53.562324,49.884479 h 1.334655 v 20.687159 h -1.334655 z" x="222.2482"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" y="9.1106415"
id="path850" /> id="text841-2-7"><tspan
<path sodipodi:role="line"
d="m 12.454936,71.238966 h 1.334656 v 20.687159 h -1.334656 z" x="222.2482"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" y="9.1106415"
id="path852" /> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.21828365px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.28228116"
<path id="tspan889-0">┌1┐</tspan><tspan
d="m 20.512918,86.087007 h 2.619262 v -8.933849 l -1.9853,2.260572 -0.917576,-1.117774 2.886192,-3.244881 h 1.685003 v 11.035932 h 2.585895 v 1.418072 h -6.873476 z" sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" x="222.2482"
id="path854" /> y="23.224701"
<path style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.21828365px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.28228116"
d="m 33.675958,87.746985 q -2.001983,0 -3.011317,-1.634953 -1.017674,-1.643294 -1.017674,-4.821443 0,-3.186489 1.017674,-4.829784 1.009334,-1.634953 3.011317,-1.634953 2.001983,0 3.019658,1.634953 0.500495,0.800793 0.759085,2.001983 0.258589,1.192849 0.258589,2.827801 0,1.634953 -0.258589,2.827802 -0.25859,1.192848 -0.759085,1.993641 -1.026017,1.634953 -3.019658,1.634953 z m 0,-1.334655 q 1.192848,0 1.768418,-1.267923 0.57557,-1.267923 0.57557,-3.853818 0,-2.602578 -0.57557,-3.853817 -0.57557,-1.276264 -1.768418,-1.276264 -1.176165,0 -1.751736,1.267922 -0.291955,0.62562 -0.442104,1.576562 -0.141807,0.9426 -0.141807,2.285597 0,2.61092 0.583911,3.853818 0.583912,1.267923 1.751736,1.267923 z m 0.01668,-2.210523 q -0.25859,0 -0.408738,-0.358689 -0.150149,-0.358689 -0.250248,-0.842501 -0.08342,-0.392055 -0.141807,-0.925918 -0.05005,-0.542203 -0.05005,-0.825818 0,-0.200198 0.03337,-0.717377 0.03337,-0.517179 0.133466,-0.975967 0.241906,-1.192848 0.650644,-1.192848 0.233565,0 0.392055,0.316981 0.166832,0.31698 0.283615,0.900892 0.08342,0.408738 0.133465,0.925917 0.05005,0.517179 0.05005,0.809135 0,0.166832 -0.03337,0.658986 -0.02502,0.492155 -0.108441,1.009334 -0.20854,1.217873 -0.684011,1.217873 z" id="tspan981">│1│</tspan><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" sodipodi:role="line"
id="path856" /> x="222.2482"
<path y="37.338757"
d="m 43.952804,87.746985 q -2.001984,0 -3.011317,-1.634953 -1.017675,-1.643294 -1.017675,-4.821443 0,-3.186489 1.017675,-4.829784 1.009333,-1.634953 3.011317,-1.634953 2.001983,0 3.019658,1.634953 0.500495,0.800793 0.759085,2.001983 0.258589,1.192849 0.258589,2.827801 0,1.634953 -0.258589,2.827802 -0.25859,1.192848 -0.759085,1.993641 -1.026017,1.634953 -3.019658,1.634953 z m 0,-1.334655 q 1.192848,0 1.768418,-1.267923 0.57557,-1.267923 0.57557,-3.853818 0,-2.602578 -0.57557,-3.853817 -0.57557,-1.276264 -1.768418,-1.276264 -1.176166,0 -1.751736,1.267922 -0.291956,0.62562 -0.442104,1.576562 -0.141807,0.9426 -0.141807,2.285597 0,2.61092 0.583911,3.853818 0.583912,1.267923 1.751736,1.267923 z m 0.01668,-2.210523 q -0.25859,0 -0.408738,-0.358689 -0.150149,-0.358689 -0.250248,-0.842501 -0.08342,-0.392055 -0.141807,-0.925918 -0.05005,-0.542203 -0.05005,-0.825818 0,-0.200198 0.03337,-0.717377 0.03337,-0.517179 0.133466,-0.975967 0.241906,-1.192848 0.650644,-1.192848 0.233565,0 0.392055,0.316981 0.166832,0.31698 0.283615,0.900892 0.08342,0.408738 0.133465,0.925917 0.05005,0.517179 0.05005,0.809135 0,0.166832 -0.03337,0.658986 -0.02502,0.492155 -0.10844,1.009334 -0.20854,1.217873 -0.684011,1.217873 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.21828365px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.28228116"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" id="tspan983">│0│</tspan><tspan
id="path858" /> sodipodi:role="line"
<path x="222.2482"
d="m 53.562324,71.238966 h 1.334655 v 20.687159 h -1.334655 z" y="51.452816"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.21828365px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.28228116"
id="path860" /> id="tspan985">│1│</tspan><tspan
<path sodipodi:role="line"
d="m 12.454936,92.593453 h 1.334656 v 9.676247 h 4.646269 v 1.43476 h -5.980925 z" x="222.2482"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" y="65.566872"
id="path862" /> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.21828365px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.28228116"
<path id="tspan987">│0│</tspan><tspan
d="m 23.399111,109.10147 q -2.001983,0 -3.011317,-1.63495 -1.017674,-1.6433 -1.017674,-4.82144 0,-3.186493 1.017674,-4.829788 1.009334,-1.634953 3.011317,-1.634953 2.001983,0 3.019658,1.634953 0.500495,0.800793 0.759085,2.001983 0.258589,1.192845 0.258589,2.827805 0,1.63495 -0.258589,2.8278 -0.25859,1.19285 -0.759085,1.99364 -1.026017,1.63495 -3.019658,1.63495 z m 0,-1.33465 q 1.192848,0 1.768418,-1.26793 0.57557,-1.26792 0.57557,-3.85381 0,-2.60258 -0.57557,-3.853821 -0.57557,-1.276264 -1.768418,-1.276264 -1.176165,0 -1.751735,1.267922 -0.291956,0.62562 -0.442105,1.576563 -0.141807,0.9426 -0.141807,2.2856 0,2.61092 0.583912,3.85381 0.583911,1.26793 1.751735,1.26793 z m 0.01668,-2.21053 q -0.25859,0 -0.408738,-0.35869 -0.150149,-0.35868 -0.250248,-0.8425 -0.08342,-0.39205 -0.141807,-0.92591 -0.05005,-0.54221 -0.05005,-0.82582 0,-0.2002 0.03337,-0.71738 0.03337,-0.51718 0.133465,-0.97597 0.241906,-1.192844 0.650645,-1.192844 0.233564,0 0.392055,0.316984 0.166832,0.31698 0.283614,0.90089 0.08342,0.40874 0.133465,0.92592 0.05005,0.51718 0.05005,0.80913 0,0.16683 -0.03337,0.65899 -0.02502,0.49215 -0.108441,1.00933 -0.20854,1.21787 -0.684011,1.21787 z" sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" x="222.2482"
id="path864" /> y="79.680931"
<path style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.21828365px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.28228116"
d="m 33.675958,109.10147 q -2.001983,0 -3.011317,-1.63495 -1.017674,-1.6433 -1.017674,-4.82144 0,-3.186493 1.017674,-4.829788 1.009334,-1.634953 3.011317,-1.634953 2.001983,0 3.019658,1.634953 0.500495,0.800793 0.759085,2.001983 0.258589,1.192845 0.258589,2.827805 0,1.63495 -0.258589,2.8278 -0.25859,1.19285 -0.759085,1.99364 -1.026017,1.63495 -3.019658,1.63495 z m 0,-1.33465 q 1.192848,0 1.768418,-1.26793 0.57557,-1.26792 0.57557,-3.85381 0,-2.60258 -0.57557,-3.853821 -0.57557,-1.276264 -1.768418,-1.276264 -1.176165,0 -1.751736,1.267922 -0.291955,0.62562 -0.442104,1.576563 -0.141807,0.9426 -0.141807,2.2856 0,2.61092 0.583911,3.85381 0.583912,1.26793 1.751736,1.26793 z m 0.01668,-2.21053 q -0.25859,0 -0.408738,-0.35869 -0.150149,-0.35868 -0.250248,-0.8425 -0.08342,-0.39205 -0.141807,-0.92591 -0.05005,-0.54221 -0.05005,-0.82582 0,-0.2002 0.03337,-0.71738 0.03337,-0.51718 0.133466,-0.97597 0.241906,-1.192844 0.650644,-1.192844 0.233565,0 0.392055,0.316984 0.166832,0.31698 0.283615,0.90089 0.08342,0.40874 0.133465,0.92592 0.05005,0.51718 0.05005,0.80913 0,0.16683 -0.03337,0.65899 -0.02502,0.49215 -0.108441,1.00933 -0.20854,1.21787 -0.684011,1.21787 z" id="tspan989">│0│</tspan><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" sodipodi:role="line"
id="path866" /> x="222.2482"
<path y="93.794983"
d="m 41.066611,107.44149 h 2.619262 v -8.933845 l -1.9853,2.260575 -0.917576,-1.117777 2.886192,-3.244881 h 1.685003 v 11.035928 h 2.585895 v 1.41808 h -6.873476 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.21828365px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.28228116"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" id="tspan991">│1│</tspan><tspan
id="path868" /> sodipodi:role="line"
<path x="222.2482"
d="m 48.924396,102.2697 h 4.637928 v -9.676247 h 1.334655 v 11.111007 h -5.972583 z" y="107.90904"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack;fill:#00f829;fill-opacity:1;stroke:none;stroke-width:0.42708972;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.21828365px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.28228116"
id="path870" /> id="tspan993">│1│</tspan><tspan
</g> sodipodi:role="line"
x="222.2482"
y="122.02309"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.21828365px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.28228116"
id="tspan995">└0┘</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:13.04045963px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.32601148"
x="8.7948952"
y="16.916115"
id="text841-2-6"><tspan
sodipodi:role="line"
x="8.7948952"
y="16.916115"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.32601148"
id="tspan889-2">┌100101110┐</tspan><tspan
sodipodi:role="line"
x="8.7948952"
y="33.21669"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.32601148"
id="tspan1011">│101011000│</tspan><tspan
sodipodi:role="line"
x="8.7948952"
y="49.517265"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.32601148"
id="tspan1013">│011000000│</tspan><tspan
sodipodi:role="line"
x="8.7948952"
y="65.817833"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1;font-family:Hack;-inkscape-font-specification:Hack;fill:#09ff26;fill-opacity:1;stroke-width:0.32601148"
id="tspan1015">└101011001┘</tspan></text>
<rect
style="opacity:1;fill:#09ff26;fill-opacity:1;stroke:none;stroke-width:1.14285779;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1019"
width="146.68878"
height="1"
x="-1.7673719"
y="71.728836" />
<rect
style="opacity:1;fill:#09ff26;fill-opacity:1;stroke:none;stroke-width:1.1620723;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1021"
width="75.831482"
height="1"
x="144.16548"
y="92.517525" />
<rect
style="opacity:1;fill:#09ff26;fill-opacity:1;stroke:none;stroke-width:1.19583499;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1023"
width="1"
height="132.93539"
x="219.00478"
y="-5.4000192" />
<rect
style="opacity:1;fill:#09ff26;fill-opacity:1;stroke:none;stroke-width:1.80716944;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1025"
width="1"
height="21.788689"
x="144.16548"
y="71.728836" />
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
Documents/gauss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 MiB

View File

@ -1,3 +1,4 @@
.PHONY: ascii tipe ocshell runall clean
%.ascii.txt: %.txt %.ascii.txt: %.txt
iconv -f utf-8 -t ascii//TRANSLIT $< -o $@ iconv -f utf-8 -t ascii//TRANSLIT $< -o $@
@ -7,14 +8,16 @@ ascii: $(shell find textes/ -type f -iname "*.txt" ! -iname "*.ascii.txt" | sed
%.cmx: %.ml %.cmx: %.ml
ocamlopt -c $< ocamlopt -c $<
Code.cmo: Code.ml Math.cmo images.cmo: images.ml images.mli
ocamlc -c images.mli
ocamlc -c images.ml
Code.cmo: Code.ml Code.mli Math.cmo
ocamlc -c "Code.mli" ocamlc -c "Code.mli"
ocamlc -c "Code.ml" ocamlc -c "Code.ml"
%.cmi: %.mli Math.cmo: Math.ml Math.mli
ocamlc -c $< ocamlc -c Math.mli
%.cmo: %.ml ocamlc -c Math.ml
if [ -f $*".mli" ]; then ocamlc -c $*".mli" ; fi
ocamlc -c $<
tipe: tipe.cmx tipe: tipe.cmx
ocamlopt -o tipe str.cmxa tipe.cmx ocamlopt -o tipe str.cmxa tipe.cmx
@ -22,6 +25,9 @@ tipe: tipe.cmx
%.txt.test: %.ascii.txt tipe %.txt.test: %.ascii.txt tipe
./tipe $< ./tipe $<
ocshell: images.cmo Math.cmo Code.cmo
rlwrap ocaml graphics.cma images.cmo Math.cmo Code.cmo
runall: $(shell find textes/ -type f -iname "*.txt" ! -iname "*.ascii.txt" | sed "s/\.txt/\.txt\.test/") runall: $(shell find textes/ -type f -iname "*.txt" ! -iname "*.ascii.txt" | sed "s/\.txt/\.txt\.test/")
clean: clean:

43
Math.ml
View File

@ -130,11 +130,44 @@ let poldiveuc (p:polynome) (q:polynome) : (polynome * polynome) =
let poldiv (p:polynome) (q:polynome) : polynome = fst (poldiveuc p q);; let poldiv (p:polynome) (q:polynome) : polynome = fst (poldiveuc p q);;
let polrst (p:polynome) (q:polynome) : polynome = snd (poldiveuc p q);; let polrst (p:polynome) (q:polynome) : polynome = snd (poldiveuc p q);;
(***************** Arbres de recherche de 'vecteurs' *****************)
type 'a binabr = BNoeud of 'a binabr * 'a binabr | BVal of 'a * 'a binabr | BFeuille;;
let isEmpty babr = babr=BFeuille;;(* Ne renvoie que les biens fondés, c'est à dire sans Noeud vide*)
exception NoSuchKeyException;;
let rec get ba (k:vecteur) =
match (ba,k) with
| (BNoeud(_,_) ,0)
| (BFeuille ,_) -> raise NoSuchKeyException
| (BVal(v,rr) ,0) -> v
| (BVal(v,rr) ,_) -> get rr k
| (BNoeud(t0,t1),_) ->
match k mod 2 with
| 0 -> get t0 (k lsr 1)
| 1 -> get t1 (k lsr 1)
| _ -> failwith "Félicitations, vous avez cassé les maths";;
let rec putWho ba (k:vecteur) v keepNew =
match (ba,k) with
| (BVal(old,rr) ,0) -> if keepNew then BVal(v,rr) else BVal(old,rr)
| (BFeuille ,0)
| (BNoeud(_,_) ,0) -> BVal(v,ba)
| (BVal(o,rr) ,_) -> BVal(o,putWho rr k v keepNew)
| (BFeuille ,_) -> putWho (BNoeud(BFeuille,BFeuille)) k v keepNew
(*match k mod 2 with
| 0 -> BNoeud(putWho BFeuille (k lsr 1) v keepNew, BFeuille)
| 1 -> BNoeud(BFeuille, putWho BFeuille (k lsr 1) v keepNew)
| _ -> failwith "Ich gratuliere Sie. Sie haben Mathe zerbrochen"
end*)
| (BNoeud(t0,t1),_) ->
match k mod 2 with
| 0 -> BNoeud(putWho t0 (k lsr 1) v keepNew, t1)
| 1 -> BNoeud(t0, putWho t1 (k lsr 1) v keepNew)
| _ -> failwith "99 7'4 c0mp1373m3n7 c4553 135 m47h5. 7u 73 23nd5 c0mp73 ?!";;
let put ba k v = putWho ba k v true;; (* Par défaut, on garde le nouveau *)

View File

@ -24,3 +24,11 @@ val polmul : polynome -> polynome -> polynome
val poldiveuc : polynome -> polynome -> polynome * polynome val poldiveuc : polynome -> polynome -> polynome * polynome
val poldiv : polynome -> polynome -> polynome val poldiv : polynome -> polynome -> polynome
val polrst : polynome -> polynome -> polynome val polrst : polynome -> polynome -> polynome
type 'a binabr = BNoeud of 'a binabr * 'a binabr | BVal of 'a * 'a binabr | BFeuille
exception NoSuchKeyException
val get : 'a binabr -> vecteur -> 'a
val putWho : 'a binabr -> vecteur -> 'a -> bool -> 'a binabr
val put : 'a binabr -> vecteur -> 'a -> 'a binabr

226
Test.ml
View File

@ -6,6 +6,26 @@ Sys.command "make Math.cmo Code.cmo";;
open Math;; open Math;;
open Code;; open Code;;
let print_boolean b = match b with
| true -> print_string "true"
| false -> print_string "false";;
let codeh = CLineaire.systematiqueFromRedondance 4 7 [3;6;9;12];;
let vecteurs = matriceAuPif 99 (8-1);;
print_matrice 4 vecteurs;;
let classes = CLineaire.genererClasses codeh;;
let test v = try
CLineaire.encoder codeh (CLineaire.decoder codeh v) <> CLineaire.decoder2 classes v
with
Code.CLineaire.PasDansLeCodeException -> (print_int v;print_endline "*";false)
| CLineaire.IndecodableException -> (print_int v;print_endline "-";false) in
List.find_opt test vecteurs;;
CLineaire.decoder codeh 49;;
CLineaire.encoder codeh 1;;
CLineaire.decoder2 classes 49;;
exit 0;;
(* Test du produit de matrice *) (* Test du produit de matrice *)
let matest = [0b01110; 0b00101; 0b10111];; let matest = [0b01110; 0b00101; 0b10111];;
print_matrice 5 matest;; print_matrice 5 matest;;
@ -78,9 +98,98 @@ print_matrice 4 cocylined.h;;
CLineaire.distance_minimale cocylined;; CLineaire.distance_minimale cocylined;;
print_vecteur 7 (cyclencode cocycl 0b1010);; print_vecteur 9 203;;
(****** Construction des classes cyclotomiques pour un degré n ******)
let classes n =
let rech = Array.make n false in
let lsts = ref [] in
for i=1 to (n-1)
do
if not rech.(i)
then
begin
let v = ref (i lsl 1) in
let lst = ref [i] in
rech.(i) <- true;
while !v<>i
do
rech.(!v) <- true;
lst := !v::!lst;
v := (!v lsl 1) mod n(*Fois 2*)
done;
lsts := !lst::!lsts
end
done;
!lsts;;
let clzLst = let e::s = classes 31 in e;;
let tbleLst = let e::s = trouve 31 in e;;
let clz = List.map (fun x -> Ap(x)) clzLst;;
let tble = Array.map (fun x -> Ap(x)) tbleLst;;
(* Multiplie le polynome arr par chaque élément de la classe. On a deg(out)=d*)
let rec mulan tble arr clz d =
match clz with
| [] -> ()
| a::rr ->
mulan tble arr rr (d-1);
arr.(d) <- arr.(d-1);
for i=d-1 downto 1
do
arr.(i) <- add tble arr.(i-1) (mul tble a arr.(i))
done;
arr.(0) <- mul tble a arr.(0)
;;
let pols clz tble =
let len = List.length clz in
let poly = Array.make (len+1) Zero in
poly.(0) <- Ap(0);
mulan tble poly clz (len);
poly;;
let rec polof tble p a =
if p=0 then Zero else
let cst = if (p mod 2=0) then Zero else Ap(0) in
let q = p lsr 1 in
add tble cst (mul tble a (polof tble q a));;
let pomin tble a =
if a=Zero then 2 else
let i = ref 1 in
while polof tble !i a <> Zero
do
incr i;
incr i
done;
!i;;
polof tble 4 (Ap(2));;
for i=0 to 31 do
print_int i;
print_string "->";
print_polynome (pomin tble (Ap(i)))
done;;
pols clz tble;;
(* Essayons de générer une table d'addition *) (* Essayons de générer une table d'addition *)
(* ABORT MISSION *)
(**** Utilitaires ****) (**** Utilitaires ****)
@ -163,6 +272,12 @@ let add tble i j =
| (Ap(ii),Ap(jj)) -> let tt = getap (tble.(((jj-ii+n) mod n)-1)) in | (Ap(ii),Ap(jj)) -> let tt = getap (tble.(((jj-ii+n) mod n)-1)) in
Ap((tt+ii) mod n);; Ap((tt+ii) mod n);;
let mul tble i j =
let n = (Array.length tble)+1 in
match i,j with
| Zero,_ | _,Zero -> Zero
| Ap(i),Ap(j) -> Ap((i+j) mod n);;
let randtabl n = let randtabl n =
let tab = rangearray 1 (n-1) in let tab = rangearray 1 (n-1) in
Random.self_init (); Random.self_init ();
@ -300,3 +415,112 @@ print_string "Temps écoulé: ";
print_float ((Sys.time ()) -. t0); print_float ((Sys.time ()) -. t0);
print_endline "." print_endline "."
done;; done;;
(**** CRIBLE DE POLYNOMSTENE ****)
let polynomstene pp : polynome list=
let n=degre pp in
let irrs = Array.make (1 lsl (n+1)) true in (* irrs.(p)=true si p est irréductible *)
let p = ref pp in (* Le «gros» polynome va diminuer *)
(* Marque les multiples de q comme non irréductibles, si leur degré est inferieur à celui de p*)
let annuleMultiples q p =
let t = ref 2 in (* On commence par multiplier par X *)
let r = ref (polmul !t q) in
while !r < p
do
irrs.(!r) <- false;
incr t;
r := polmul !t q
done
in
let q = ref 2 in
let divs = ref [] in
while (!p<>1)
do
if irrs.(!q)
then begin
annuleMultiples !q !p;
let (d0,r0) = poldiveuc !p !q in
let d = ref d0 and r = ref r0 in
while (!r=0)
do (* q divise p *)
divs := !q::!divs;
p := !d;
let (d0,r0) = poldiveuc !p !q in
d := d0;
r := r0
done
end;
incr q
done;
!divs;;
let naifostene pp =
let p = ref pp in (* Le «gros» polynome va diminuer *)
let q = ref 2 in
let divs = ref [] in
while (!p<>1)
do
let (d0,r0) = poldiveuc !p !q in
let d = ref d0 and r = ref r0 in
while (!r=0)
do (* q divise p *)
divs := !q::!divs;
p := !d;
let (d0,r0) = poldiveuc !p !q in
d := d0;
r := r0
done;
incr q
done;
!divs;;
let pol = (1 lsl 61) lxor 1;;
print_polynome pol;;
let lst = naifostene pol;;
List.iter (function p -> print_polynome p) lst;;
print_polynome (List.fold_left polmul 1 lst);;
(*** Test de recherche du polynome minimal de alpha ***)
type complexe = float*float;;
let cmul x y =
let (a,b)=x and (c,d)=y in
(a*.c-.b*.d,b*.c+.a*.d);;
let cadd x y =
let (a,b)=x and (c,d)=y in
(a+.c,b+.d);;
let rec polymise p z =
if p=0 then (0.,0.)
else
let a = if p mod 2 = 0 then (0.,0.) else (1.,0.) in
let q = p lsr 1 in
cadd a (cmul z (polymise q z));;
let n = 21;;
let alpha =
let th = 2.*.3.14159265358979/.(float_of_int n) in
(cos th,sin th);;
let isNull z =
let epsilon = 0.00001 in
let (a,b)=z in
-.epsilon<a && a<epsilon && -.epsilon<b && b<epsilon;;
for p=1 to 2 lsl 21
do
if isNull (polymise p alpha)
then(
print_int p;
print_polynome p)
done;;

96
TestImage.ml Normal file
View File

@ -0,0 +1,96 @@
open Graphics ;;
open Images ;;
open Math;;
open Code;;
let img = lire_image "Documents/gauss.png";;
let alpha = 0.95;;
let n = 24;;
let nbreErr () =
let v = Random.float 1. in
if (0.<=v && v<0.9) then 0
else if (0.9<=v && v<0.99) then 1
else if (0.99<v && v<0.999) then 2
else 3;;
let rec bruiteur n a =
let v = nbreErr () in
let x = ref a in
for i=1 to v
do
let erreur = 1 lsl (Random.int n) in
x:=(!x lxor erreur)
done;
!x;;
let larg = Array.length img;;
let long = Array.length img.(0);;
let transmet code classes vv =
try
let y=CLineaire.encoder code vv in
let z=bruiteur 7 y in
let x=CLineaire.decoder code z in
x
with CLineaire.IndecodableException -> 0
| CLineaire.PasDansLeCodeException -> 0
| NoSuchKeyException -> 0xF;;
let transmettre code classes v =
let masque = 0b1111 in
let x0 = masque land v
and x1 = masque land (v lsr 4)
and x2 = masque land (v lsr 8)
and x3 = masque land (v lsr 12)
and x4 = masque land (v lsr 16)
and x5 = masque land (v lsr 20) in
let y0 = masque land (transmet code classes x0)
and y1 = masque land (transmet code classes x1)
and y2 = masque land (transmet code classes x2)
and y3 = masque land (transmet code classes x3)
and y4 = masque land (transmet code classes x4)
and y5 = masque land (transmet code classes x5) in
(y0) lor (y1 lsl 4) lor (y2 lsl 8) lor (y3 lsl 12) lor (y4 lsl 16) lor (y5 lsl 20);;
let transmetGros code classes v =
try
let y=CLineaire.encoder code (v land 0xFFFFFF) in
let z=bruiteur 31 y in
let x=CLineaire.decoder code y in
x land 0xFFFFFF
with CLineaire.IndecodableException -> 0
| CLineaire.PasDansLeCodeException -> 0
| NoSuchKeyException -> 0xF;;
(* classes de Hamming (4,7) *)
let code = CLineaire.systematiqueFromRedondance 4 7 [7; 3; 5; 6];;
let codeG = CLineaire.systematiqueFromRedondance 4 7 (matriceAuPif 3 4);;
let classes = CLineaire.genererClasses code;;
let classesG = CLineaire.genererClasses codeG;;
for i=0 to 177
do
print_int i;
print_string "->";
print_int (transmettre codeG classesG i);
print_endline ";"
done;;
for i=0 to larg-1 do
for j=0 to long-1 do
img.(i).(j) <- transmettre code classes img.(i).(j)
done
done;;
(*for i=0 to larg-1 do
for j=0 to long-1 do
img.(i).(j) <- transmetGros codeG classesG img.(i).(j)
done
done;;
*)
sauver_image img "gaussV2.png";;

170
images.ml Normal file
View File

@ -0,0 +1,170 @@
(*
auteur : FIL
date : janvier 2010
objet : lecture et sauvegarde de fichiers image dans différents format
(PGM, PPM, JPG, PNG, GIF, ...)
necessite l'installation de la commande convert de la suite de traitements
d'images Image Magick (http://www.imagemagick.org/)
*)
let suffixe_tmp = ".tmp "
and rm =
if Sys.os_type="Unix" then
"rm -f "
else
"del "
and mv =
if Sys.os_type="Unix" then
"mv "
else
"move "
and dev_null =
if Sys.os_type="Unix" then
" 2> /dev/null"
else
""
open Graphics
(*
fonction
lire_image_ppm : string -> color array array
parametre
nom : string = nom du fichier pgm ou ppm
* valeur renvoyee : color array array = tableau des pixels
CU :
- suppose qu'un fichier nommé nom contenant une image au format pgm existe
- n'accepte pas de ligne de commentaire (commencant par #) dans l'entete du fichier
*)
let lire_image_ppm nom =
let entree = open_in_bin nom
in
let format = input_line entree
and largeur,hauteur =
let ligne = ref (input_line entree)
in
while !ligne.[0] = '#' do
ligne := input_line entree
done ;
Scanf.sscanf
!ligne
"%d %d"
(fun x y -> x,y)
and _ = input_line entree (* lecture de la ligne contenant 255 *)
in
let img = Array.make_matrix hauteur largeur (rgb 0 0 0)
and en_couleur = (format = "P6")
in
for i = 0 to hauteur - 1 do
for j = 0 to largeur - 1 do
img.(i).(j) <-
if en_couleur then
let x = input_byte entree
and y = input_byte entree
and z = input_byte entree
in
rgb x y z
else
let x = input_byte entree
in
rgb x x x
done
done ;
close_in entree ;
img
(*
fonction lire_image : string -> color array array
parametre
nom : string = nom du fichier image a lire
valeur renvoyee : color array array = tableau des pixels de
l'image contenue dans le fichier
CU : nom doit etre un fichier image d'un format courant
(ie connu de l'utilitaire convert de la suite ImageMagick)
*)
let lire_image nom =
let r = Sys.command ("convert -depth 8 "^nom^" "^nom^".ppm "^dev_null)
in
if r <> 0 then
failwith ("lire_image : fichier "^nom^" manquant ou pas dans un format image")
else
let res = lire_image_ppm (nom^".ppm")
in
ignore(Sys.command (rm^nom^".ppm"));
res
(*
procedure
dessiner_image : color array array -> unit
parametre
img : color array array = image a dessiner
action : dessine l'image dans le coin inferieur gauche
CU : une fenetre graphique doit prealablement etre ouverte
*)
let dessiner_image img =
draw_image (make_image img) 0 0
(*
procedure
sauver_image_pgm : color array array -> string -> unit
parametres
img : color array array = image a sauvegarder
nom : string = nom du fichier de sauvegarde de l'image
action : sauvegarde de l'image au format PPM,
*)
let sauver_image_ppm (img : Graphics.color array array) nom =
let sortie = open_out_bin nom
and hauteur = Array.length img
and largeur = Array.length img.(0)
in
output_string sortie "P6\n" ;
output_string sortie ((string_of_int largeur)^" "^(string_of_int hauteur)^"\n") ;
output_string sortie "255\n";
for i = 0 to hauteur - 1 do
for j = 0 to largeur - 1 do
let r = img.(i).(j) / (256*256)
and g = (img.(i).(j) mod (256*256)) / 256
and b = img.(i).(j) mod 256
in
output_byte sortie r ;
output_byte sortie g ;
output_byte sortie b
done
done ;
close_out sortie
let liste_formats = [".png"; ".jpg"; ".gif"; ".bmp"; ".pgm"; ".ppm"]
(*
procedure
sauver_image : color array array -> string -> unit
parametres
img : color array array = image a sauvegarder
nom : string = nom du fichier de sauvegarde de l'image
action : sauvegarde de l'image dans un fichier nomme par nom
CU : le nom du fichier doit se terminer par une extension
indiquant le format qui doit faire partie de la liste
liste_formats
*)
let sauver_image img nom =
let suffixe = String.sub nom ((String.length nom) - 4) 4
in
if not (List.mem suffixe liste_formats) then
failwith "sauver_image : format image non reconnu"
else
let _ = sauver_image_ppm img (nom^".tmp")
in
if suffixe="ppm" then
ignore(Sys.command (mv^nom^suffixe_tmp^nom))
else begin
ignore(Sys.command ("convert "^nom^suffixe_tmp^" "^nom^dev_null)) ;
ignore(Sys.command (rm^nom^suffixe_tmp))
end

54
images.mli Normal file
View File

@ -0,0 +1,54 @@
(**
Module Images
Permet de charger et sauvegarder des images stockées dans des fichiers dans divers formats : png, jpg, gif, bmp, pgm, ppm.
Necessite la suite logicielle ImageMagick.
L'utilisation de ce module en mode interprete necessite l'appel à l'interpreteur avec les options :
- [ocaml graphics.cma images.cmo]
La production d'un executable utilisant ce module doit se faire avec la commande :
- [ocamlc -o <nom_executable> graphics.cma images.cmo <source_a_compiler>]
@author FIL - IEEA - Univ. Lille1 (mars 2010)
@see <http://www.imagemagick.org/> le site d'ImageMagick.
*)
(** {2 Lecture et ecriture d'images dans des fichiers} *)
(**
[liste_formats] = liste des formats autorises.
*)
val liste_formats : string list
(**
[lire_image s] = tableau de pixels represente par leur couleur, correspondant a l'image stockee dans le fichier nomme [s].
{b CU :} le fichier nomme [s] doit exister et l'extension de son nom doit correspondre a l'un des formats autorises .
*)
val lire_image : string -> Graphics.color array array
(**
[sauver_image t s] sauvegarde l'image representee par le tableau de pixels [t] dans un fichier nomme [s]. Le format de sauvegarde est determine par l'extension choisie dans le nom [s].
{b CU :} le format doit etre l'un des formats autorises.
*)
val sauver_image : Graphics.color array array -> string -> unit
(** {2 Dessiner une image dans une fenetre graphique} *)
(**
[dessiner_image t] dessine dans la fenetre graphique l'image representee par le tableau de pixels [t]. Le dessin est fait dans le coin inferieur gauche de la fenetre graphique.
{b CU :} une fenetre graphique doit etre prealablement ouverte.
*)
val dessiner_image : Graphics.color array array -> unit