forked from freudenreichan/info2Praktikum-NeuronalesNetz
28 lines
782 B
C
28 lines
782 B
C
#ifndef MATRIX_H
|
|
#define MATRIX_H
|
|
|
|
#define UNDEFINED_MATRIX_VALUE 0
|
|
|
|
typedef float MatrixType;
|
|
|
|
/*
|
|
* Die Matrixstruktur hält:
|
|
* - Anzahl Zeilen
|
|
* - Anzahl Spalten
|
|
* - Ein Zeiger auf die gespeicherten Werte (Tests erwarten den Namen "buffer")
|
|
*/
|
|
typedef struct {
|
|
unsigned int rows;
|
|
unsigned int cols;
|
|
MatrixType *buffer; // <- Name an Tests angepasst
|
|
} Matrix;
|
|
|
|
Matrix createMatrix(unsigned int rows, unsigned int cols);
|
|
void clearMatrix(Matrix *matrix);
|
|
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 multiply(const Matrix matrix1, const Matrix matrix2);
|
|
|
|
#endif
|