generated from freudenreichan/info2Praktikum-NeuronalesNetz
51 lines
1.0 KiB
C
51 lines
1.0 KiB
C
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include "matrix.h"
|
|
|
|
// TODO Matrix-Funktionen implementieren
|
|
|
|
typedef struct Matrix {
|
|
unsigned int xElement;
|
|
unsigned int yElement;
|
|
} Matrix;
|
|
|
|
Matrix createMatrix(unsigned int rows, unsigned int cols)
|
|
{
|
|
|
|
}
|
|
|
|
void clearMatrix(Matrix *matrix)
|
|
{
|
|
|
|
}
|
|
|
|
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
|
{
|
|
|
|
}
|
|
|
|
MatrixType getMatrixAt(const Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
|
{
|
|
|
|
}
|
|
|
|
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];
|
|
}
|
|
}
|
|
}
|
|
|
|
} |