create matrix mit null
This commit is contained in:
parent
0886489d49
commit
e1ea9f33cd
14
makefile
14
makefile
@ -57,12 +57,10 @@ imageInputTests: imageInput.o imageInputTests.c $(unityfolder)/unity.c
|
||||
# --------------------------
|
||||
# Clean
|
||||
# --------------------------
|
||||
#clean:
|
||||
#ifeq ($(OS),Windows_NT)
|
||||
# del /f *.o *.exe
|
||||
#else
|
||||
# rm -f *.o mnist runMatrixTests runNeuralNetworkTests runImageInputTests
|
||||
#endif
|
||||
# clean für windows
|
||||
clean:
|
||||
rm -f *.o *.exe
|
||||
ifeq ($(OS),Windows_NT)
|
||||
del /f *.o *.exe
|
||||
else
|
||||
rm -f *.o mnist runMatrixTests runNeuralNetworkTests runImageInputTests
|
||||
endif
|
||||
|
||||
4
matrix.c
4
matrix.c
@ -8,6 +8,10 @@
|
||||
MatrixType *buffer; //Zeiger auf Speicherbereich Reihen*Spalten
|
||||
} Matrix;*/
|
||||
Matrix createMatrix(unsigned int rows, unsigned int cols) {
|
||||
if (cols == 0 || rows == 0){
|
||||
Matrix errorMatrix = {0, 0, NULL};
|
||||
return errorMatrix;
|
||||
}
|
||||
MatrixType *buffer =
|
||||
malloc(rows * cols * sizeof(MatrixType)); // Speicher reservieren, malloc
|
||||
// liefert Zeiger auf Speicher
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user