From 16175429d26b6803fd0249d5bbab6eb4cfe6e60b Mon Sep 17 00:00:00 2001 From: Jasper Date: Fri, 5 Sep 2025 14:45:34 +0200 Subject: 'matrix_is_square' is now a macro --- matrix.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'matrix.h') diff --git a/matrix.h b/matrix.h index 2546152..c3138e2 100644 --- a/matrix.h +++ b/matrix.h @@ -17,6 +17,8 @@ #define matrix_is_vec(mat) (matrix_is_colvec(mat) || matrix_is_rowvec(mat)) +#define matrix_is_square(mat) ((mat)->m == (mat)->n) + #define TRUE 1 #define FALSE 0 @@ -59,7 +61,6 @@ Matrix *matrix_scale(const Matrix *A, double x); Matrix *matrix_sub(const Matrix *A, const Matrix *B); Matrix *matrix_mult(const Matrix *A, const Matrix *B); Matrix *matrix_rand(size_t m, size_t n, int bound_l, int bound_u, MatrixType type); -int matrix_is_square(const Matrix *mat); int matrix_eq(const Matrix *A, const Matrix *B, double tol); double matrix_norm_frob(const Matrix *mat); Matrix **matrix_LR(const Matrix *A, const Matrix *b); -- cgit v1.2.3