diff options
author | Jasper | 2025-09-01 20:12:18 +0200 |
---|---|---|
committer | Jasper | 2025-09-01 20:12:18 +0200 |
commit | e4d20a643de1e1e404b74a8b13b76ba62125369d (patch) | |
tree | 7b4efbb3aa616cdb893a7ffb708829795b66f1f2 /matrix.c | |
parent | bc4215edfd34590c8078b3bb459005807d36c5cf (diff) |
Swap order of arguments for matrix_scale()
Diffstat (limited to 'matrix.c')
-rw-r--r-- | matrix.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -206,7 +206,7 @@ Matrix *matrix_add(const Matrix *A, const Matrix *B) return C; } -Matrix *matrix_scale(double x, const Matrix *A) +Matrix *matrix_scale(const Matrix *A, double x) { Matrix *tmp = matrix_alloc(A->m, A->n); @@ -221,7 +221,7 @@ Matrix *matrix_scale(double x, const Matrix *A) Matrix *matrix_sub(const Matrix *A, const Matrix *B) { - return matrix_add(A, matrix_scale(-1, B)); + return matrix_add(A, matrix_scale(B, -1)); } Matrix *matrix_mult(const Matrix *A, const Matrix *B) |