generated from freudenreichan/info2Praktikum-NeuronalesNetz
fixed some Error Messegas from matrixTests
This commit is contained in:
parent
4640908e1b
commit
1dd5d458e6
7
matrix.c
7
matrix.c
@ -23,8 +23,8 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
|
|||||||
|
|
||||||
void clearMatrix(Matrix *matrix)
|
void clearMatrix(Matrix *matrix)
|
||||||
{
|
{
|
||||||
free(matrix.buffer);
|
free(matrix->buffer);
|
||||||
matrix.buffer = NULL;
|
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)
|
||||||
@ -55,8 +55,7 @@ Matrix add(const Matrix matrix1, const Matrix matrix2)
|
|||||||
Matrix MatrixErgebnis = createMatrix(matrix1.rows, matrix1.cols); //Creating Result Matrix
|
Matrix MatrixErgebnis = createMatrix(matrix1.rows, matrix1.cols); //Creating Result Matrix
|
||||||
if(matrix1.cols != matrix2.cols || matrix1.rows != matrix2.rows){
|
if(matrix1.cols != matrix2.cols || matrix1.rows != matrix2.rows){
|
||||||
printf("Matrix dimensions do not match\n"); //Error Message if dimensions of Input Matrixes are not identical
|
printf("Matrix dimensions do not match\n"); //Error Message if dimensions of Input Matrixes are not identical
|
||||||
clearMatrix(MatrixErgebnis);
|
clearMatrix(&MatrixErgebnis);
|
||||||
MatrixErgebnis = NULL;
|
|
||||||
return MatrixErgebnis;
|
return MatrixErgebnis;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user