DuQuad  v1.0
Quadratic Programming Optimizations
 All Data Structures Files Functions Variables Typedefs Macros
head.h
Go to the documentation of this file.
1 /*
2  * head.h
3  *
4  * Created on: Aug 19, 2014
5  * Author: Sverre
6  */
7 
8 /** \file
9  * Contains system libraries, mex libraries, global constants, global variables and some debugging macros.
10  */
11 #ifndef HEAD_H_
12 #define HEAD_H_
13 
14 // *** System header files ***
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <math.h>
18 #include <time.h>
19 #include <errno.h>
20 
21 #include "typedefs.h"
22 #include "qp_structs.h"
23 
24 //#include <matrix.h>
25 //#include <mex.h>
26 //#include <string.h>
27 
28 // *** Global constants ***
29 #define TRUE 1
30 #define FALSE 0
31 
32 // Global variables
33 uint32_t N; /**< Dimension of the Hessian matrix */
34 uint32_t M; /**< Dimension of the linear constraint matrix */
36 
37 // *** Macros ***
38 #ifdef DEBUG
39  #define _DEBUG(fmt, args...) printf("%s:%s:%d: "fmt, __FILE__, __FUNCTION__, __LINE__, args)
40 #else
41  #define _DEBUG(fmt, args...)
42 #endif
43 #ifdef DEBUG2
44  #define _DEBUG2(fmt, args...) printf("%s:%s:%d: "fmt, __FILE__, __FUNCTION__, __LINE__, args)
45 #else
46  #define _DEBUG2(fmt, args...)
47 #endif
48 /* Use: _DEBUG("hello world", arg)
49 add <-D -DEBUG> in gcc comand to compiler
50 e.g.: mex -O CFLAGS="\$CFLAGS -D DEBUG -std=c99" main.c calculations.c
51 Note: will not work if no 'arg' is used */
52 
53 #define YO printf("YOYO\n")
54 #define ERROR(fmt) fprintf(stderr,"%s:%s:%d: "fmt, __FILE__, __FUNCTION__, __LINE__);
55 
56 // A Simpler debug (without arguments)
57 #ifdef SDEBUG
58  #define _SDEBUG(fmt) printf("%s:%s:%d: "fmt, __FILE__, __FUNCTION__, __LINE__)
59 #else
60  #define _SDEBUG(fmt)
61 #endif
62 
63 
64 
65 #endif /* HEAD_H_ */
unsigned int uint32_t
Definition: typedefs.h:19
uint32_t ALGORITHM
Definition: head.h:35
uint32_t M
Definition: head.h:34
uint32_t N
Definition: head.h:33