Additional fix to getMatrix
This commit is contained in:
parent
2142433257
commit
2396b5867b
2
matrix.c
2
matrix.c
@ -42,7 +42,7 @@ void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned
|
|||||||
MatrixType getMatrixAt(const Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
MatrixType getMatrixAt(const Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
||||||
{
|
{
|
||||||
if(rowIdx < matrix.rows && colIdx < matrix.cols){
|
if(rowIdx < matrix.rows && colIdx < matrix.cols){
|
||||||
return matrix.buffer[rowIdx * matrix.cols + colIdx];
|
return matrix.buffer[rowIdx * matrix.cols + colIdx]; //ACHTUNG! rowIdx und colIDX sind in Array position gedacht! matrix.cols ist normal gedacht!
|
||||||
}else{
|
}else{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user