Erste Impl. Funktionen in matrix.c

This commit is contained in:
fischerch103508 committed 2026-11-02 13:17:41 +01:00
1 parent 2e76e7b8d9
commit bc64e2d6fb
3 files changed
+12 -3

No files matched your search

+2
View File
@@ -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
# --------------------------
+5 -2
View File
@@ -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)
+5 -1
View File
@@ -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);