Compare commits

...

17 Commits

Author SHA1 Message Date
Mysaa
01022aae3c Merge branch 'master' of bernard.com.de:mysaa/arbeiten/TIPE2021 2021-07-10 21:51:36 +02:00
Mysaa
8357410256 Quelques tests de recherche de polynôme minimal. 2021-07-10 21:50:11 +02:00
1edf097c4f Ah. Il fallait un diapo. Bon. On va faire un diapo. 2021-06-27 19:45:00 +02:00
0e86409114 Fin (normalement) du Compte rendu avec la jolie bibliographie 2021-06-10 20:23:52 +02:00
671c213b23 Ajout de polynomstene 2021-06-10 16:42:58 +02:00
465d4fb179 Ajout de la jolie tête de gauss et d'une introduction ^^ 2021-06-09 23:13:49 +02:00
6aed4a4c0d On continue le compte rendu …
Petit fix du Makefile
2021-06-09 20:31:47 +02:00
5bcae43999 La déformation de Gauß fonctionne ! 2021-06-05 12:45:29 +02:00
20b45e9071 Début du bruitage de Gauss 2021-06-02 20:25:08 +02:00
36875fc40a Nouvel algorithme de décodage avec enregistrement dans un dictionnaire des syndromes
Fin de la rédaction du dossier (manque encore des finitions)
2021-06-02 15:12:22 +02:00
2c825f16a8 Rédaction d'une grande partie de la seconde partie du compte rendu
Retypage de quelques fonctions
Correction d'un problème de dépendances dans le Makefile
2021-06-01 20:06:47 +02:00
5a16b7c99a Écriture de la première partie du compte-rendu 2021-05-27 18:16:16 +02:00
2c864f9957 Merge branch 'maudule'
Ajout du joli système de modules, qui est très pratique pour utiliser les fonctions, mais moins pour les modifier
2021-03-24 20:00:21 +01:00
3802f3e43d Réorganisation et embellissement des fonctions de génération de la table d'addition, avec l'algorithme explicitant la fonction phi 2021-03-24 19:29:53 +01:00
0f9e8c73c6 Ajout du test de génération de tables d'addition 2021-03-23 20:27:32 +01:00
b65493f0d6 Ajout de tests pour trouver la table du mathématicien généreux. 2021-03-18 19:47:20 +01:00
51d2e44ff8 Ajout de cyclencode (wow, incroyable) 2021-03-11 20:03:40 +01:00
23 changed files with 2616 additions and 41 deletions

2
.gitignore vendored
View File

@ -5,3 +5,5 @@
*.a *.a
*.ascii.txt *.ascii.txt
/tipe /tipe
.directory
gaussV2.png

39
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;;
(*************************************************************) (*************************************************************)
@ -148,6 +179,8 @@ type code_cyclique = t;;
let get k n pol = {k=k;n=n;pol=pol};; let get k n pol = {k=k;n=n;pol=pol};;
let cyclencode code (x:vecteur) :vecteur = polmul code.pol x;;
end;; end;;
(*************************************************************) (*************************************************************)
@ -189,4 +222,4 @@ let lineaireVersCyclique code =
(* Voilà *) (* Voilà *)

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 -> int list -> 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

@ -4,3 +4,13 @@
*.sh *.sh
*.synctex.gz *.synctex.gz
*.toc *.toc
*.thm
svg-inkscape/
*_path.svg
*.bbl
*.bcf
*.blg
*.run.xml
*.nav
*.out
*.snm

View File

