1
0
mirror of https://gitlab.com/klmp200/LO27.git synced 2024-11-26 01:24:14 +00:00

Merge branch 'NaejBranch' into 'master'

modif sum avec op

See merge request !14
This commit is contained in:
Antoine Bartuccio 2016-12-27 22:06:54 +00:00
commit a6587d1f9e

View File

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