generated from freudenreichan/info2Praktikum-NeuronalesNetz
started with matrix multiplication
This commit is contained in:
parent
9c6dac7822
commit
8b52d7f317
14
matrix.c
14
matrix.c
@ -5,7 +5,8 @@
|
||||
// TODO Matrix-Funktionen implementieren
|
||||
|
||||
typedef struct Matrix {
|
||||
|
||||
unsigned int xElement;
|
||||
unsigned int yElement;
|
||||
} Matrix;
|
||||
|
||||
Matrix createMatrix(unsigned int rows, unsigned int cols)
|
||||
@ -33,7 +34,18 @@ Matrix add(const Matrix matrix1, const Matrix matrix2)
|
||||
|
||||
}
|
||||
|
||||
//todo implement the content of the matrices
|
||||
Matrix multiply(const Matrix matrix1, const Matrix matrix2)
|
||||
{
|
||||
//missing check for if the matrices can be multiplied
|
||||
|
||||
// generate a new matrix wtih the correctr values: m1X, m2Y
|
||||
for (int i = 0; i< matrix1.xElement; i++) {
|
||||
for (int j = 0; j < matrix2.yElement; j++) {
|
||||
for (int k = 0; k < matrix2.xElement; k++) {
|
||||
//matrix[i][j] += matrix1[i][k] * matrix2[k][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user