ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts  1.0
ESP8266ILI9341DisplayProject
matrix.h
Go to the documentation of this file.
1 
24 #ifndef _MATRIX_H_
25 #define _MATRIX_H_
26 
27 typedef struct _mat {
28  float **data;
29  int cols;
30  int rows;
31  int size;
32 } mat_t;
33 
34 /* matrix.c */
35 MEMSPACE int TestSquare ( mat_t MatA );
36 MEMSPACE mat_t MatAlloc ( int rows , int cols );
38 MEMSPACE void MatFree ( mat_t matF );
39 MEMSPACE mat_t MatLoad ( void *V , int rows , int cols );
40 MEMSPACE mat_t MatLoadSQ ( void *V , int size );
41 MEMSPACE void MatPrint ( mat_t matrix );
42 MEMSPACE mat_t DeleteRowCol ( mat_t MatA , int row , int col );
43 MEMSPACE mat_t Transpose ( mat_t MatA );
44 MEMSPACE float Minor ( mat_t MatA , int row , int col );
45 MEMSPACE float Cofactor ( mat_t MatA , int row , int col );
46 MEMSPACE mat_t Adjugate ( mat_t MatA );
47 MEMSPACE float Determinant ( mat_t MatA );
48 MEMSPACE mat_t Invert ( mat_t MatA );
50 MEMSPACE mat_t MatMul ( mat_t MatA , mat_t MatB );
51 MEMSPACE mat_t MatRead ( char *name );
52 MEMSPACE int MatWrite ( char *name , mat_t MatW );
53 
54 
55 #endif // _MATRIX_H_
float ** data
Definition: matrix.h:28
MEMSPACE mat_t MatAllocSQ(int size)
Allocate a matrix.
Definition: matrix.c:105
MEMSPACE mat_t MatMul(mat_t MatA, mat_t MatB)
Multiply two matrix.
Definition: matrix.c:490
MEMSPACE mat_t Invert(mat_t MatA)
Calculate Matrix Inverse.
Definition: matrix.c:399
MEMSPACE int MatWrite(char *name, mat_t MatW)
Write a matrix.
Definition: matrix.c:605
MEMSPACE mat_t MatLoadSQ(void *V, int size)
Load a square matrix.
Definition: matrix.c:176
int cols
Definition: matrix.h:29
Definition: matrix.h:27
MEMSPACE mat_t Adjugate(mat_t MatA)
Adjugate is transpose of cofactor matrix of A.
Definition: matrix.c:325
int size
Definition: matrix.h:31
MEMSPACE mat_t Transpose(mat_t MatA)
Transpose matrix.
Definition: matrix.c:263
MEMSPACE int TestSquare(mat_t MatA)
Credits: https://www.cs.rochester.edu/~brown/Crypto/assts/projects/adj.html.
Definition: matrix.c:37
MEMSPACE mat_t MatAlloc(int rows, int cols)
Allocate a matrix.
Definition: matrix.c:48
int rows
Definition: matrix.h:30
MEMSPACE float Determinant(mat_t MatA)
Determinant by recursion using Cofactors.
Definition: matrix.c:350
struct _mat mat_t
#define MEMSPACE
Definition: cpu.h:25
MEMSPACE void MatPrint(mat_t matrix)
Print a matrix.
Definition: matrix.c:187
MEMSPACE mat_t PseudoInvert(mat_t MatA)
Calculate Pseudo Matrix Inverse Used for least square fitting of non square matrix with excess soluti...
Definition: matrix.c:456
MEMSPACE mat_t DeleteRowCol(mat_t MatA, int row, int col)
Create smaller matrix by deleatting specified row and colume Used by Minor and Cofactor.
Definition: matrix.c:212
MEMSPACE float Minor(mat_t MatA, int row, int col)
Compute determinate of the minor submatrix Minor submatrix has one less row and column as a result...
Definition: matrix.c:291
MEMSPACE float Cofactor(mat_t MatA, int row, int col)
Cofactor is determinate of minor submatrix * (-1)exp(row+col) Minor submatrix has one less row and co...
Definition: matrix.c:310
MEMSPACE mat_t MatRead(char *name)
Read a matrix.
Definition: matrix.c:527
MEMSPACE mat_t MatLoad(void *V, int rows, int cols)
Load a matrix.
Definition: matrix.c:152
MEMSPACE void MatFree(mat_t matF)
Free a matrix.
Definition: matrix.c:116