39 lines
942 B
C
39 lines
942 B
C
#ifndef MATRIX_H
|
|
#define MATRIX_H
|
|
|
|
#define UNDEFINED_MATRIX_VALUE 0
|
|
|
|
typedef float MatrixType;
|
|
|
|
// TODO Matrixtyp definieren
|
|
|
|
|
|
|
|
|
|
//Aufgaben:
|
|
// 1) Eine Matrix ist definiert durch die Anzahl Zeilen und Spalten sowie einem Speicher-
|
|
// bereich mit den eigentlichen Werten. Implementieren Sie an geeigneter Stelle (welche
|
|
// ist das?) eine C-Struktur mit dem Namen Matrix, welche eine Matrix auf diese Art
|
|
// beschreibt.
|
|
typedef struct
|
|
{
|
|
unsigned int rows;
|
|
unsigned int cols;
|
|
int *Memory;
|
|
//int Memory[rows][cols];
|
|
|
|
} 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
|