VerbesserungV2_NeuronetzV2_Fertig
This commit is contained in:
parent
47c68dda83
commit
03a904f021
15
matrix.c
15
matrix.c
@ -7,12 +7,15 @@
|
|||||||
|
|
||||||
Matrix createMatrix(unsigned int rows, unsigned int cols)
|
Matrix createMatrix(unsigned int rows, unsigned int cols)
|
||||||
{
|
{
|
||||||
Matrix m;
|
Matrix m = {NULL,0,0};
|
||||||
m.rows = rows;
|
if (rows > 0 && cols > 0) {
|
||||||
m.cols = cols;
|
m.rows = rows;
|
||||||
/* calloc initialisiert den Speicher mit 0 */
|
m.cols = cols;
|
||||||
m.buffer = (MatrixType*)calloc(rows * cols, sizeof(MatrixType));
|
/* calloc initialisiert den Speicher mit 0 */
|
||||||
return m;
|
m.buffer = (MatrixType*)calloc(rows * cols, sizeof(MatrixType));
|
||||||
|
}
|
||||||
|
return m;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearMatrix(Matrix *matrix)
|
void clearMatrix(Matrix *matrix)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user