Krisp2 #1

Merged
hofmannkr98890 merged 6 commits from Krisp2 into main 2025-11-20 13:48:44 +00:00
2 changed files with 25 additions and 6 deletions
Showing only changes of commit 858673bdca - Show all commits

View File

@ -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

View File

@ -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; }