Kommentare angepasst
This commit is contained in:
@@ -34,15 +34,16 @@ void clearMatrix(Matrix *matrix)
|
||||
|
||||
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
||||
{
|
||||
if (rowIdx < matrix.rows && colIdx < matrix.cols && matrix.buffer != NULL)
|
||||
matrix.buffer[rowIdx * matrix.cols + colIdx] = value; //gibt xxxxxxxxxx
|
||||
if (rowIdx < matrix.rows && colIdx < matrix.cols && matrix.buffer != NULL) //Prüft ob Zugriff möglich
|
||||
matrix.buffer[rowIdx * matrix.cols + colIdx] = value;
|
||||
//schreibt 2D element in 1D Liste: Element_Reihe*Matrix_Spalten + Element_Spalte
|
||||
}
|
||||
|
||||
MatrixType getMatrixAt(const Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
||||
{
|
||||
if (rowIdx >= matrix.rows || colIdx >= matrix.cols || matrix.buffer == NULL)
|
||||
return 0; // Sicherheitscheck
|
||||
return matrix.buffer[rowIdx * matrix.cols + colIdx]; //xxxxxxxxxxxx
|
||||
return matrix.buffer[rowIdx * matrix.cols + colIdx];
|
||||
}
|
||||
|
||||
// TODO: Funktionen implementieren
|
||||
|
||||
Reference in New Issue
Block a user