diff options
Diffstat (limited to 'matrix.h')
-rw-r--r-- | matrix.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -16,6 +16,11 @@ typedef enum { MATRIX_NONE } MatrixType; +typedef enum { + MATRIX_SWAP_ROWS, + MATRIX_SWAP_COLS +} MatrixSwapType; + typedef struct { double *xs; size_t m; @@ -32,10 +37,8 @@ char *matrix_to_str(const Matrix *mat); Matrix *matrix_id(size_t n); Matrix *matrix_const(size_t m, size_t n, double x); Matrix *matrix_copy (const Matrix *mat); -Matrix *matrix_swap_rows(const Matrix *mat, size_t i, size_t j); -void matrix_swap_rows1(Matrix *mat, size_t i, size_t j); -Matrix *matrix_swap_cols(const Matrix *mat, size_t i, size_t j); -void matrix_swap_cols1(const Matrix *mat, size_t i, size_t j); +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); |