From 09ffea11ecfec54fa6a1697c40a7723383411c23 Mon Sep 17 00:00:00 2001 From: klmp200 Date: Fri, 30 Dec 2016 19:49:55 +0100 Subject: [PATCH] =?UTF-8?q?D=C3=A9but=20du=20raport=20et=20renommage=20de?= =?UTF-8?q?=20fonction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + LibGui/gui.c | 2 +- LibMatrix/matrix.c | 2 +- LibMatrix/matrix.h | 2 +- report.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 report.md diff --git a/.gitignore b/.gitignore index 8ea1943..c10510c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ Libs/ *.exe build/ Doc/ +*.pdf diff --git a/LibGui/gui.c b/LibGui/gui.c index 7c334e9..2071b66 100644 --- a/LibGui/gui.c +++ b/LibGui/gui.c @@ -129,7 +129,7 @@ void DisplayMatrixGUI(Matrix m, bool useSDL){ printf("Press ENTER or the red cross to exit the window and continue.\n"); NewWindowFromMatrix(m); } else { - BasicPrintMatrix(m); + printMatrix(m); } } diff --git a/LibMatrix/matrix.c b/LibMatrix/matrix.c index 2d6fd1e..13f59b9 100644 --- a/LibMatrix/matrix.c +++ b/LibMatrix/matrix.c @@ -263,7 +263,7 @@ bool SetCellValue(Matrix matrix, int ColPos, int RowPos,bool value){ } } -void BasicPrintMatrix(Matrix matrix){ +void printMatrix(Matrix matrix){ /* Non optimisé : debug fx */ int i = 0; int j = 0; diff --git a/LibMatrix/matrix.h b/LibMatrix/matrix.h index e42610f..0bd3729 100644 --- a/LibMatrix/matrix.h +++ b/LibMatrix/matrix.h @@ -189,7 +189,7 @@ Matrix SetMatrixDim(Matrix matrix,int nbCols,int nbRows); *@return void * */ -void BasicPrintMatrix(Matrix matrix); +void printMatrix(Matrix matrix); bool RecursiveFreeCol(Matrix matrix, cellElement * elem); diff --git a/report.md b/report.md new file mode 100644 index 0000000..1fcba92 --- /dev/null +++ b/report.md @@ -0,0 +1,48 @@ +% Cellular Automaton LO27 +% Bartuccio Antoine \cr Porée De Ridder Jean +% Autumn 2016 + +\newpage + +# Introduction + +The goal of this project is to provide a library containing a new abstract data type called **Matrix** with associated function to manipulate them. The final program have to enable a user to test the library in an interactive and practical way. + +Since we decided to not store false value in our matrix, we decided not to worry too much about performances and we encapsulated all access to stored data in the Matrix structure to avoid too much complexity and allow more modularity, readability and re-usability. We created high level tools to manipulate our matrix and used it all along the project. + +For compilation we didn't used the **-ansi** flag since we had to deal with both clang and gcc for compilation and clang didn't accept this flag. Instead, we used the **-std=c89** flag witch contains the same rules but is accepted on both softwares. Compiling with **-ansi** still works. + + +We decided to create two different library. One for the graphical interface (which require SDL2) and the other with the Matrix data type) so this way you may just have to compile one lib if you don't need the gui. + +# Description of abstract data types + +Every function and data type are described in the documentation given with the project. This documentation is generated with doxygen. + +# Algorithmic + +The most interesting function are *GetCellValue* and *SetCellValue*. Those are the one we rely on the most. They are our way of dealing with our complex data structure allowing us to avoid to store false values. They are the functions that need the more computational power on the long run but are really useful due to their level of abstraction and their high level. + +```C + +``` + +Functions *andColSequenceOnMatrix* and *orColSequenceOnMatrix* are implemented with *colSequenceOnMatrix* and are really not interesting so we're gonna provide the algorithm of the last one : + +```C + +``` + +This is the same thing for *andRowSequenceOnMatrix* and *orRowSequenceOnMatrix* : + +```C + +``` + +Here are the algorithm of the function *applyRules* and all the one related to it : + +```C + +``` + +# Conclusion \ No newline at end of file