summaryrefslogtreecommitdiff
path: root/matrix.h
diff options
context:
space:
mode:
authorJasper2025-09-08 10:50:07 +0200
committerJasper2025-09-08 10:50:07 +0200
commitf8ec4383f4bdfd9e0d582c2ece55fe22ce08d61c (patch)
treef07a0c13e7e6fa7b56b8a6edd4c60812183f7743 /matrix.h
parent1386f6dc5024937c8c9c741efed9274d4861b76f (diff)
Formatting
Diffstat (limited to 'matrix.h')
-rw-r--r--matrix.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/matrix.h b/matrix.h
index 75e605e..85dfa2b 100644
--- a/matrix.h
+++ b/matrix.h
@@ -40,34 +40,53 @@ typedef struct {
} Matrix;
Matrix *matrix_alloc(size_t m, size_t n);
+
void matrix_free(Matrix *mat);
void matrix_freen(Matrix **mats);
+
void matrix_print(const Matrix *mat);
+
Matrix *matrix_from_str(char *str);
Matrix *matrix_from_arr(double arr[], size_t m, size_t n);
char *matrix_to_str(const Matrix *mat);
+
Matrix *matrix_id(size_t n);
+
Matrix *matrix_const(size_t m, size_t n, double x);
void matrix_const1(Matrix *mat, double x);
+
Matrix *matrix_copy (const Matrix *mat);
void matrix_copy1(Matrix *A, const Matrix *B);
+
Matrix *matrix_swap(const Matrix *mat, MatrixSwapType t, size_t i, size_t j);
void matrix_swap1(Matrix *mat, MatrixSwapType t, size_t i, size_t j);
+
double matrix_trace(const Matrix *mat);
+
Matrix *matrix_transpose(const Matrix *mat);
+
Matrix *matrix_add(const Matrix *A, const Matrix *B);
void matrix_add1(Matrix *A, const Matrix *B);
+
Matrix *matrix_scale(const Matrix *A, double x);
void matrix_scale1(Matrix *A, double x);
+
Matrix *matrix_sub(const Matrix *A, const Matrix *B);
void matrix_sub1(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);
void matrix_rand1(Matrix *mat, int bound_l, int bound_u, MatrixType type);
+
bool 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);
+
Matrix *matrix_forwardel(const Matrix *L, const Matrix *b);
+
Matrix *matrix_backsubst(const Matrix *R, const Matrix *y);
#endif