loss function and support functions
This commit is contained in:
parent
0f7a0a5f11
commit
f18a7714a2
4 changed files with 32 additions and 7 deletions
10
matrix.c
10
matrix.c
|
|
@ -249,6 +249,16 @@ Matrix* transpose(Matrix* matrix) {
|
|||
|
||||
}
|
||||
|
||||
double matrix_sum(Matrix* matrix) {
|
||||
double sum = 0;
|
||||
for (int i = 0; i < matrix->rows; i++) {
|
||||
for (int j = 0; j < matrix->columns; j++) {
|
||||
sum += matrix->numbers[i][j];
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
void matrix_save(Matrix* matrix, char* file_string){
|
||||
|
||||
// open the file in append mode
|
||||
|
|
|
|||
Reference in a new issue