mirror of
https://gitlab.com/klmp200/LO27.git
synced 2024-11-26 18:04:14 +00:00
corrigé free
This commit is contained in:
parent
0dfa280bfc
commit
98e08eab35
@ -83,7 +83,7 @@ bool CreateMatrixElem(Matrix matrix, int ColPos, int RowPos){
|
|||||||
} else if (Col->data->rowIndex > RowPos){
|
} else if (Col->data->rowIndex > RowPos){
|
||||||
elem->nextRow = Col->data;
|
elem->nextRow = Col->data;
|
||||||
Col->data = elem;
|
Col->data = elem;
|
||||||
} else {
|
} else {NMWZxm5uQt
|
||||||
tmp = Col->data;
|
tmp = Col->data;
|
||||||
while (tmp->nextRow != NULL && tmp->nextRow->rowIndex < RowPos){
|
while (tmp->nextRow != NULL && tmp->nextRow->rowIndex < RowPos){
|
||||||
tmp=tmp->nextRow;
|
tmp=tmp->nextRow;
|
||||||
@ -295,18 +295,22 @@ bool RecursiveFreeCol(Matrix matrix, cellElement * elem){
|
|||||||
|
|
||||||
|
|
||||||
Matrix freeMatrix(Matrix matrix){
|
Matrix freeMatrix(Matrix matrix){
|
||||||
ListElement * current = NULL;
|
int i = 0;
|
||||||
|
int j = 0;
|
||||||
|
|
||||||
|
printf("\n---FREE MATRIX---\n");
|
||||||
|
|
||||||
|
for (i=0;i<matrix.rowCount;i++){
|
||||||
|
for (j=0;j<matrix.colCount;j++){
|
||||||
|
|
||||||
|
SetCellValue(matrix,j,i,false);
|
||||||
|
|
||||||
matrix.colCount = 0;
|
|
||||||
matrix.rowCount = 0;
|
|
||||||
|
|
||||||
if (matrix.cols != NULL){
|
|
||||||
current= matrix.cols->head;
|
|
||||||
while (current != NULL){
|
|
||||||
RecursiveFreeCol(matrix,current->data);
|
|
||||||
current = current->next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("---END OF MATRIX---\n\n");
|
||||||
FreeList(matrix.cols);
|
FreeList(matrix.cols);
|
||||||
FreeList(matrix.rows);
|
FreeList(matrix.rows);
|
||||||
return matrix;
|
return matrix;
|
||||||
|
3
main.c
3
main.c
@ -34,6 +34,9 @@ int main(int argc, char **argv){
|
|||||||
freeMatrix(m2);
|
freeMatrix(m2);
|
||||||
m2 = rowSequenceOnMatrix(matrix, AND);
|
m2 = rowSequenceOnMatrix(matrix, AND);
|
||||||
BasicPrintMatrix(m2);
|
BasicPrintMatrix(m2);
|
||||||
|
|
||||||
|
/*sumMatrix(matrix,m2);*/
|
||||||
|
|
||||||
freeMatrix(m2);
|
freeMatrix(m2);
|
||||||
|
|
||||||
freeMatrix(matrix);
|
freeMatrix(matrix);
|
||||||
|
Loading…
Reference in New Issue
Block a user