diff --git a/matrix.c b/matrix.c index ad00628..86a93fa 100644 --- a/matrix.c +++ b/matrix.c @@ -6,30 +6,35 @@ Matrix createMatrix(unsigned int rows, unsigned int cols) { - + Matrix m; + m.rows = rows; + m.cols = cols; + m.buffer = malloc(rows * cols * sizeof(MatrixType)); + return m; + } -void clearMatrix(Matrix *matrix) +void clearMatrix(Matrix *m) { - } + 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) { - + } Matrix multiply(const Matrix matrix1, const Matrix matrix2) { - + } \ No newline at end of file diff --git a/neuralNetworkTests.c b/neuralNetworkTests.c index 2c824cc..a2eeca7 100644 --- a/neuralNetworkTests.c +++ b/neuralNetworkTests.c @@ -240,7 +240,8 @@ void test_predictReturnsCorrectLabels(void) MatrixType weightsBuffer2[] = {-9, 10, 11, 12, 13, 14}; MatrixType weightsBuffer3[] = {-15, 16, 17, 18, -19, 20, 21, 22, 23, -24, 25, 26, 27, -28, -29}; Matrix weights1 = {.buffer=weightsBuffer1, .rows=2, .cols=4}; - Matrix weights2 = {.buffer=weightsBuffer2, .rows=3, .cols=2}; + + Matrix weights2 = {.buffer=weightsBuffer2, .rows=3, .cols=2}; Matrix weights3 = {.buffer=weightsBuffer3, .rows=5, .cols=3}; MatrixType biasBuffer1[] = {200, 0}; MatrixType biasBuffer2[] = {0, -100, 0}; @@ -258,7 +259,6 @@ void test_predictReturnsCorrectLabels(void) TEST_ASSERT_EQUAL_UINT8_ARRAY(expectedLabels, predictedLabels, n); free(predictedLabels); } - void setUp(void) { // Falls notwendig, kann hier Vorbereitungsarbeit gemacht werden }