forked from freudenreichan/info2Praktikum-NeuronalesNetz
Fehlersuche läuft, keine Fortschritte
This commit is contained in:
1 parent
bea1545564
commit
e1284e9efc
1 file changed
+3
-2
+3
-2
@@ -10,9 +10,9 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
|
|||||||
matrix.rows = rows;
|
matrix.rows = rows;
|
||||||
matrix.cols = cols;
|
matrix.cols = cols;
|
||||||
matrix.buffer = NULL;
|
matrix.buffer = NULL;
|
||||||
if (rows == 0 || cols == 0)
|
if (matrix.rows == 0 || matrix.cols == 0)
|
||||||
{
|
{
|
||||||
return;
|
return matrix;
|
||||||
}
|
}
|
||||||
matrix.buffer = malloc(rows * cols * sizeof(MatrixType));
|
matrix.buffer = malloc(rows * cols * sizeof(MatrixType));
|
||||||
return matrix;
|
return matrix;
|
||||||
@@ -21,6 +21,7 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
|
|||||||
void clearMatrix(Matrix *matrix)
|
void clearMatrix(Matrix *matrix)
|
||||||
{
|
{
|
||||||
free(matrix->buffer);
|
free(matrix->buffer);
|
||||||
|
matrix->buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
||||||
|
|||||||
Reference in new issue
Block a user