diff --git a/Startcode/makefile b/Startcode/makefile index f27b756..5c04df5 100644 --- a/Startcode/makefile +++ b/Startcode/makefile @@ -54,6 +54,8 @@ neuralNetworkTests: neuralNetwork.o matrix.o neuralNetworkTests.c $(unityfolder) imageInputTests: imageInput.o imageInputTests.c $(unityfolder)/unity.c $(CC) $(CFLAGS) -I$(unityfolder) -o runImageInputTests imageInputTests.c imageInput.o $(unityfolder)/unity.c + + # -------------------------- # Clean # -------------------------- diff --git a/Startcode/matrix.c b/Startcode/matrix.c index ad00628..c8cea0b 100644 --- a/Startcode/matrix.c +++ b/Startcode/matrix.c @@ -6,7 +6,10 @@ Matrix createMatrix(unsigned int rows, unsigned int cols) { - + struct Matrix m; + m.buffer = calloc(rows*cols, sizeof(MatrixType)); + m.rows = rows; + m.cols = cols; } void clearMatrix(Matrix *matrix) @@ -16,7 +19,7 @@ void clearMatrix(Matrix *matrix) void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx) { - + matrix.buffer } MatrixType getMatrixAt(const Matrix matrix, unsigned int rowIdx, unsigned int colIdx) diff --git a/Startcode/matrix.h b/Startcode/matrix.h index cc640d1..72f9504 100644 --- a/Startcode/matrix.h +++ b/Startcode/matrix.h @@ -6,7 +6,11 @@ typedef float MatrixType; // TODO Matrixtyp definieren - +typedef struct Matrix{ + MatrixType *buffer; + unsigned int rows; + unsigned int cols; +}Matrix; Matrix createMatrix(unsigned int rows, unsigned int cols); void clearMatrix(Matrix *matrix);