2 Commits
Author SHA1 Message Date
welschph103497 fc2b14d0e0 matrix.h erstellt 2026-11-09 09:21:41 +01:00
welschph103497 954318593c createMatrix und clearMatrix erstellt 2026-11-09 09:12:40 +01:00
2 changed files with 15 additions and 14 deletions

No files matched your search

+9 -12
View File
@@ -1,35 +1,32 @@
#include "matrix.h"
#include <stdlib.h>
#include <string.h>
#include "matrix.h"
// TODO Matrix-Funktionen implementieren
Matrix createMatrix(unsigned int rows, unsigned int cols)
{
Matrix matrix;
matrix.rows = rows;
matrix.cols = cols;
matrix.data = malloc(rows * cols * sizeof(MatrixType *));
return matrix;
}
void clearMatrix(Matrix *matrix)
{
free(matrix->data);
}
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 add(const Matrix matrix1, const Matrix matrix2) {}
}
Matrix multiply(const Matrix matrix1, const Matrix matrix2)
{
}
Matrix multiply(const Matrix matrix1, const Matrix matrix2) {}
+6 -2
View File
@@ -6,7 +6,12 @@
typedef float MatrixType;
// TODO Matrixtyp definieren
typedef struct Matrix
{
unsigned int rows;
unsigned int cols;
MatrixType *data;
} Matrix;
Matrix createMatrix(unsigned int rows, unsigned int cols);
void clearMatrix(Matrix *matrix);
@@ -15,5 +20,4 @@ MatrixType getMatrixAt(const Matrix matrix, unsigned int rowIdx, unsigned int co
Matrix add(const Matrix matrix1, const Matrix matrix2);
Matrix multiply(const Matrix matrix1, const Matrix matrix2);
#endif