Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
838 MikeW 1
/*****************************************************************************
2
  INCLUDES
3
**************************************************************************** */
4
#include "math.h"
5
#include "float.h"
6
#include "stdlib.h"
7
 
8
 
9
/*****************************************************************************
10
  TYPEDEFS
11
*****************************************************************************/
12
#define f32_t float 
13
#define ui32_t unsigned int 
14
#define i32_t int 
15
 
16
#define PI 3.1415926535897932384626433832795
17
#define matSetDiagonal(matM,Row,Column,X)           (matM)->pdData[(Row)] = (X)
18
#define matSetFull(matM,Row,Column,X)               (matM)->pdData[(Row) * (matM)->uiColumns + (Column)] = (X)
19
#define matGetFull(matM,Row,Column,X)              *(X) = (matM)->pdData[(Row) * (matM)->uiColumns + (Column)]
20
#define matGetDiagonal(matM,Row,Column,X)          *(X) = (matM)->pdData[(Row)]
21
 
22
 
23
typedef enum
24
{
25
   matType_Empty                      = 0,      /* empty matrix */
26
   matType_Full,                                /* full matrix */
27
   matType_Symmetric,                           /* symmetric matrix */
28
   matType_UpperTriangular,                     /* upper triangular matrix */
29
   matType_Diagonal,                            /* diagonal matrix */
30
   matTypeMax                                   /* number of different types of matrices */
31
} mat_MatrixType_e;
32
 
33
typedef struct
34
{
35
   mat_MatrixType_e  matType;        /* type of matrix */
36
   ui32_t               uiSizeofData;   /* needed for MEM_free */
37
   ui32_t               uiRows;         /* number of rows of matrix */
38
   ui32_t               uiColumns;      /* number of columns of matrix */
39
   ui32_t               uiElements;     /* number of elements in matrix */
40
   f32_t*              pdData;         /* pointer to the entries of the matrix */
41
} mat_Matrix_t;
42