![](/media/cache/group/Diana_su_nero.jpg.50x50_q85.jpg)
test_IPKF
Dependencies: mbed
matrix.h File Reference
File containing the function to manipulates matrices. More...
Go to the source code of this file.
Data Structures | |
struct | s_matrix |
struct matrix allows to execute matrix computation More... | |
Typedefs | |
typedef struct s_matrix | matrix |
struct matrix allows to execute matrix computation | |
Functions | |
int | CreateMatrix (matrix *m) |
this function allows to allocate a matrix in memory | |
void | DeleteMatrix (matrix *m) |
this function allows to delete from memory a matrix struct | |
int | InitMatrix (matrix *m, int row, int col) |
this function initialize a matrix | |
int | MxM (matrix *a, matrix *b, matrix *r) |
this function allows to compute the product between 2 matrices | |
int | axM (matrix *m, float a, matrix *r) |
this function allows to compute the product between a scalar and a matrix | |
int | Sum (matrix *a, matrix *b, matrix *r) |
this function allows to compute the sum between two matrices | |
int | Sub (matrix *a, matrix *b, matrix *r) |
this function allows to compute the subtraction between two matrices | |
int | Traspost (matrix *m, matrix *r) |
this function allows to compute the traspost of a matrix | |
int | Inv (matrix *m, matrix *inv_m) |
this function allows to compute the inverse of a matrix using the Gauss algorithm | |
void | CrossProd (matrix *v, matrix *w, matrix *r) |
Computes the cross product between two vectors. | |
void | Print_Matrix (matrix *m) |
print the matrix in the prompt |
Detailed Description
File containing the function to manipulates matrices.
- Date:
- 20/3/2016
Definition in file matrix.h.
Typedef Documentation
Function Documentation
this function allows to compute the product between a scalar and a matrix
- Parameters:
-
m is the pointer to the matrix a is the scalar number r is the pointer to the result
- Returns:
- 0 if the the product is computed correctly
- 1 if the number of row of a is different from number of row of r
- 2 if the number of col of a is different from number of col of r
int CreateMatrix | ( | matrix * | m ) |
void DeleteMatrix | ( | matrix * | m ) |
int InitMatrix | ( | matrix * | m, |
int | row, | ||
int | col | ||
) |
this function initialize a matrix
- Parameters:
-
m is the pointer to the matrix to initialize row is the number of row of the matrix col is the number of column of the matrix
- Returns:
- 0 if the allocation is done correctly
- 1 if there is not enough space in memory to create a new matrix
this function allows to compute the inverse of a matrix using the Gauss algorithm
- Parameters:
-
m is the pointer to the original matrix inv_m is the pointer to the result
- Returns:
- 0 if the inversion is done correctly
- 1 if m is not a square matrix
- 2 if the number of row of m is different from the row of inv_m
- 3 if the number of column of m is different from the column of inv_m
- 4 if m is not invertible
this function allows to compute the product between 2 matrices
- Parameters:
-
a is the first element of the product b is the second element of the product r is the matrix which will contain the result
- Returns:
- 0 if the product is computed correctly
- 1 if the number of column of a is different from the row of b
- 2 if the number of row of a is different from number of row of r
- 3 if the number of column of b is different from number of column of r
void Print_Matrix | ( | matrix * | m ) |
this function allows to compute the subtraction between two matrices
- Parameters:
-
a is the pointer to the first matrix b is the pointer to the second matrix c is the pointer to the result
- Returns:
- 0 if the subtraction is computed correctly
- 1 if the number of column of a is different from the column of b
- 2 if the number of row of a is different from number of row of b
- 3 if the number of row of a is different from number of row of r
- 4 if the number of column of a is different from number of column of r
this function allows to compute the sum between two matrices
- Parameters:
-
a is the pointer to the first matrix b is the pointer to the second matrix c is the pointer to the result
- Returns:
- 0 if the sum is computed correctly
- 1 if the number of column of a is different from the column of b
- 2 if the number of row of a is different from number of row of b
- 3 if the number of row of a is different from number of row of r
- 4 if the number of column of a is different from number of column of r
this function allows to compute the traspost of a matrix
- Parameters:
-
m is the pointer to the matrix to be trasposed r is the pointer to the result
- Returns:
- 0 if the operation is done correctly
- 1 if the number of row of m is different from the column of r
- 2 if the number of column of m is different from the row of r
Generated on Tue Jul 12 2022 11:35:17 by
![doxygen](doxygen.png)