diff options
Diffstat (limited to 'matrix.h')
-rw-r--r-- | matrix.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -19,9 +19,6 @@ #define matrix_is_square(mat) ((mat)->m == (mat)->n) -#define TRUE 1 -#define FALSE 0 - typedef enum { MATRIX_DIAG, MATRIX_TRIAG_UPPER, @@ -51,17 +48,23 @@ 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); -int matrix_eq(const Matrix *A, const Matrix *B, double tol); +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); |