GenSVM
gensvm_globals.h
Go to the documentation of this file.
1 
36 #ifndef GENSVM_GLOBALS_H
37 #define GENSVM_GLOBALS_H
38 
39 #include "gensvm_memory.h"
40 
41 // all system libraries are included here
42 #include <cblas.h>
43 #include <ctype.h>
44 #include <errno.h>
45 #include <limits.h>
46 #include <math.h>
47 #include <stdarg.h>
48 #include <stdbool.h>
49 #include <stdio.h>
50 #include <stdlib.h>
51 #include <string.h>
52 #include <time.h>
53 
54 // ########################### Type definitions ########################### //
55 
59 typedef enum {
60  CV=0,
61  TT=1
62 } TrainType;
63 
67 typedef enum {
69  K_POLY=1,
70  K_RBF=2,
72 } KernelType;
73 
74 // ########################### Global constants ########################### //
75 
79 #ifndef GENSVM_MAX_LINE_LENGTH
80  #define GENSVM_MAX_LINE_LENGTH 1024
81 #endif
82 
83 // ###################### Min/Max Utility Functions ####################### //
84 
85 #ifndef MIN_MAX_DEFINE
86 
90  #define MIN_MAX_DEFINE
91 
94  #define maximum(a, b) (a) > (b) ? (a) : (b)
95 
98  #define minimum(a, b) (a) < (b) ? (a) : (b)
99 #endif
100 
101 // ####################### Matrix Utility Functions ####################### //
102 
106 #define matrix_set(M, cols, i, j, val) M[(i)*(cols)+j] = val
107 
111 #define matrix_get(M, cols, i, j) M[(i)*(cols)+j]
112 
116 #define matrix_add(M, cols, i, j, val) M[(i)*(cols)+j] += val
117 
121 #define matrix_mul(M, cols, i, j, val) M[(i)*(cols)+j] *= val
122 
123 // ######################### Other Macros ################################# //
124 
125 // from: http://stackoverflow.com/q/195975/
126 
127 #define GENSVM_QUOTE(name) #name
128 #define GENSVM_STRING(macro) GENSVM_QUOTE(macro)
129 
130 #ifndef VERSION
131  #define VERSION 0.0.0
132 #endif
133 
134 #define VERSION_STRING GENSVM_STRING(VERSION)
135 
136 
137 #endif
TrainType
type of training used in parameter grid search
Header file for gensvm_memory.c.
KernelType
type of kernel used in training