From 746f4cf3bd716b5ded967b3a29c3d4e246f76009 Mon Sep 17 00:00:00 2001 From: Jakob Stornig Date: Sun, 24 Sep 2023 22:36:40 +0200 Subject: [PATCH] deleted unused functions --- matrix.c | 25 ------------------------- matrix.h | 2 -- 2 files changed, 27 deletions(-) diff --git a/matrix.c b/matrix.c index ba7c258..2a9acfc 100644 --- a/matrix.c +++ b/matrix.c @@ -216,21 +216,6 @@ Matrix* scale(Matrix* matrix, double value) { 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) { @@ -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){ // open the file in append mode diff --git a/matrix.h b/matrix.h index 2e0e5a9..4ece217 100644 --- a/matrix.h +++ b/matrix.h @@ -36,6 +36,4 @@ Matrix* subtract(Matrix* matrix1, Matrix* matrix2); Matrix* dot(Matrix* matrix1, Matrix* matrix2); Matrix* apply(double (*function)(double), Matrix* matrix); Matrix* scale(Matrix* matrix, double value); -Matrix* addScalar(Matrix* matrix, double value); Matrix* transpose(Matrix* matrix); -double matrix_sum(Matrix* matrix); \ No newline at end of file