forked from freudenreichan/info2Praktikum-NeuronalesNetz
Krisp2 #1
3
makefile
3
makefile
@ -63,5 +63,6 @@ imageInputTests: imageInput.o imageInputTests.c $(unityfolder)/unity.c
|
||||
#else
|
||||
# rm -f *.o mnist runMatrixTests runNeuralNetworkTests runImageInputTests
|
||||
#endif
|
||||
# clean für windows
|
||||
clean:
|
||||
rm -f *.o *.exe
|
||||
rm -f *.o *.exe
|
||||
28
matrix.c
28
matrix.c
@ -20,9 +20,9 @@ void clearMatrix(Matrix *matrix) {
|
||||
matrix->cols = UNDEFINED_MATRIX_VALUE;
|
||||
free((*matrix).buffer); // Speicher freigeben
|
||||
}
|
||||
void setMatrixAt(MatrixType value, Matrix matrix,
|
||||
unsigned int rowIdx, // Kopie der Matrix wird übergeben
|
||||
unsigned int colIdx) {
|
||||
void setMatrixAt(const MatrixType value, Matrix matrix,
|
||||
const unsigned int rowIdx, // Kopie der Matrix wird übergeben
|
||||
const unsigned int colIdx) {
|
||||
|
||||
matrix.buffer[rowIdx * matrix.cols + colIdx] =
|
||||
value; // rowIdx * matrix.cols -> Beginn der Zeile colIdx ->Spalte
|
||||
@ -41,7 +41,25 @@ MatrixType getMatrixAt(const Matrix matrix,
|
||||
return value;
|
||||
}
|
||||
Matrix add(const Matrix matrix1, const Matrix matrix2) {
|
||||
// broadcasting
|
||||
return matrix1;
|
||||
|
||||
// Ergebnismatrix
|
||||
Matrix result;
|
||||
|
||||
// Broadcasting nur bei Vektor und Matrix, Fehlermeldung bei zwei unpassender
|
||||
// Matrix
|
||||
if (matrix1.rows != matrix2.rows) {
|
||||
|
||||
// check, which one is smaller
|
||||
// realloc
|
||||
}
|
||||
|
||||
if (matrix1.cols != matrix2.cols) {
|
||||
}
|
||||
|
||||
// Speicher reservieren
|
||||
|
||||
// Matrix addieren
|
||||
|
||||
return result;
|
||||
}
|
||||
Matrix multiply(const Matrix matrix1, const Matrix matrix2) { return matrix1; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user