@ -1,49 +1,378 @@
% !TeX encoding = UTF-8 % !TeX encoding = UTF-8
\documentclass[10pt,a4paper]{article} \documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\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}
\usepackage{amsmath} \usepackage{amsmath}
\usepackage{amssymb} \usepackage{amssymb}
\let\theoremstyle\relax
\usepackage{amsthm}
\usepackage{calrsfs} \usepackage{calrsfs}
\usepackage{setspace} \usepackage{setspace}
\usepackage{stmaryrd}
\usepackage{svg}
\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
\doublespacing \onehalfspacing
% Fait une jolie barre horizontale % Fait une jolie barre horizontale
\newcommand{\hsep}{\centerline{\rule{0.8\linewidth}{.05pt}}} \newcommand{\hsep}{\centerline{\rule{0.8\linewidth}{.05pt}}}
\author{Samy AVRILLON, Victor BELLOT, Dylan THEVENET} % Racourcis
\title{Études des codes cycliques} \newcommand{\FD}{\mathbb{F}_2}
\begin{document} \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\:}
\newtheoremstyle{break}
{\topsep}{\topsep}%
{}{}%
{\bfseries}{}%
{\newline}{}%
\theoremstyle{break}
\newtheorem{definition}{Définition}[section]
\newtheorem{theoreme}{Théorème}[section]
\theoremstyle{remark}
\newtheorem*{remarque}{Remarque}
%% Choose your 5/2
% 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}
\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}
\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}
\fi
\section{Codes}
\begin{definition}[Code, Codage]
On définit un code de paramètres $(n,k)$ comme une partie de $\FD^n$ associée à $\FD^k$. Un codage est une application de $\FD^k$ vers $\FD^n$ injective.
Un codage est dit systématique lorsque les $k$ premiers bits de l'image d'un élément sont égaux à cet élément.
\end{definition}
\begin{definition}[Distance de Hamming, Poids d'un mot]
La distance de Hamming entre deux mots $v$ et $w$ de $\FD^n$ est le nombre de coordonnées différentes des deux mots.
$$d(v,w) = \operatorname{card}(i\in \llbracket1,n\rrbracket,v_i \neq w_i)$$
Le poids d'un mot est son nombre de coordonnées non nulles, égal à sa distance au vecteur nul.
\end{definition}
\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.
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,x\neq y}\left(d(x,y)\right)$$
\end{definition}
\begin{theoreme}\label{thCapacité}
On peut alors exprimer $e_d$ et $e_c$ en fonction de $d_C$ :
$$ e_d = d_C - 1 \qquad e_c = \left\lfloor\frac{d_C - 1}{2}\right\rfloor$$
\end{theoreme}
\begin{definition}[Code Parfait]
Un code parfait est un code tel que pour tout mot $w$ de $\FD^n$, il existe un \underline{unique} mot de $C$ étant à une distance minimale de $w$. Autrement dit, il n'y a jamais d'ambigüité sur la façon de décoder un mot erroné.
\end{definition}
\begin{remarque}
Il n'existe que trois types de codes parfaits:
\begin{itemize}
\item Les codes de Hamming
\item Les codes de répétition pure
\item Le code de Golay binaire de longueur 23
\end{itemize}
\end{remarque}
\section{Codes linéaires}
On dit qu'un code est linéaire lorsqu'il a une structure naturelle de sous-espace vectoriel de $\FD^n$. Les codages linéaires associés sont des applications linéaires.
\begin{definition}[Matrice génératrice]
On appelle \textbf{matrice génératrice} d'un codage linéaire $\phi$ la matrice de $\mathcal{M}_{n,k}(\FD)$ associée à $\phi$.
\end{definition}
\begin{definition}[Matrice de contrôle]
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.
\end{definition}
\begin{theoreme}[Calcul de distances]
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:
$$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}
Voici ici quelques concepts qui seront utiles au décodage.
\begin{definition}[Erreur et syndrome]
Si l'on souhaite envoyer un mot $X \in \FD^k$ qui est donc codé en $Y\in C$. Le mot réceptionné est $Z \in \FD^n$.
On appelle alors \textbf{mot erreur} le mot $E = Z - Y$.
On appelle \text{syndrome} le mot $S = H \cdot Z$.
On remarque que $E$ et $Z$ on le même syndrome. On peut plus généralement définir une relation d'équivalence «avoir le même syndrome». Les classes d'équivalence de cette relation sont appelées \textbf{classes latérales}.
\end{definition}
\section{Codes cycliques}
\begin{definition}[Code cyclique]
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é} par un mot $w$, qui est le plus petit espace vectoriel stable par décalage cyclique qui contienne $w$.
\end{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.
\end{definition}
\begin{theoreme}[Théorème fondamental des codes cycliques]
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}
\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$.
\end{remarque}
\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}
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}
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é.
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.
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}
\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{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})
\end{itemize}
\subsection{Polynômes}
De la même manière, les polynômes sont des vecteurs de l'espace vectoriel $\FD[X]$. On peut donc eux aussi les stocker comme entiers binaires, avec l'entier écrit en base 2: $a_0a_1a_2\cdots a_d$ correspondant au polynôme $P=\displaystyle\sum^d_{i=0}a_i\cdot X^i$. Là encore, nous nous limitons aux polynômes de degré 31 ou 63, à moins d'utiliser des objets virtuels plus avancés.
Les fonctions suivantes ont été créées (les complexités sont données pour les polynômes $P$ et $Q$ de degrés respectifs $p$ et $q$).
\begin{itemize}
\fsign{degre}{polynome \into int}{p} Renvoie le degré du polynôme
\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{print\_polynome}{polynome \into unit}{p}(Exemple figure~\ref{print_matriceExemple})
\end{itemize}
\subsection{Codes}
Les différents codes (linéaires et cycliques) sont stockés comme des enregistrements.
Les codes linéaires sont la donnée de leurs matrices génératrice et une matrice de contrôle (redondante) ainsi que k et n (nécessaire car les «matrices» n'ont pas la donnée de leur hauteur). Bien que l'on puisse déduire une matrice de contrôle de la matrice génératrice, ce calcul peut se révéler coûteux.
Les codes cycliques sont simplement les données de k, de n et du polynôme générateur.
Les fonctions suivantes permettent de manipuler les structures:
\begin{itemize}
\fsign{systematiqueFromRedondance}{int \into int \into matrice \into code\_lineaire}{k} Renvoie le code linéaire systématique associé à la matrice de redondance de $\mathcal{M}_{n-k,k}$.
\end{itemize}
\section{Liste des fonctions}
J'ai ensuite écrit des fonctions permettant de manipuler les codes linéaires:
\begin{itemize}
\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.
\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.
\fsign{distance\_minimale}{code\_lineaire -> int}{n2^{d_C}}
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.
\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}
\pagebreak \pagebreak
\part*{Annexes}
\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
Le codage utilisé est un codage d'Hamming (4,7).
Les images à gauche des paires correspondent à une transmission sans aucune correction.
\end{center}
\caption{Exemple d'application de codes correcteurs}
\label{gaussEx}
\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
\part{Mathématique} \pagebreak
\bibliography{biblio}
\part{Algorithmie}
\section{Structures de données crées}
\section{Liste des fonctions}
\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

@ -0,0 +1,235 @@
<?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="66.282837mm"
height="117.06406mm"
viewBox="0 0 66.282836 117.06406"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="print_output.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="-109.9148"
inkscape:cy="-17.849234"
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.53453934,-1.3999026)">
<rect
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"
width="256.40485"
height="132.93906"
x="-1.7333201"
y="-5.4036703" />
<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="2.3512421"
y="89.607773"
id="text841"><tspan
sodipodi:role="line"
id="tspan839"
x="2.3512421"
y="89.607773"
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
sodipodi:role="line"
x="2.3512421"
y="105.90835"
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="tspan843">1 + X^2</tspan><tspan
sodipodi:role="line"
x="2.3512421"
y="122.20892"
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="tspan845">1 + X^1 + X^4 + X^6 + X^9</tspan></text>
<flowRoot
xml:space="preserve"
id="flowRoot847"
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
id="flowRegion849"><rect
id="rect851"
width="137.14285"
height="50"
x="291.42856"
y="16.732544" /></flowRegion><flowPara
id="flowPara853"></flowPara></flowRoot> <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="151.86282"
y="13.561927"
id="text841-2"><tspan
sodipodi:role="line"
x="151.86282"
y="13.561927"
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="tspan845-9">┌011┐</tspan><tspan
sodipodi:role="line"
x="151.86282"
y="29.862503"
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="tspan883">│101│</tspan><tspan
sodipodi:role="line"
x="151.86282"
y="46.163078"
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="tspan885">│111│</tspan><tspan
sodipodi:role="line"
x="151.86282"
y="62.463654"
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="tspan887">│100│</tspan><tspan
sodipodi:role="line"
x="151.86282"
y="78.764229"
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">└001┘</tspan></text>
<text
xml:space="preserve"
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"
x="222.2482"
y="9.1106415"
id="text841-2-7"><tspan
sodipodi:role="line"
x="222.2482"
y="9.1106415"
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="tspan889-0">┌1┐</tspan><tspan
sodipodi:role="line"
x="222.2482"
y="23.224701"
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="tspan981">│1│</tspan><tspan
sodipodi:role="line"
x="222.2482"
y="37.338757"
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="tspan983">│0│</tspan><tspan
sodipodi:role="line"
x="222.2482"
y="51.452816"
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="tspan985">│1│</tspan><tspan
sodipodi:role="line"
x="222.2482"
y="65.566872"
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="tspan987">│0│</tspan><tspan
sodipodi:role="line"
x="222.2482"
y="79.680931"
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="tspan989">│0│</tspan><tspan
sodipodi:role="line"
x="222.2482"
y="93.794983"
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="tspan991">│1│</tspan><tspan
sodipodi:role="line"
x="222.2482"
y="107.90904"
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="tspan993">│1│</tspan><tspan
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>
</svg>

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 $@
@ -6,14 +7,17 @@ ascii: $(shell find textes/ -type f -iname "*.txt" ! -iname "*.ascii.txt" | sed
%.cmx: %.ml %.cmx: %.ml
ocamlopt -c $< ocamlopt -c $<
Code.cmo: Math.cmo
%.cmi: %.mli images.cmo: images.ml images.mli
ocamlc -c $< ocamlc -c images.mli
%.cmo: %.ml ocamlc -c images.ml
if [ -f $*".mli" ]; then ocamlc -c $*".mli" ; fi
ocamlc -c $< Code.cmo: Code.ml Code.mli Math.cmo
ocamlc -c "Code.mli"
ocamlc -c "Code.ml"
Math.cmo: Math.ml Math.mli
ocamlc -c Math.mli
ocamlc -c Math.ml
tipe: tipe.cmx tipe: tipe.cmx
ocamlopt -o tipe str.cmxa tipe.cmx ocamlopt -o tipe str.cmxa tipe.cmx
@ -21,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:

44
Math.ml
View File

@ -130,12 +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

@ -1,20 +1,34 @@
type vecteur = int type vecteur = int
type matrice = int list type matrice = int list
type polynome = int type polynome = int
val deux_puissance : int -> int
val changer_bit : int -> int -> int
val decagauche : int -> int -> int
val nthOfBinarint : int -> int -> string val nthOfBinarint : int -> int -> string
val print_matrice : int -> matrice -> unit val print_matrice : int -> matrice -> unit
val print_vecteur : int -> vecteur -> unit val print_vecteur : int -> vecteur -> unit
val print_polynome : polynome -> unit val print_polynome : polynome -> unit
val produit : matrice -> vecteur -> vecteur val produit : matrice -> vecteur -> vecteur
val deux_puissance : int -> int val identite : int -> matrice
val orderize : 'a -> 'a -> 'a * 'a val orderize : 'a -> 'a -> 'a * 'a
val identite : int -> int list
val changer_bit : int -> int -> int
val decagauche : int -> int -> int
val respecter : int -> int list -> bool val respecter : int -> int list -> bool
val matriceAuPif : int -> int -> matrice val matriceAuPif : int -> int -> matrice
val polmul : polynome -> polynome -> polynome
val degre : polynome -> int val degre : polynome -> int
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

453
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;;
@ -16,7 +36,7 @@ let pol1 = 13 and pol2 = 67;;
print_polynome pol1;; print_polynome pol1;;
print_polynome pol2;; print_polynome pol2;;
print_polynome (polmul pol1 pol2);; print_polynome (polmul pol1 pol2);;
let qt,rst=(poldiveuc pol2 pol1) in let qt,rst=(poldiveuc pol2 pol1) in
print_polynome qt; print_polynome qt;
print_polynome rst;; print_polynome rst;;
@ -59,7 +79,6 @@ do
then raise (GTROUVE matPapa) then raise (GTROUVE matPapa)
done;; done;;
print_vecteur 21 (CLineaire.encoder code_paparfait 0b011011011001);;
print_vecteur 7 (CLineaire.encoder code_hamming 0b0100);; print_vecteur 7 (CLineaire.encoder code_hamming 0b0100);;
CLineaire.decoder code_hamming 0b1010100;; CLineaire.decoder code_hamming 0b1010100;;
@ -76,4 +95,432 @@ print_polynome (poldiv ((deux_puissance 7) +1) cocycl.pol);;
let cocylined = cycliqueVersLineaire cocycl;; let cocylined = cycliqueVersLineaire cocycl;;
print_matrice 7 cocylined.g;; print_matrice 7 cocylined.g;;
print_matrice 4 cocylined.h;; print_matrice 4 cocylined.h;;
CLineaire.distance_minimale cocylined;;
CLineaire.distance_minimale cocylined;;
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 *)
(* ABORT MISSION *)
(**** Utilitaires ****)
let rangearray i j =
let out = Array.make (j-i+1) 0 in
for k=i to j do
out.(k-i) <- k
done;
out;;
let shuffle tab =
let n = Array.length tab in
for i=n-2 downto 1 do
let j = Random.int (i+1) in
let a,b=tab.(i),tab.(j) in
tab.(i) <- b;
tab.(j) <- a
done;;
exception EmptyException;;
let pop q = match !q with
| [] -> raise EmptyException
| e::s -> q:=s;e;;
let push q e = q:=e::!q;;
let printtbl arr=
let n = Array.length arr in
print_string "[|";
print_int arr.(0);
for i=1 to (n-1) do
print_string ";";
print_int arr.(i)
done;
print_string "|]";;
let printlst lst =
print_string "[";
match lst with
| [] -> ()
| e::s -> begin
print_int e;
let rec aux ll = match ll with
| [] -> ()
| h::t -> print_string ";";print_int h;aux t
in aux s end;
print_string "]";;
exception FoundException;;
let arrmem arr e =
let n = Array.length arr in
try
for i=0 to n-1 do
if arr.(i)=e then raise FoundException
done;
false
with FoundException -> true;;
let rec foreache lst f edd= match lst with
| [] -> edd ()
| e::s -> f e;foreache s f edd;;
let foreach lst f = foreache lst f (fun () -> ());;
(**** La zolie structure****)
let n = 7;;
type element = Zero | Ap of int;;
exception NotApException;;
let getap a = match a with
| Zero -> raise NotApException
| Ap(i) -> i;;
let add tble i j =
let n = (Array.length tble) +1 in
if i=j then Zero else
match i,j with
| Zero,x | x,Zero -> x
| (Ap(0),Ap(k)) -> tble.(k-1)
| (Ap(k),Ap(0)) -> tble.(k-1)
| (Ap(ii),Ap(jj)) -> let tt = getap (tble.(((jj-ii+n) mod n)-1)) in
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 tab = rangearray 1 (n-1) in
Random.self_init ();
shuffle tab;
let rout = Array.make (n-1) Zero in
for i=0 to n-1-1 do
rout.(i) <- Ap(tab.(i))
done;
rout;;
let getphi arr k = Ap(arr.(k));;
exception PasTransitifException;;
let estTransitif tble =
let n = Array.length tble in
try
for i=1 to (n-1) do
for j=1 to (i-1) do (* i et j distincts et non nuls (transititivité évidente)*)
if (* La formule s'applique *) i<>tble.(j) && j <> tble.(i) then
let sa = j + tble.((tble.(i)-j+n) mod n) in
let sb = i + tble.((tble.(j)-i+n) mod n) in
if sa mod n <>sb mod n then raise PasTransitifException
done
done;
true
with PasTransitifException -> false;;
let printalp a = match a with
| Zero -> print_string "o"
| Ap(i) -> print_int i;;
(* Cette fonction utilise les super formules en partant de
la valeur indiquée *)
exception ContradictionException of int * int array;;
(* Renvoie la LISTE des valeurs non associées dans arr *)
(* Suppose que arr\{-1} est bijective (assurée par l'involutivité de phi) *)
(* Bien entendu, on oublie le zéro *)
let missingValues arr =
let n = Array.length arr in
let rec aux arr i l =
if i=0 then l else
if (arr.(i)=(-1)) then
aux arr (i-1) (i::l)
else aux arr (i-1) l
in aux arr (n-1) [];;
(* Remplis la table avec les valeurs qu'impliquent la valeur en k, supposée déjà
imposée par une fonction exterieure. Renvoie une ContradictionException si l'une
des implications est impossible avec une des valeurs déjà mises, ou impliquées
d'une autre manière *)
let remplis tble k =
let n = Array.length tble in
let queue = ref [k] in
while !queue<>[]
do
let el = pop queue in
(* Test de l'involutivité *)
begin
match tble.(tble.(el)) with
| -1 -> (tble.(tble.(el)) <- el;push queue tble.(el))
| x when x=el -> ()
| _ -> raise (ContradictionException(el,tble))
end;
(* Test de la formule d'opposition *)
let opv = (n+tble.(el)-el) mod n in
match tble.(n-el) with
| -1 -> (tble.(n-el) <- opv;push queue (n-el))
| x when x=opv-> ()
| _ -> raise (ContradictionException(el,tble))
done;;
(* Efface (met -1) dans les cases de tble d'index les éléments de mv (liste) *)
let rec cleanTable tble mv = match mv with
| [] -> ()
| e::s -> tble.(e) <- (-1);cleanTable tble s;;
(* Rajoute à la pile d'entrée, à partir d'un tableau représentant une fonction phi partielle (-1 pour
les valeurs encore indéfinies) l'ensemble de toutes les fonctions phi réelles
respectant la transitivité (créant donc un corps) et étendant la fonction partielle. *)
let rec exploite tble res =
let mv = missingValues tble in
match mv with
| [] -> if estTransitif tble then push res tble (* Toutes les valeurs sont fixées: pas quarante-douze solutions ...*)
| k::r -> (* On séléctionne un des éléments indéfinis. On va tester toutes les valeurs sur lui *)
let rec traite tble k mv mm res =
(* Traite à partir de la table tble, l'index de tests k, les valeurs manquantes mv,
et les valeurs manquantes pas encore essayées mm, res la pile mettre les bons *)
begin
match mm with [] -> () (* Alors, on a testé toutes les valeurs manquantes *)
| m::rr -> (* On doit tester arr.(k)<-m, puis reste tout rr à tester *)
if k<>m then (* Un point ne peut etre son image *)
begin
cleanTable tble mv; (* Enlève toutes les valeurs des essais précedents *)
tble.(k) <- m; (* Place la bonne valeur de test s*)
begin
try
remplis tble k; (* Tente de remplir avec les implications le l'index k*)
if arrmem tble (-1) (* Si des cases restent indéterminées malgrès notre valeur arr.(k) *)
then (* On déscend d'un étage *)
(exploite tble res)
else (* Ben on sauvegarde si c'est effectivement transitif et on continue *)
if (estTransitif tble) then push res (Array.copy tble)
with ContradictionException(el,arr) -> () (* Si il y a eu une contradiction on ne stoque rien, ni n'essaye rien*)
end(*try*)
end(*if k<>m*);
traite tble k mv rr res (* Dans tous les cas, on teste le reste *)
end
in traite tble k mv mv res;; (* On applique la fonctions auxilière *)
(* Fonction faisant appel à exploite afin de renvoyer la liste-ensemble des tables créant un
corps sur {0}u{a pow k pour k dans [0,n-1] *)
let trouve n =
let arr = (Array.make n (-1)) in
arr.(0) <- 0;
let res = ref [] in
exploite arr res;
!res;;
(** Tests **)
for m=1 to 10 do
let i = (1 lsl m)-1 in
let t0 = Sys.time () in
print_int i;
foreach (trouve i) printtbl;
print_endline ";";
print_string "Temps écoulé: ";
print_float ((Sys.time ()) -. t0);
print_endline "."
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