Matrix-Tests laufen alle PASS
This commit is contained in:
parent
444067262e
commit
1e3e0fc0bb
@ -10,10 +10,15 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
|
|||||||
Matrix matrix;
|
Matrix matrix;
|
||||||
matrix.rows = rows;
|
matrix.rows = rows;
|
||||||
matrix.cols = cols;
|
matrix.cols = cols;
|
||||||
matrix.buffer = (float *)malloc(rows * cols * sizeof(MatrixType));
|
if(matrix.rows == 0 || matrix.cols == 0){
|
||||||
if (matrix.buffer != NULL) {
|
matrix.rows = 0;
|
||||||
|
matrix.cols = 0;
|
||||||
|
matrix.buffer = NULL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
matrix.buffer = (float *)malloc(rows * cols * sizeof(MatrixType));
|
||||||
}
|
}
|
||||||
|
|
||||||
return matrix;
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user