1
0
mirror of https://gitlab.com/klmp200/LO27.git synced 2024-12-22 22:11:09 +00:00

1ere correction algos

This commit is contained in:
Naej 2017-01-01 23:30:49 +01:00
parent 4c60e18161
commit 462f5b13ce

View File

@ -55,7 +55,7 @@ BEGIN
elem <- nextCol(elem) elem <- nextCol(elem)
endwhile endwhile
findMatrixElem <- elem; findMatrixElem <- elem
END END
``` ```
@ -78,7 +78,7 @@ createMatrixElem( matrix:Matrix, ColPos:integer, RowPos:integer):bool
Row:*ListElement <-NULL Row:*ListElement <-NULL
Col:*Listelemnt <- NULL Col:*Listelemnt <- NULL
error:integer = 0 error:integer <- 0
elem: *cellElement <- NULL elem: *cellElement <- NULL
tmp: *cellElement<- NULL tmp: *cellElement<- NULL
@ -91,7 +91,7 @@ createMatrixElem( matrix:Matrix, ColPos:integer, RowPos:integer):bool
SetPositionIndex(elem,ColPos,RowPos) SetPositionIndex(elem,ColPos,RowPos)
Row <- getElementPos(rows(matrix),RowPos) Row <- getElementPos(rows(matrix),RowPos)
if (Row != NULL AND Row->data != NULL) if (Row != NULL AND data(Row) != NULL)
if (colIndex(data(Row)) == ColPos) if (colIndex(data(Row)) == ColPos)
error ++ error ++
@ -133,7 +133,7 @@ createMatrixElem( matrix:Matrix, ColPos:integer, RowPos:integer):bool
else else
tmp <- data(Col) tmp <- data(Col)
while (nextRow(tmp) != NULL AND rowIndex(nextRow(tmp)) < RowPos) do while (nextRow(tmp) != NULL AND rowIndex(nextRow(tmp)) < RowPos) do
tmp = nextRow(tmp) tmp <- nextRow(tmp)
endwhile endwhile
if (nextRow(tmp) == NULL OR rowIndex(nextRow(tmp)) > RowPos) if (nextRow(tmp) == NULL OR rowIndex(nextRow(tmp)) > RowPos)
@ -146,7 +146,7 @@ createMatrixElem( matrix:Matrix, ColPos:integer, RowPos:integer):bool
else else
push(cols(matrix),elem) push(cols(matrix),elem)
pos(tail(cols(matrix))) = ColPos; pos(tail(cols(matrix))) <- ColPos
endif endif
@ -177,7 +177,7 @@ BEGIN
deleteMatrixElem <- -1 deleteMatrixElem <- -1
endif endif
if (Row->data == NULL) if (data(Row) == NULL)
removeElementPos(rows(matrix),RowPos) removeElementPos(rows(matrix),RowPos)
deleteMatrixElem <- -1 deleteMatrixElem <- -1
endif endif
@ -191,25 +191,25 @@ BEGIN
tmp <- nextCol(tmp) tmp <- nextCol(tmp)
endwhile endwhile
if (tmp->nextCol != NULL) if (nextCol(tmp) != NULL)
nextCol(tmp) <- nextCol(elem) nextCol(tmp) <- nextCol(elem)
endif endif
endif endif
if (data(Row) == NULL){ if (data(Row) == NULL)
removeElementPos(rows(matrix),RowPos) removeElementPos(rows(matrix),RowPos)
} endif
Col = getElementPos(cols(matrix),ColPos) Col <- getElementPos(cols(matrix),ColPos)
if (Col == NULL) if (Col == NULL)
deleteMatrixElem <- -2 deleteMatrixElem <- -2
endif endif
if (Col->data == NULL){ if (data(Col) == NULL)
removeElementPos(cols(matrix),ColPos) removeElementPos(cols(matrix),ColPos)
deleteMatrixElem <- -1; deleteMatrixElem <- -1
endif endif
if (rowIndex(data(Col)) == RowPos) if (rowIndex(data(Col)) == RowPos)
data(Col) <- nextRow(elem) data(Col) <- nextRow(elem)
@ -268,7 +268,7 @@ BEGIN
endif endif
endfor endfor
endfor endfor
colSequenceOnMatrix <- newM; colSequenceOnMatrix <- newM
END END
``` ```
@ -287,7 +287,7 @@ BEGIN
tempMatrix2:Matrix tempMatrix2:Matrix
if (Rules <= 0 OR N < 1) if (Rules <= 0 OR N < 1)
applyRules <- matrix; applyRules <- matrix
endif endif
while(power <= 512) do while(power <= 512) do