deleted unused functions

This commit is contained in:
Jakob Stornig 2023-09-24 22:36:40 +02:00
parent 1cfdf93f7c
commit 746f4cf3bd
2 changed files with 0 additions and 27 deletions

View file

@ -216,21 +216,6 @@ Matrix* scale(Matrix* matrix, double value) {
return result_matrix; return result_matrix;
} }
Matrix* addScalar(Matrix* matrix, double value) {
// create a copy of the original matrix
Matrix* result_matrix = matrix_copy(matrix);
// iterate over all numbers in the matrix and add the scalar value
for (int i = 0; i < result_matrix->rows; i++) {
for (int j = 0; j < result_matrix->columns; j++) {
result_matrix->numbers[i][j] += value;
}
}
// return the copy
return result_matrix;
}
Matrix* transpose(Matrix* matrix) { Matrix* transpose(Matrix* matrix) {
@ -249,16 +234,6 @@ 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){ void matrix_save(Matrix* matrix, char* file_string){
// open the file in append mode // open the file in append mode

View file

@ -36,6 +36,4 @@ Matrix* subtract(Matrix* matrix1, Matrix* matrix2);
Matrix* dot(Matrix* matrix1, Matrix* matrix2); Matrix* dot(Matrix* matrix1, Matrix* matrix2);
Matrix* apply(double (*function)(double), Matrix* matrix); Matrix* apply(double (*function)(double), Matrix* matrix);
Matrix* scale(Matrix* matrix, double value); Matrix* scale(Matrix* matrix, double value);
Matrix* addScalar(Matrix* matrix, double value);
Matrix* transpose(Matrix* matrix); Matrix* transpose(Matrix* matrix);
double matrix_sum(Matrix* matrix);