2025-12-02 09:13:35 +01:00

29 lines
835 B
C

#ifndef MATRIX_H
#define MATRIX_H
#define UNDEFINED_MATRIX_VALUE 0
typedef float MatrixType;
// TODO Matrixtyp definieren
typedef struct {
unsigned int rows;
unsigned int cols;
MatrixType *buffer;
} Matrix;
Matrix createMatrix(const unsigned int rows, const unsigned int cols);
void clearMatrix(Matrix *matrix);
void setMatrixAt(const MatrixType value, Matrix matrix,
const unsigned int rowIdx, const unsigned int colIdx);
MatrixType getMatrixAt(const Matrix matrix, const unsigned int rowIdx,
const unsigned int colIdx);
Matrix broadCastCols(const Matrix matrix, const unsigned int cols);
Matrix broadCastRows(const Matrix matrix, const unsigned int rows);
Matrix add(const Matrix matrix1, const Matrix matrix2);
Matrix multiply(const Matrix matrix1, const Matrix matrix2);
#endif