generated from freudenreichan/info2Praktikum-NeuronalesNetz
Compare commits
No commits in common. "7acece0571ee7922a23738958602c82f6f07b1c5" and "ebc5ff02169fc10aea224af72919d76eadb46149" have entirely different histories.
7acece0571
...
ebc5ff0216
9
matrix.c
9
matrix.c
@ -13,17 +13,12 @@ typedef struct Matrix {
|
|||||||
|
|
||||||
Matrix createMatrix(unsigned int rows, unsigned int cols)
|
Matrix createMatrix(unsigned int rows, unsigned int cols)
|
||||||
{
|
{
|
||||||
Matrix newMatrix;
|
|
||||||
newMatrix.rows = rows;
|
|
||||||
newMatrix.cols = cols;
|
|
||||||
newMatrix.buffer = calloc(rows*cols, sizeof(MatrixType))
|
|
||||||
return newMatrix;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearMatrix(Matrix *matrix)
|
void clearMatrix(Matrix *matrix)
|
||||||
{
|
{
|
||||||
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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user