mirror of
https://gitlab.com/klmp200/LO27.git
synced 2024-12-22 17:11:09 +00:00
modif sum avec op
This commit is contained in:
parent
46f9dbd5b3
commit
48912373fd
@ -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){
|
||||
opMatrix(matrix1,matrix2,OR);
|
||||
}
|
||||
|
||||
Matrix mulMatrix(Matrix matrix1,Matrix matrix2){
|
||||
opMatrix(matrix1,matrix2,AND);
|
||||
}
|
||||
|
||||
|
||||
Matrix colSequenceOnMatrix(Matrix m, bool (operator)(bool, bool)){
|
||||
bool a;
|
||||
bool b;
|
||||
|
Loading…
Reference in New Issue
Block a user