added createMatrix() + matrix data type

This commit is contained in:
Tobias Kachel 2025-11-11 11:15:40 +01:00
parent 29b2966c63
commit 28944bd871
2 changed files with 5 additions and 3 deletions

View File

@ -6,12 +6,13 @@
Matrix createMatrix(unsigned int rows, unsigned int cols)
{
MatrixType* data = malloc(rows * cols * sizeof(MatrixType));
Matrix newMatrix = {rows, cols, data};
return newMatrix;
}
void clearMatrix(Matrix *matrix)
{
}
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)

View File

@ -6,7 +6,8 @@
typedef float MatrixType;
// TODO Matrixtyp definieren
typedef struct{
typedef struct
{
unsigned int rows;
unsigned int cols;
MatrixType *data;