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.rows = rows;
|
||||
matrix.cols = cols;
|
||||
matrix.buffer = (float *)malloc(rows * cols * sizeof(MatrixType));
|
||||
if (matrix.buffer != NULL) {
|
||||
|
||||
if(matrix.rows == 0 || matrix.cols == 0){
|
||||
matrix.rows = 0;
|
||||
matrix.cols = 0;
|
||||
matrix.buffer = NULL;
|
||||
}
|
||||
else {
|
||||
matrix.buffer = (float *)malloc(rows * cols * sizeof(MatrixType));
|
||||
}
|
||||
|
||||
return matrix;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user