Revert "kurzer zwischenspeicher"
This reverts commit 13900179a11a67e7701ced253f9d4cfa8b5c08f1.
This commit is contained in:
parent
13900179a1
commit
5b60de1f17
26
matrix.c
26
matrix.c
@ -98,27 +98,17 @@ Matrix multiply(const Matrix matrix1, const Matrix matrix2)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Matrix result;
|
||||||
|
result.rows = matrix1.rows;
|
||||||
|
result.cols = matrix2.cols;
|
||||||
|
|
||||||
Matrix result = createMatrix(matrix1.rows, matrix2.cols);
|
//mit get matrix den 4 werte aus matrix1/2.buffer rausnehmen und verrechnen
|
||||||
|
//mit set matrix in result.buffer reinladen
|
||||||
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < result.rows; i++)
|
//1. for: buffer um stelle weiter
|
||||||
{
|
//2. for: 1. reihe von matrix1 geht von x10-x12 und x13-x15 das wird 2 mal gemacht
|
||||||
for (unsigned int j = 0; j < result.cols; j++)
|
//3. for: 2. reihe von matrix1 geht von x20-x23; x24-x27; x28-x211 das wird 2 mal gemacht
|
||||||
{
|
|
||||||
|
|
||||||
MatrixType summe = 0;
|
|
||||||
|
|
||||||
for (unsigned int k = 0; k < matrix1.cols; k++)
|
|
||||||
{
|
|
||||||
summe += getMatrixAt(matrix1, i, k) * getMatrixAt(matrix2, k, j);
|
|
||||||
}
|
|
||||||
|
|
||||||
setMatrixAt(summe, result, i, j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user