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

Merge branch 'master' of gitlab.com:klmp200/LO27

This commit is contained in:
Antoine Bartuccio 2016-12-28 18:52:12 +01:00
commit 5ce36a2607
2 changed files with 12 additions and 3 deletions

View File

@ -317,7 +317,7 @@ Matrix freeMatrix(Matrix matrix){
return matrix;
}
Matrix sumMatrix(Matrix matrix1,Matrix matrix2){
Matrix opMatrix(Matrix matrix1,Matrix matrix2,bool (operator)(bool, bool)){
Matrix SumMatrix = CreateMatrix();
int i =0;
int j = 0;
@ -326,7 +326,7 @@ Matrix sumMatrix(Matrix matrix1,Matrix matrix2){
SumMatrix = SetMatrixDim(SumMatrix,matrix2.colCount,matrix1.rowCount);
for (i=0;i<SumMatrix.colCount;i++){
for (j=0;j<SumMatrix.rowCount;j++){
SetCellValue(SumMatrix,i,j,GetCellValue(matrix1,i,j)+GetCellValue(matrix2,i,j));
SetCellValue(SumMatrix,i,j,operator(GetCellValue(matrix1,i,j),GetCellValue(matrix2,i,j)));
}
}
@ -341,6 +341,15 @@ Matrix sumMatrix(Matrix matrix1,Matrix matrix2){
}
Matrix sumMatrix(Matrix matrix1,Matrix matrix2){
return opMatrix(matrix1,matrix2,OR);
}
Matrix mulMatrix(Matrix matrix1,Matrix matrix2){
return opMatrix(matrix1,matrix2,AND);
}
Matrix colSequenceOnMatrix(Matrix m, bool (operator)(bool, bool)){
bool a;
bool b;

View File

@ -341,7 +341,7 @@ bool bottom_rightRule(Matrix m, int ColPos, int RowPos);
bool * GetFromRules(Matrix m, int ColPos, int RowPos, int n, int rules[]);
Matrix sumMatrix(Matrix matrix1,Matrix matrix2);
Matrix mulMatrix(Matrix matrix1,Matrix matrix2);
#endif