Subversion Repositories FlightCtrl

Rev

Blame | Last modification | View Log | RSS feed

/*****************************************************************************
  INCLUDES
**************************************************************************** */

#include "math.h"
#include "float.h"
#include "stdlib.h"


/*****************************************************************************
  TYPEDEFS
*****************************************************************************/

#define f32_t float
#define ui32_t unsigned int
#define i32_t int

#define PI 3.1415926535897932384626433832795
#define matSetDiagonal(matM,Row,Column,X)           (matM)->pdData[(Row)] = (X)
#define matSetFull(matM,Row,Column,X)               (matM)->pdData[(Row) * (matM)->uiColumns + (Column)] = (X)
#define matGetFull(matM,Row,Column,X)              *(X) = (matM)->pdData[(Row) * (matM)->uiColumns + (Column)]
#define matGetDiagonal(matM,Row,Column,X)          *(X) = (matM)->pdData[(Row)]


typedef enum
{
   matType_Empty                      = 0,      /* empty matrix */
   matType_Full,                                /* full matrix */
   matType_Symmetric,                           /* symmetric matrix */
   matType_UpperTriangular,                     /* upper triangular matrix */
   matType_Diagonal,                            /* diagonal matrix */
   matTypeMax                                   /* number of different types of matrices */
} mat_MatrixType_e;

typedef struct
{
   mat_MatrixType_e  matType;        /* type of matrix */
   ui32_t               uiSizeofData;   /* needed for MEM_free */
   ui32_t               uiRows;         /* number of rows of matrix */
   ui32_t               uiColumns;      /* number of columns of matrix */
   ui32_t               uiElements;     /* number of elements in matrix */
   f32_t*              pdData;         /* pointer to the entries of the matrix */
} mat_Matrix_t;