generated from freudenreichan/info2Praktikum-NeuronalesNetz
Added ClearMatrix Function And Added Return Value to CreateMatrix
This commit is contained in:
parent
44b77815b3
commit
7acece0571
4
matrix.c
4
matrix.c
@ -17,11 +17,13 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
|
||||
newMatrix.rows = rows;
|
||||
newMatrix.cols = cols;
|
||||
newMatrix.buffer = calloc(rows*cols, sizeof(MatrixType))
|
||||
return newMatrix;
|
||||
}
|
||||
|
||||
void clearMatrix(Matrix *matrix)
|
||||
{
|
||||
|
||||
free(*matrix.buffer);
|
||||
*matrix.buffer = NULL;
|
||||
}
|
||||
|
||||
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user