From c70f52e6cab1d55f70bc2962b7305950e0970e1a Mon Sep 17 00:00:00 2001 From: klmp200 Date: Thu, 29 Dec 2016 15:38:13 +0100 Subject: [PATCH] Fix du doublon d'apply rules --- LibMatrix/matrix.c | 45 +-------------------------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/LibMatrix/matrix.c b/LibMatrix/matrix.c index cea56e1..ec902a9 100644 --- a/LibMatrix/matrix.c +++ b/LibMatrix/matrix.c @@ -35,10 +35,7 @@ Matrix applyRules (Matrix matrix,int Rules, int N){ tempMatrix2 = matrixFromRules(tempMatrix1,i, RulesMatrix); freeMatrix(tempMatrix1); - tempMatrix1.colCount = tempMatrix2.colCount; - tempMatrix1.rowCount = tempMatrix2.rowCount; - tempMatrix1.cols = tempMatrix2.cols; - tempMatrix1.rows = tempMatrix2.rows; + tempMatrix1 = tempMatrix2; } return tempMatrix1; @@ -621,46 +618,6 @@ bool * GetFromRules(Matrix m, int ColPos, int RowPos, int n, int rules[]){ } -Matrix applyRules (Matrix matrix,int Rules, int N){ - int RulesMatrix[9]; - int i = 0; - int power = 2; - int sum = 0; - int j = 0; - Matrix tempMatrix; - - if (Rules <= 0 || N < 1){ - return matrix; - } - - tempMatrix = CreateMatrix(); - - while(power<=512){ - - RulesMatrix[i] = Rules%power - sum; - sum = Rules%power; - - if (RulesMatrix[i]!=0){ - i++; - } - - power*=2; - } - - /* test code : print decomposition */ - /*for (j=0;j