39 "U(0, 0) incorrect.");
41 "U(1, 0) incorrect.");
57 "U(0, 0) incorrect.");
59 "U(1, 0) incorrect.");
61 "U(2, 0) incorrect.");
63 "U(3, 0) incorrect.");
66 "U(0, 1) incorrect.");
68 "U(1, 1) incorrect.");
70 "U(2, 1) incorrect.");
72 "U(3, 1) incorrect.");
75 "U(0, 2) incorrect.");
77 "U(1, 2) incorrect.");
79 "U(2, 2) incorrect.");
81 "U(3, 2) incorrect.");
108 mu_assert(fabs(model->
UU[0] - 0.0000000000000000) < 1e-14,
109 "Incorrect value of model->UU at 0");
110 mu_assert(fabs(model->
UU[1] - 0.0000000000000000) < 1e-14,
111 "Incorrect value of model->UU at 1");
112 mu_assert(fabs(model->
UU[2] - 0.0000000000000000) < 1e-14,
113 "Incorrect value of model->UU at 2");
114 mu_assert(fabs(model->
UU[3] - -1.0000000000000000) < 1e-14,
115 "Incorrect value of model->UU at 3");
116 mu_assert(fabs(model->
UU[4] - 0.0000000000000000) < 1e-14,
117 "Incorrect value of model->UU at 4");
118 mu_assert(fabs(model->
UU[5] - 0.0000000000000000) < 1e-14,
119 "Incorrect value of model->UU at 5");
120 mu_assert(fabs(model->
UU[6] - -0.5000000000000000) < 1e-14,
121 "Incorrect value of model->UU at 6");
122 mu_assert(fabs(model->
UU[7] - -0.8660254037844388) < 1e-14,
123 "Incorrect value of model->UU at 7");
124 mu_assert(fabs(model->
UU[8] - 0.0000000000000000) < 1e-14,
125 "Incorrect value of model->UU at 8");
126 mu_assert(fabs(model->
UU[9] - -0.5000000000000000) < 1e-14,
127 "Incorrect value of model->UU at 9");
128 mu_assert(fabs(model->
UU[10] - -0.2886751345948129) < 1e-14,
129 "Incorrect value of model->UU at 10");
130 mu_assert(fabs(model->
UU[11] - -0.8164965809277261) < 1e-14,
131 "Incorrect value of model->UU at 11");
132 mu_assert(fabs(model->
UU[12] - 1.0000000000000000) < 1e-14,
133 "Incorrect value of model->UU at 12");
134 mu_assert(fabs(model->
UU[13] - 0.0000000000000000) < 1e-14,
135 "Incorrect value of model->UU at 13");
136 mu_assert(fabs(model->
UU[14] - 0.0000000000000000) < 1e-14,
137 "Incorrect value of model->UU at 14");
138 mu_assert(fabs(model->
UU[15] - 0.0000000000000000) < 1e-14,
139 "Incorrect value of model->UU at 15");
140 mu_assert(fabs(model->
UU[16] - 0.0000000000000000) < 1e-14,
141 "Incorrect value of model->UU at 16");
142 mu_assert(fabs(model->
UU[17] - 0.0000000000000000) < 1e-14,
143 "Incorrect value of model->UU at 17");
144 mu_assert(fabs(model->
UU[18] - 0.5000000000000000) < 1e-14,
145 "Incorrect value of model->UU at 18");
146 mu_assert(fabs(model->
UU[19] - -0.8660254037844388) < 1e-14,
147 "Incorrect value of model->UU at 19");
148 mu_assert(fabs(model->
UU[20] - 0.0000000000000000) < 1e-14,
149 "Incorrect value of model->UU at 20");
150 mu_assert(fabs(model->
UU[21] - 0.5000000000000000) < 1e-14,
151 "Incorrect value of model->UU at 21");
152 mu_assert(fabs(model->
UU[22] - -0.2886751345948129) < 1e-14,
153 "Incorrect value of model->UU at 22");
154 mu_assert(fabs(model->
UU[23] - -0.8164965809277261) < 1e-14,
155 "Incorrect value of model->UU at 23");
156 mu_assert(fabs(model->
UU[24] - 0.5000000000000000) < 1e-14,
157 "Incorrect value of model->UU at 24");
158 mu_assert(fabs(model->
UU[25] - 0.8660254037844388) < 1e-14,
159 "Incorrect value of model->UU at 25");
160 mu_assert(fabs(model->
UU[26] - 0.0000000000000000) < 1e-14,
161 "Incorrect value of model->UU at 26");
162 mu_assert(fabs(model->
UU[27] - -0.5000000000000000) < 1e-14,
163 "Incorrect value of model->UU at 27");
164 mu_assert(fabs(model->
UU[28] - 0.8660254037844388) < 1e-14,
165 "Incorrect value of model->UU at 28");
166 mu_assert(fabs(model->
UU[29] - 0.0000000000000000) < 1e-14,
167 "Incorrect value of model->UU at 29");
168 mu_assert(fabs(model->
UU[30] - 0.0000000000000000) < 1e-14,
169 "Incorrect value of model->UU at 30");
170 mu_assert(fabs(model->
UU[31] - 0.0000000000000000) < 1e-14,
171 "Incorrect value of model->UU at 31");
172 mu_assert(fabs(model->
UU[32] - 0.0000000000000000) < 1e-14,
173 "Incorrect value of model->UU at 32");
174 mu_assert(fabs(model->
UU[33] - 0.0000000000000000) < 1e-14,
175 "Incorrect value of model->UU at 33");
176 mu_assert(fabs(model->
UU[34] - 0.5773502691896258) < 1e-14,
177 "Incorrect value of model->UU at 34");
178 mu_assert(fabs(model->
UU[35] - -0.8164965809277261) < 1e-14,
179 "Incorrect value of model->UU at 35");
180 mu_assert(fabs(model->
UU[36] - 0.5000000000000000) < 1e-14,
181 "Incorrect value of model->UU at 36");
182 mu_assert(fabs(model->
UU[37] - 0.2886751345948129) < 1e-14,
183 "Incorrect value of model->UU at 37");
184 mu_assert(fabs(model->
UU[38] - 0.8164965809277261) < 1e-14,
185 "Incorrect value of model->UU at 38");
186 mu_assert(fabs(model->
UU[39] - -0.5000000000000000) < 1e-14,
187 "Incorrect value of model->UU at 39");
188 mu_assert(fabs(model->
UU[40] - 0.2886751345948129) < 1e-14,
189 "Incorrect value of model->UU at 40");
190 mu_assert(fabs(model->
UU[41] - 0.8164965809277261) < 1e-14,
191 "Incorrect value of model->UU at 41");
192 mu_assert(fabs(model->
UU[42] - 0.0000000000000000) < 1e-14,
193 "Incorrect value of model->UU at 42");
194 mu_assert(fabs(model->
UU[43] - -0.5773502691896258) < 1e-14,
195 "Incorrect value of model->UU at 43");
196 mu_assert(fabs(model->
UU[44] - 0.8164965809277261) < 1e-14,
197 "Incorrect value of model->UU at 44");
198 mu_assert(fabs(model->
UU[45] - 0.0000000000000000) < 1e-14,
199 "Incorrect value of model->UU at 45");
200 mu_assert(fabs(model->
UU[46] - 0.0000000000000000) < 1e-14,
201 "Incorrect value of model->UU at 46");
202 mu_assert(fabs(model->
UU[47] - 0.0000000000000000) < 1e-14,
203 "Incorrect value of model->UU at 47");
Minimal unit testing framework for C.
#define Calloc(type, size)
char * test_gensvm_simplex_diff()
void gensvm_simplex(struct GenModel *model)
Generate matrix of simplex vertex coordinates.
double * UU
simplex difference matrix
#define mu_assert(test, message)
#define matrix_get(M, cols, i, j)
void gensvm_free_model(struct GenModel *model)
Free allocated GenModel struct.
#define mu_run_test(test)
struct GenModel * gensvm_init_model(void)
Initialize a GenModel structure.
void gensvm_simplex_diff(struct GenModel *model)
Generate the simplex difference matrix.
A structure to represent the data.
A structure to represent a single GenSVM model.
long n
number of instances in the dataset
void gensvm_free_data(struct GenData *data)
Free allocated GenData struct.
void gensvm_allocate_model(struct GenModel *model)
Allocate memory for a GenModel.
Header file for gensvm_simplex.c.
long K
number of classes in the dataset
long m
number of predictors (width of RAW)
long n
number of instances
struct GenData * gensvm_init_data(void)
Initialize a GenData structure.
long m
number of predictor variables in the dataset