forked from freudenreichan/info2Praktikum-NeuronalesNetz
addmatrix mit broadcasten
This commit is contained in:
@@ -33,6 +33,11 @@ void setMatrixAt(const MatrixType value, Matrix matrix,
|
||||
const unsigned int rowIdx, // Kopie der Matrix wird übergeben
|
||||
const unsigned int colIdx) {
|
||||
|
||||
if (rowIdx >= matrix.rows ||
|
||||
colIdx >= matrix.cols) { // Speichergröße nicht überschreiten
|
||||
return;
|
||||
}
|
||||
|
||||
matrix.buffer[rowIdx * matrix.cols + colIdx] =
|
||||
value; // rowIdx * matrix.cols -> Beginn der Zeile colIdx ->Spalte
|
||||
// innerhalb der Zeile
|
||||
|
||||
Reference in New Issue
Block a user