53#define la_matrix_element(matrix, row, col) \
54 (matrix).data[(row) * (matrix).stride + (col)]
420 size_t new_rows,
size_t new_cols);
451 int digits_before_dot, FILE* fp);
475#define la_matrix_print(matrix) \
476 la_matrix_fprint((matrix), #matrix, 6, 3, stdout)
512 int precision,
int digits_before_dot, FILE* fp);
562 double (*f)(
double));
void la_matrix_copy(la_matrix dest, la_matrix src)
Copy the contents of one matrix to another matrix.
la_matrix la_submatrix(la_matrix src, size_t row_start, size_t col_start, size_t new_rows, size_t new_cols)
Extract a submatrix from a given matrix.
void la_matrix_multiply_by_const(la_matrix src, const double x)
Multiply all elements of the matrix by a constant.
void la_matrix_sum_rows(la_matrix dest, la_matrix src)
Calculate the sum of elements in each row of the source matrix and store the result in the destinatio...
void la_matrix_add(la_matrix a, la_matrix b, la_matrix result)
Add two matrices element-wise and store the result in a third matrix.
struct la_matrix la_matrix
Structure representing a matrix.
void la_matrix_fill(la_matrix matrix, double value)
Fill a matrix with a specific value.
void la_matrix_T_copy(la_matrix dest, la_matrix src)
Copy the transpose of the source matrix to the destination matrix.
la_matrix la_matrix_alloc(size_t rows, size_t cols)
Allocate memory for a matrix.
void la_matrix_get_max_index(la_matrix src, size_t *x, size_t *y)
Get the indices of the maximum element in the matrix.
void la_matrix_multiply(la_matrix a, la_matrix b, la_matrix result)
Multiply two matrices and store the result in a third matrix.
void la_matrix_get_min_index(la_matrix src, size_t *x, size_t *y)
Get the indices of the minimum element in the matrix.
void la_matrix_apply_function(la_matrix dest, la_matrix src, double(*f)(double))
Apply a function to each element of the source matrix and store the result in the destination matrix.
void la_matrix_subtract(la_matrix a, la_matrix b, la_matrix result)
Subtract two matrices element-wise and store the result in a third matrix.
void la_matrix_rand(la_matrix matrix, double minvalue, double maxvalue)
Fill a matrix with random values within a specified range.
double la_matrix_sum(la_matrix src)
Calculate the sum of all elements in the matrix.
void la_matrix_fprint(la_matrix matrix, char *name, int precision, int digits_before_dot, FILE *fp)
Print the contents of a matrix to a file with a specified precision.
void la_matrix_fprint_simul(la_matrix *matrices, char **names, size_t n, int precision, int digits_before_dot, FILE *fp)
Print the contents of multiple matrices to a file with a specified precision.
void la_matrix_free(la_matrix matrix)
Free memory for a matrix.
Structure representing a matrix.