#include <stdbool.h>Go to the source code of this file.
Classes | |
| struct | Matrix |
Typedefs | |
| typedef struct Matrix | Matrix |
Functions | |
| Matrix * | create_matrix (int rows, int columns) |
Returns a pointer to a Matrix with rows rows and columns columns. Note that the new matrix is empty, but it's elemnts are, by default 0. More... | |
| void | read_matrix (Matrix *a) |
| Utility function used to read a matrix from the standard input. More... | |
| int | print_matrix (Matrix *a) |
| utility function used to print a matrix to the standar output. More... | |
| Matrix * | get_minor (Matrix *a, int line, int column) |
| Returns the minorant of a matrix by a specific row and column. More... | |
| void | multiply_matrix_with_scalar (Matrix *a, double scalar) |
Multiplies a matrix a with an scalar. Note that the new value of the matrix will be the result of this operation. More... | |
| int | get_transpose (Matrix *a, Matrix **transpose) |
Stores the transpose of the matrix a in the matrix transpose. More... | |
| void | destroy_matrix (Matrix *a) |
| int | compute_inverse (Matrix *a) |
Computes the inverse of the matrix a. Note that the inverse of matrix a will be stored in the inverse member of a. So, after calling this function you will access the inverse of a like this: a->inverse. More... | |
| double | get_determinant (Matrix *a) |
| Returns the determinant of a matrix. More... | |
| int | multiply_matrices (Matrix *a, Matrix *b, Matrix **result) |
Multiplies the matrices a and b and stores their results in the matrix result. Note that the function will alocate memory for the matrix result. More... | |
| int | add_matrices (Matrix *a, Matrix *b, Matrix **result) |
| Use this function to add 2 matrices. Note that the result will be stored in a third matrix. More... | |
| void | copy_matrix (Matrix *a, Matrix **destination) |
Copies the contents of the matrix a to the matrix destinaation. More... | |
| Matrix * | matrix_pow (Matrix *a, int power) |
raise the matrix a to the power power. More... | |
| bool | compare_matrices (Matrix *a, Matrix *b) |
| Use this function to compare to matrices. The criteria used to compare the matrices are the dimensions and the actual values of the 2 matrices. More... | |
Use this function to compare to matrices. The criteria used to compare the matrices are the dimensions and the actual values of the 2 matrices.
| a | An instance of struct matrix. |
| b | An instance of sruct martix. |
| int compute_inverse | ( | Matrix * | a | ) |
Computes the inverse of the matrix a. Note that the inverse of matrix a will be stored in the inverse member of a. So, after calling this function you will access the inverse of a like this: a->inverse.
| a | The matrix that we want to compute inverse of. |
Copies the contents of the matrix a to the matrix destinaation.
| a | The matrix whose contents we will copy. |
| destination | The matrix where the contents of a will be stored. Note that the functio doesn't allocate memory for destination you should create this matrix by yourself. |
| Matrix* create_matrix | ( | int | rows, |
| int | columns | ||
| ) |
| void destroy_matrix | ( | Matrix * | a | ) |
Dealocates the memory allocated for a matrix, after calling this function on a matrix all memory used for that matrix will be dealocated, this includes, also, the memory alocate for it's inverse.
| a | The matrix that should be destroyed. |
| double get_determinant | ( | Matrix * | a | ) |
Returns the determinant of a matrix.
| a | The matrix whose determinant will be computed. |
a. Returns the minorant of a matrix by a specific row and column.
| a | The matrix that we want to compute the minorant of. |
| line | The line That should be elimined when selecting the minorant. |
| colum | The column that should be elimined when computing the minorant. |
Stores the transpose of the matrix a in the matrix transpose.
| a | The matrix that the transpose of we will compute. |
| transpose | This matrix will hold the value of the matrix a. Note that you should pass a reference to the matrix transpose. That's the way a call to this function would look like: get_transpose(some_matrix, &transpose_of_a). Also, keep in mind that the matrix transpose doesn't need to be initialized, the function will do that for you; |
transpose can't be created and NO_ERROR if all wen ok. raise the matrix a to the power power.
| a | The matrix that will be raised to the power power. |
| power | The power that the matrix a will be raised to. |
a to power. Multiplies the matrices a and b and stores their results in the matrix result. Note that the function will alocate memory for the matrix result.
| a | The matrix who will be multiplied with matrix b. |
| b | The matrix wo will be multiplied with matrix a. |
a doesn't have the same number of lines as the matrix b, CANT_CREATE_MATRIX if the function can't allocate memory for the matrix result and NO_ERROR if the matrices successully multiplied. | void multiply_matrix_with_scalar | ( | Matrix * | a, |
| double | scalar | ||
| ) |
Multiplies a matrix a with an scalar. Note that the new value of the matrix will be the result of this operation.
| a | The matrix that should be multiplied with an scalar. |
| scalar | The scalar that should be multiplied withe the matrix a. |
| int print_matrix | ( | Matrix * | a | ) |
utility function used to print a matrix to the standar output.
| a | The matrix that should be printed. |
| void read_matrix | ( | Matrix * | a | ) |
Utility function used to read a matrix from the standard input.
| a | The matrix in which the readed elements will be stored. |
void It doesn't return anything.
1.8.6