16 using namespace shogun;
25 const char* description) {
27 add_type(&type, param, name, description);
32 const char* description) {
34 add_type(&type, param, name, description);
39 const char* description) {
41 add_type(&type, param, name, description);
46 const char* description) {
48 add_type(&type, param, name, description);
53 const char* description) {
55 add_type(&type, param, name, description);
60 const char* description) {
62 add_type(&type, param, name, description);
67 const char* description) {
69 add_type(&type, param, name, description);
74 const char* description) {
76 add_type(&type, param, name, description);
81 const char* description) {
83 add_type(&type, param, name, description);
88 const char* description) {
90 add_type(&type, param, name, description);
95 const char* description) {
97 add_type(&type, param, name, description);
102 const char* description) {
104 add_type(&type, param, name, description);
109 const char* description) {
111 add_type(&type, param, name, description);
116 const char* name,
const char* description) {
118 add_type(&type, param, name, description);
123 const char* description) {
125 add_type(&type, param, name, description);
130 const char* description) {
132 add_type(&type, param, name, description);
137 const char* description) {
139 add_type(&type, param, name, description);
144 const char* description) {
146 add_type(&type, param, name, description);
151 const char* description) {
153 add_type(&type, param, name, description);
158 const char* description) {
160 add_type(&type, param, name, description);
165 const char* description) {
167 add_type(&type, param, name, description);
172 const char* description) {
174 add_type(&type, param, name, description);
179 const char* description) {
181 add_type(&type, param, name, description);
186 const char* description) {
188 add_type(&type, param, name, description);
193 const char* description) {
194 TSGDataType type(CT_SCALAR, ST_STRING, PT_FLOAT32);
195 add_type(&type, param, name, description);
200 const char* description) {
201 TSGDataType type(CT_SCALAR, ST_STRING, PT_FLOAT64);
202 add_type(&type, param, name, description);
207 const char* description) {
208 TSGDataType type(CT_SCALAR, ST_STRING, PT_FLOATMAX);
209 add_type(&type, param, name, description);
214 const char* description) {
216 add_type(&type, param, name, description);
221 const char* description) {
223 add_type(&type, param, name, description);
228 const char* description) {
230 add_type(&type, param, name, description);
235 const char* description) {
237 add_type(&type, param, name, description);
242 const char* description) {
244 add_type(&type, param, name, description);
249 const char* description) {
251 add_type(&type, param, name, description);
256 const char* description) {
258 add_type(&type, param, name, description);
263 const char* description) {
265 add_type(&type, param, name, description);
270 const char* description) {
272 add_type(&type, param, name, description);
277 const char* description) {
279 add_type(&type, param, name, description);
284 const char* description) {
285 TSGDataType type(CT_SCALAR, ST_SPARSE, PT_FLOAT32);
286 add_type(&type, param, name, description);
291 const char* description) {
292 TSGDataType type(CT_SCALAR, ST_SPARSE, PT_FLOAT64);
293 add_type(&type, param, name, description);
298 const char* description) {
299 TSGDataType type(CT_SCALAR, ST_SPARSE, PT_FLOATMAX);
300 add_type(&type, param, name, description);
308 bool** param,
index_t* length,
const char* name,
309 const char* description) {
310 TSGDataType type(CT_VECTOR, ST_NONE, PT_BOOL, length);
311 add_type(&type, param, name, description);
316 char** param,
index_t* length,
const char* name,
317 const char* description) {
318 TSGDataType type(CT_VECTOR, ST_NONE, PT_CHAR, length);
319 add_type(&type, param, name, description);
324 int8_t** param,
index_t* length,
const char* name,
325 const char* description) {
326 TSGDataType type(CT_VECTOR, ST_NONE, PT_INT8, length);
327 add_type(&type, param, name, description);
332 uint8_t** param,
index_t* length,
const char* name,
333 const char* description) {
334 TSGDataType type(CT_VECTOR, ST_NONE, PT_UINT8, length);
335 add_type(&type, param, name, description);
340 int16_t** param,
index_t* length,
const char* name,
341 const char* description) {
342 TSGDataType type(CT_VECTOR, ST_NONE, PT_INT16, length);
343 add_type(&type, param, name, description);
348 uint16_t** param,
index_t* length,
const char* name,
349 const char* description) {
350 TSGDataType type(CT_VECTOR, ST_NONE, PT_UINT16, length);
351 add_type(&type, param, name, description);
356 int32_t** param,
index_t* length,
const char* name,
357 const char* description) {
358 TSGDataType type(CT_VECTOR, ST_NONE, PT_INT32, length);
359 add_type(&type, param, name, description);
364 uint32_t** param,
index_t* length,
const char* name,
365 const char* description) {
366 TSGDataType type(CT_VECTOR, ST_NONE, PT_UINT32, length);
367 add_type(&type, param, name, description);
372 int64_t** param,
index_t* length,
const char* name,
373 const char* description) {
374 TSGDataType type(CT_VECTOR, ST_NONE, PT_INT64, length);
375 add_type(&type, param, name, description);
380 uint64_t** param,
index_t* length,
const char* name,
381 const char* description) {
382 TSGDataType type(CT_VECTOR, ST_NONE, PT_UINT64, length);
383 add_type(&type, param, name, description);
389 const char* description) {
390 TSGDataType type(CT_VECTOR, ST_NONE, PT_FLOAT32, length);
391 add_type(&type, param, name, description);
397 const char* description) {
398 TSGDataType type(CT_VECTOR, ST_NONE, PT_FLOAT64, length);
399 add_type(&type, param, name, description);
405 const char* description) {
406 TSGDataType type(CT_VECTOR, ST_NONE, PT_FLOATMAX, length);
407 add_type(&type, param, name, description);
412 const char* name,
const char* description) {
415 add_type(&type, param, name, description);
420 const char* name,
const char* description) {
421 TSGDataType type(CT_VECTOR, ST_STRING, PT_BOOL, length);
422 add_type(&type, param, name, description);
427 const char* name,
const char* description) {
428 TSGDataType type(CT_VECTOR, ST_STRING, PT_CHAR, length);
429 add_type(&type, param, name, description);
434 const char* name,
const char* description) {
435 TSGDataType type(CT_VECTOR, ST_STRING, PT_INT8, length);
436 add_type(&type, param, name, description);
441 const char* name,
const char* description) {
442 TSGDataType type(CT_VECTOR, ST_STRING, PT_UINT8, length);
443 add_type(&type, param, name, description);
448 const char* name,
const char* description) {
449 TSGDataType type(CT_VECTOR, ST_STRING, PT_INT16, length);
450 add_type(&type, param, name, description);
455 const char* name,
const char* description) {
456 TSGDataType type(CT_VECTOR, ST_STRING, PT_UINT16, length);
457 add_type(&type, param, name, description);
462 const char* name,
const char* description) {
463 TSGDataType type(CT_VECTOR, ST_STRING, PT_INT32, length);
464 add_type(&type, param, name, description);
469 const char* name,
const char* description) {
470 TSGDataType type(CT_VECTOR, ST_STRING, PT_UINT32, length);
471 add_type(&type, param, name, description);
476 const char* name,
const char* description) {
477 TSGDataType type(CT_VECTOR, ST_STRING, PT_INT64, length);
478 add_type(&type, param, name, description);
483 const char* name,
const char* description) {
484 TSGDataType type(CT_VECTOR, ST_STRING, PT_UINT64, length);
485 add_type(&type, param, name, description);
490 const char* name,
const char* description) {
491 TSGDataType type(CT_VECTOR, ST_STRING, PT_FLOAT32, length);
492 add_type(&type, param, name, description);
497 const char* name,
const char* description) {
498 TSGDataType type(CT_VECTOR, ST_STRING, PT_FLOAT64, length);
499 add_type(&type, param, name, description);
504 const char* name,
const char* description) {
505 TSGDataType type(CT_VECTOR, ST_STRING, PT_FLOATMAX, length);
506 add_type(&type, param, name, description);
511 const char* name,
const char* description) {
512 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_BOOL, length);
513 add_type(&type, param, name, description);
518 const char* name,
const char* description) {
519 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_CHAR, length);
520 add_type(&type, param, name, description);
525 const char* name,
const char* description) {
526 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_INT8, length);
527 add_type(&type, param, name, description);
532 const char* name,
const char* description) {
533 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_UINT8, length);
534 add_type(&type, param, name, description);
539 const char* name,
const char* description) {
540 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_INT16, length);
541 add_type(&type, param, name, description);
546 const char* name,
const char* description) {
547 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_UINT16, length);
548 add_type(&type, param, name, description);
553 const char* name,
const char* description) {
554 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_INT32, length);
555 add_type(&type, param, name, description);
560 const char* name,
const char* description) {
561 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_UINT32, length);
562 add_type(&type, param, name, description);
567 const char* name,
const char* description) {
568 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_INT64, length);
569 add_type(&type, param, name, description);
574 const char* name,
const char* description) {
575 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_UINT64, length);
576 add_type(&type, param, name, description);
581 const char* name,
const char* description) {
582 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_FLOAT32, length);
583 add_type(&type, param, name, description);
588 const char* name,
const char* description) {
589 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_FLOAT64, length);
590 add_type(&type, param, name, description);
595 const char* name,
const char* description) {
596 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_FLOATMAX, length);
597 add_type(&type, param, name, description);
604 const char* description)
611 const char* description)
618 const char* description)
625 const char* description)
632 const char* description)
639 const char* description)
646 const char* description)
653 const char* description)
660 const char* description)
667 const char* description)
674 const char* description)
681 const char* description)
688 const char* description)
695 const char* description)
702 const char* description)
704 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_BOOL, ¶m->vlen);
705 add_type(&type, ¶m->vector, name, description);
709 const char* description)
711 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_CHAR, ¶m->vlen);
712 add_type(&type, ¶m->vector, name, description);
716 const char* name,
const char* description)
718 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_INT8, ¶m->vlen);
719 add_type(&type, ¶m->vector, name, description);
723 const char* name,
const char* description)
725 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_UINT8, ¶m->vlen);
726 add_type(&type, ¶m->vector, name, description);
730 const char* name,
const char* description)
732 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_INT16, ¶m->vlen);
733 add_type(&type, ¶m->vector, name, description);
737 const char* name,
const char* description)
739 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_UINT16, ¶m->vlen);
740 add_type(&type, ¶m->vector, name, description);
744 const char* name,
const char* description)
746 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_INT32, ¶m->vlen);
747 add_type(&type, ¶m->vector, name, description);
751 const char* name,
const char* description)
753 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_UINT32, ¶m->vlen);
754 add_type(&type, ¶m->vector, name, description);
758 const char* name,
const char* description)
760 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_INT64, ¶m->vlen);
761 add_type(&type, ¶m->vector, name, description);
765 const char* name,
const char* description)
767 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_UINT64, ¶m->vlen);
768 add_type(&type, ¶m->vector, name, description);
772 const char* name,
const char* description)
774 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_FLOAT32, ¶m->vlen);
775 add_type(&type, ¶m->vector, name, description);
779 const char* name,
const char* description)
781 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_FLOAT64, ¶m->vlen);
782 add_type(&type, ¶m->vector, name, description);
786 const char* name,
const char* description)
788 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_FLOATMAX, ¶m->vlen);
789 add_type(&type, ¶m->vector, name, description);
793 const char* name,
const char* description)
795 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_BOOL, ¶m->vlen);
796 add_type(&type, ¶m->vector, name, description);
800 const char* name,
const char* description)
802 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_CHAR, ¶m->vlen);
803 add_type(&type, ¶m->vector, name, description);
807 const char* name,
const char* description)
809 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_INT8, ¶m->vlen);
810 add_type(&type, ¶m->vector, name, description);
814 const char* name,
const char* description)
816 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_UINT8, ¶m->vlen);
817 add_type(&type, ¶m->vector, name, description);
821 const char* name,
const char* description)
823 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_INT16, ¶m->vlen);
824 add_type(&type, ¶m->vector, name, description);
828 const char* name,
const char* description)
830 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_UINT16, ¶m->vlen);
831 add_type(&type, ¶m->vector, name, description);
835 const char* name,
const char* description)
837 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_INT32, ¶m->vlen);
838 add_type(&type, ¶m->vector, name, description);
842 const char* name,
const char* description)
844 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_UINT32, ¶m->vlen);
845 add_type(&type, ¶m->vector, name, description);
849 const char* name,
const char* description)
851 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_INT64, ¶m->vlen);
852 add_type(&type, ¶m->vector, name, description);
856 const char* name,
const char* description)
858 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_UINT64, ¶m->vlen);
859 add_type(&type, ¶m->vector, name, description);
863 const char* name,
const char* description)
865 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_FLOAT32, ¶m->vlen);
866 add_type(&type, ¶m->vector, name, description);
870 const char* name,
const char* description)
872 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_FLOAT64, ¶m->vlen);
873 add_type(&type, ¶m->vector, name, description);
877 const char* name,
const char* description)
879 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_FLOATMAX, ¶m->vlen);
880 add_type(&type, ¶m->vector, name, description);
889 const char* name,
const char* description) {
890 TSGDataType type(CT_MATRIX, ST_NONE, PT_BOOL, length_y,
892 add_type(&type, param, name, description);
898 const char* name,
const char* description) {
899 TSGDataType type(CT_MATRIX, ST_NONE, PT_CHAR, length_y,
901 add_type(&type, param, name, description);
907 const char* name,
const char* description) {
908 TSGDataType type(CT_MATRIX, ST_NONE, PT_INT8, length_y,
910 add_type(&type, param, name, description);
916 const char* name,
const char* description) {
917 TSGDataType type(CT_MATRIX, ST_NONE, PT_UINT8, length_y,
919 add_type(&type, param, name, description);
925 const char* name,
const char* description) {
926 TSGDataType type(CT_MATRIX, ST_NONE, PT_INT16, length_y,
928 add_type(&type, param, name, description);
934 const char* name,
const char* description) {
935 TSGDataType type(CT_MATRIX, ST_NONE, PT_UINT16, length_y,
937 add_type(&type, param, name, description);
943 const char* name,
const char* description) {
944 TSGDataType type(CT_MATRIX, ST_NONE, PT_INT32, length_y,
946 add_type(&type, param, name, description);
952 const char* name,
const char* description) {
953 TSGDataType type(CT_MATRIX, ST_NONE, PT_UINT32, length_y,
955 add_type(&type, param, name, description);
961 const char* name,
const char* description) {
962 TSGDataType type(CT_MATRIX, ST_NONE, PT_INT64, length_y,
964 add_type(&type, param, name, description);
970 const char* name,
const char* description) {
971 TSGDataType type(CT_MATRIX, ST_NONE, PT_UINT64, length_y,
973 add_type(&type, param, name, description);
979 const char* name,
const char* description) {
980 TSGDataType type(CT_MATRIX, ST_NONE, PT_FLOAT32, length_y,
982 add_type(&type, param, name, description);
988 const char* name,
const char* description) {
989 TSGDataType type(CT_MATRIX, ST_NONE, PT_FLOAT64, length_y,
991 add_type(&type, param, name, description);
997 const char* name,
const char* description) {
998 TSGDataType type(CT_MATRIX, ST_NONE, PT_FLOATMAX, length_y,
1000 add_type(&type, param, name, description);
1006 const char* name,
const char* description) {
1008 length_y, length_x);
1009 add_type(&type, param, name, description);
1015 const char* name,
const char* description) {
1016 TSGDataType type(CT_MATRIX, ST_STRING, PT_BOOL, length_y,
1018 add_type(&type, param, name, description);
1024 const char* name,
const char* description) {
1025 TSGDataType type(CT_MATRIX, ST_STRING, PT_CHAR, length_y,
1027 add_type(&type, param, name, description);
1033 const char* name,
const char* description) {
1034 TSGDataType type(CT_MATRIX, ST_STRING, PT_INT8, length_y,
1036 add_type(&type, param, name, description);
1042 const char* name,
const char* description) {
1043 TSGDataType type(CT_MATRIX, ST_STRING, PT_UINT8, length_y,
1045 add_type(&type, param, name, description);
1051 const char* name,
const char* description) {
1052 TSGDataType type(CT_MATRIX, ST_STRING, PT_INT16, length_y,
1054 add_type(&type, param, name, description);
1060 const char* name,
const char* description) {
1061 TSGDataType type(CT_MATRIX, ST_STRING, PT_UINT16, length_y,
1063 add_type(&type, param, name, description);
1069 const char* name,
const char* description) {
1070 TSGDataType type(CT_MATRIX, ST_STRING, PT_INT32, length_y,
1072 add_type(&type, param, name, description);
1078 const char* name,
const char* description) {
1079 TSGDataType type(CT_MATRIX, ST_STRING, PT_UINT32, length_y,
1081 add_type(&type, param, name, description);
1087 const char* name,
const char* description) {
1088 TSGDataType type(CT_MATRIX, ST_STRING, PT_INT64, length_y,
1090 add_type(&type, param, name, description);
1096 const char* name,
const char* description) {
1097 TSGDataType type(CT_MATRIX, ST_STRING, PT_UINT64, length_y,
1099 add_type(&type, param, name, description);
1105 const char* name,
const char* description) {
1106 TSGDataType type(CT_MATRIX, ST_STRING, PT_FLOAT32, length_y,
1108 add_type(&type, param, name, description);
1114 const char* name,
const char* description) {
1115 TSGDataType type(CT_MATRIX, ST_STRING, PT_FLOAT64, length_y,
1117 add_type(&type, param, name, description);
1123 const char* name,
const char* description) {
1124 TSGDataType type(CT_MATRIX, ST_STRING, PT_FLOATMAX, length_y,
1126 add_type(&type, param, name, description);
1132 const char* name,
const char* description) {
1133 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_BOOL, length_y,
1135 add_type(&type, param, name, description);
1141 const char* name,
const char* description) {
1142 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_CHAR, length_y,
1144 add_type(&type, param, name, description);
1150 const char* name,
const char* description) {
1151 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_INT8, length_y,
1153 add_type(&type, param, name, description);
1159 const char* name,
const char* description) {
1160 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_UINT8, length_y,
1162 add_type(&type, param, name, description);
1168 const char* name,
const char* description) {
1169 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_INT16, length_y,
1171 add_type(&type, param, name, description);
1177 const char* name,
const char* description) {
1178 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_UINT16, length_y,
1180 add_type(&type, param, name, description);
1186 const char* name,
const char* description) {
1187 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_INT32, length_y,
1189 add_type(&type, param, name, description);
1195 const char* name,
const char* description) {
1196 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_UINT32, length_y,
1198 add_type(&type, param, name, description);
1204 const char* name,
const char* description) {
1205 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_INT64, length_y,
1207 add_type(&type, param, name, description);
1213 const char* name,
const char* description) {
1214 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_UINT64, length_y,
1216 add_type(&type, param, name, description);
1222 const char* name,
const char* description) {
1223 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_FLOAT32, length_y,
1225 add_type(&type, param, name, description);
1231 const char* name,
const char* description) {
1232 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_FLOAT64, length_y,
1234 add_type(&type, param, name, description);
1240 const char* name,
const char* description) {
1241 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_FLOATMAX, length_y,
1243 add_type(&type, param, name, description);
1250 const char* description)
1258 const char* description)
1266 const char* description)
1274 const char* description)
1282 const char* description)
1290 const char* description)
1298 const char* description)
1306 const char* description)
1314 const char* description)
1322 const char* description)
1330 const char* description)
1338 const char* description)
1346 const char* description)
1354 const char* description)
1362 const char* description)
1364 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_BOOL, ¶m->num_rows,
1366 add_type(&type, ¶m->matrix, name, description);
1370 const char* description)
1372 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_CHAR, ¶m->num_rows,
1374 add_type(&type, ¶m->matrix, name, description);
1378 const char* name,
const char* description)
1380 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_INT8, ¶m->num_rows,
1382 add_type(&type, ¶m->matrix, name, description);
1386 const char* name,
const char* description)
1388 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_UINT8, ¶m->num_rows,
1390 add_type(&type, ¶m->matrix, name, description);
1394 const char* name,
const char* description)
1396 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_INT16, ¶m->num_rows,
1398 add_type(&type, ¶m->matrix, name, description);
1402 const char* name,
const char* description)
1404 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_UINT16, ¶m->num_rows,
1406 add_type(&type, ¶m->matrix, name, description);
1410 const char* name,
const char* description)
1412 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_INT32, ¶m->num_rows,
1414 add_type(&type, ¶m->matrix, name, description);
1418 const char* name,
const char* description)
1420 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_UINT32, ¶m->num_rows,
1422 add_type(&type, ¶m->matrix, name, description);
1426 const char* name,
const char* description)
1428 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_INT64, ¶m->num_rows,
1430 add_type(&type, ¶m->matrix, name, description);
1434 const char* name,
const char* description)
1436 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_UINT64, ¶m->num_rows,
1438 add_type(&type, ¶m->matrix, name, description);
1442 const char* name,
const char* description)
1444 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_FLOAT32, ¶m->num_rows,
1446 add_type(&type, ¶m->matrix, name, description);
1450 const char* name,
const char* description)
1452 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_FLOAT64, ¶m->num_rows,
1454 add_type(&type, ¶m->matrix, name, description);
1458 const char* name,
const char* description)
1460 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_FLOATMAX, ¶m->num_rows,
1462 add_type(&type, ¶m->matrix, name, description);
1466 const char* name,
const char* description)
1468 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_BOOL, ¶m->num_rows,
1470 add_type(&type, ¶m->matrix, name, description);
1474 const char* name,
const char* description)
1476 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_CHAR, ¶m->num_rows,
1478 add_type(&type, ¶m->matrix, name, description);
1482 const char* name,
const char* description)
1484 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_INT8, ¶m->num_rows,
1486 add_type(&type, ¶m->matrix, name, description);
1490 const char* name,
const char* description)
1492 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_UINT8, ¶m->num_rows,
1494 add_type(&type, ¶m->matrix, name, description);
1498 const char* name,
const char* description)
1500 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_INT16, ¶m->num_rows,
1502 add_type(&type, ¶m->matrix, name, description);
1506 const char* name,
const char* description)
1508 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_UINT16, ¶m->num_rows,
1510 add_type(&type, ¶m->matrix, name, description);
1514 const char* name,
const char* description)
1516 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_INT32, ¶m->num_rows,
1518 add_type(&type, ¶m->matrix, name, description);
1522 const char* name,
const char* description)
1524 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_UINT32, ¶m->num_rows,
1526 add_type(&type, ¶m->matrix, name, description);
1530 const char* name,
const char* description)
1532 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_INT64, ¶m->num_rows,
1534 add_type(&type, ¶m->matrix, name, description);
1538 const char* name,
const char* description)
1540 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_UINT64, ¶m->num_rows,
1542 add_type(&type, ¶m->matrix, name, description);
1546 const char* name,
const char* description)
1548 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_FLOAT32, ¶m->num_rows,
1550 add_type(&type, ¶m->matrix, name, description);
1554 const char* name,
const char* description)
1556 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_FLOAT64, ¶m->num_rows,
1558 add_type(&type, ¶m->matrix, name, description);
1562 const char* name,
const char* description)
1564 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_FLOATMAX, ¶m->num_rows,
1566 add_type(&type, ¶m->matrix, name, description);
1572 const char* name,
const char* description)
1573 :m_datatype(*datatype)
1591 SG_SDEBUG(
"deleting from scratch data\n");
1624 TParameter::new_prefix(
const char* s1,
const char* s2)
1626 char* tmp =
SG_MALLOC(
char, strlen(s1)+strlen(s2)+2);
1628 sprintf(tmp,
"%s%s/", s1, s2);
1647 char* p = new_prefix(prefix,
m_name);
1654 TParameter::delete_cont()
1661 case CT_MATRIX:
case CT_SGMATRIX:
1663 case CT_SCALAR:
case CT_VECTOR:
case CT_SGVECTOR:
break;
1698 for (
index_t i=0; i<old_length; i++)
1699 if (buf[i] != NULL)
SG_UNREF(buf[i]);
1706 for (
index_t i=0; i<old_length; i++) {
1740 SG_SERROR(
"TParameter::delete_cont(): Implementation "
1741 "error: Could not delete "
1742 "String<SGSerializable*>");
1747 for (
index_t i=0; i<old_length; i++) {
1781 SG_SERROR(
"TParameter::delete_cont(): Implementation "
1782 "error: Could not delete "
1783 "Sparse<SGSerializable*>");
1798 SG_SDEBUG(
"entering TParameter::new_cont(%d, %d) for \"%s\" of type %s\n",
1803 index_t new_length = new_len_y*new_len_x;
1804 if (new_length == 0)
return;
1820 =
SG_MALLOC(uint8_t, new_length);
break;
1823 =
SG_MALLOC(int16_t, new_length);
break;
1826 =
SG_MALLOC(uint16_t, new_length);
break;
1829 =
SG_MALLOC(int32_t, new_length);
break;
1832 =
SG_MALLOC(uint32_t, new_length);
break;
1835 =
SG_MALLOC(int64_t, new_length);
break;
1838 =
SG_MALLOC(uint64_t, new_length);
break;
1896 SG_SERROR(
"TParameter::new_cont(): Implementation "
1897 "error: Could not allocate "
1898 "String<SGSerializable*>");
1946 SG_SERROR(
"TParameter::new_cont(): Implementation "
1947 "error: Could not allocate "
1948 "Sparse<SGSerializable*>");
1958 SG_SDEBUG(
"leaving TParameter::new_cont(%d, %d) for \"%s\" of type %s\n",
1964 TParameter::new_sgserial(
CSGObject** param,
1965 EPrimitiveType
generic,
1966 const char* sgserializable_name,
1974 if (*param == NULL) {
1985 "Class `C%s%s' was not listed during compiling Shogun"
1986 " :( ... Can not construct it for `%s%s'!",
1987 sgserializable_name, buf, prefix,
m_name);
2001 const char* sgserial_name =
"";
2005 sgserial_name = (*(
CSGObject**) param)->get_name();
2006 (*(
CSGObject**) param)->is_generic(&
generic);
2009 if (!file->write_sgserializable_begin(
2012 if (*sgserial_name !=
'\0') {
2013 char* p = new_prefix(prefix,
m_name);
2015 ->save_serializable(file, p);
2017 if (!result)
return false;
2019 if (!file->write_sgserializable_end(
2024 param))
return false;
2037 if (!file->read_sgserializable_begin(
2040 if (*sgserial_name !=
'\0') {
2041 if (!new_sgserial((
CSGObject**) param,
generic,
2042 sgserial_name, prefix))
2045 char* p = new_prefix(prefix,
m_name);
2047 ->load_serializable(file, p);
2049 if (!result)
return false;
2051 if (!file->read_sgserializable_end(
2056 param))
return false;
2071 if (!save_ptype(file, param, prefix))
return false;
2074 len_real = str_ptr->
slen;
2075 if (str_ptr->
string == NULL && len_real != 0) {
2076 SG_SWARNING(
"Inconsistency between data structure and "
2077 "len during saving string `%s%s'! Continuing"
2082 if (!file->write_string_begin(
2084 for (
index_t i=0; i<len_real; i++) {
2085 if (!file->write_stringentry_begin(
2087 if (!save_ptype(file, (
char*) str_ptr->
string
2090 if (!file->write_stringentry_end(
2093 if (!file->write_string_end(
2098 if (spr_ptr->
features == NULL && len_real != 0) {
2099 SG_SWARNING(
"Inconsistency between data structure and "
2100 "len during saving sparse `%s%s'! Continuing"
2105 if (!file->write_sparse_begin(
2107 for (
index_t i=0; i<len_real; i++) {
2111 if (!file->write_sparseentry_begin(
2116 prefix))
return false;
2117 if (!file->write_sparseentry_end(
2121 if (!file->write_sparse_end(
2139 if (!load_ptype(file, param, prefix))
return false;
2142 if (!file->read_string_begin(
2145 str_ptr->
string = len_real > 0
2147 for (
index_t i=0; i<len_real; i++) {
2148 if (!file->read_stringentry_begin(
2150 if (!load_ptype(file, (
char*) str_ptr->
string
2153 if (!file->read_stringentry_end(
2156 if (!file->read_string_end(
2159 str_ptr->
slen = len_real;
2162 if (!file->read_sparse_begin(
2167 for (
index_t i=0; i<len_real; i++) {
2171 if (!file->read_sparseentry_begin(
2176 prefix))
return false;
2177 if (!file->read_sparseentry_end(
2193 uint32_t& hash, uint32_t& carry, uint32_t& total_length)
2204 total_length += size;
2206 &hash, &carry, data, size);
2209 case CT_VECTOR:
case CT_MATRIX:
case CT_SGVECTOR:
case CT_SGMATRIX:
2210 index_t len_real_y = 0, len_real_x = 0;
2218 if (*(
void**)
m_parameter == NULL && len_real_y != 0)
2220 SG_SWARNING(
"Inconsistency between data structure and "
2221 "len_y during hashing `%s'! Continuing with "
2232 case CT_VECTOR:
case CT_SGVECTOR:
2235 case CT_MATRIX:
case CT_SGMATRIX:
2238 if (*(
void**)
m_parameter == NULL && len_real_x != 0)
2240 SG_SWARNING(
"Inconsistency between data structure and "
2241 "len_x during hashing %s'! Continuing "
2247 if (len_real_x *len_real_y == 0)
2248 len_real_x = len_real_y = 0;
2252 case CT_SCALAR:
break;
2256 total_length += size;
2261 &hash, &carry, data, size);
2269 const int32_t buflen=100;
2282 if (!save_stype(file,
m_parameter, prefix))
return false;
2284 case CT_VECTOR:
case CT_MATRIX:
case CT_SGVECTOR:
case CT_SGMATRIX:
2285 index_t len_real_y = 0, len_real_x = 0;
2288 if (*(
void**)
m_parameter == NULL && len_real_y != 0) {
2289 SG_SWARNING(
"Inconsistency between data structure and "
2290 "len_y during saving `%s%s'! Continuing with "
2300 case CT_VECTOR:
case CT_SGVECTOR:
2303 case CT_MATRIX:
case CT_SGMATRIX:
2305 if (*(
void**)
m_parameter == NULL && len_real_x != 0) {
2306 SG_SWARNING(
"Inconsistency between data structure and "
2307 "len_x during saving `%s%s'! Continuing "
2313 if (len_real_x *len_real_y == 0)
2314 len_real_x = len_real_y = 0;
2317 case CT_SCALAR:
break;
2321 len_real_y, len_real_x))
2326 for (
index_t x=0; x<len_real_x; x++)
2327 for (
index_t y=0; y<len_real_y; y++) {
2328 if (!file->write_item_begin(
2335 prefix))
return false;
2336 if (!file->write_item_end(
2344 len_real_y, len_real_x))
2359 const int32_t buflen=100;
2377 case CT_VECTOR:
case CT_MATRIX:
case CT_SGVECTOR:
case CT_SGMATRIX:
2378 index_t len_read_y = 0, len_read_x = 0;
2381 &len_read_y, &len_read_x))
2388 case CT_VECTOR:
case CT_SGVECTOR:
2390 new_cont(len_read_y, len_read_x);
2392 case CT_MATRIX:
case CT_SGMATRIX:
2393 new_cont(len_read_y, len_read_x);
2399 for (
index_t x=0; x<len_read_x; x++)
2401 for (
index_t y=0; y<len_read_y; y++)
2403 if (!file->read_item_begin(
2410 prefix))
return false;
2411 if (!file->read_item_end(
2421 case CT_VECTOR:
case CT_SGVECTOR:
2424 case CT_MATRIX:
case CT_SGMATRIX:
2433 len_read_y, len_read_x))
2460 const char* name,
const char* description)
2462 if (name == NULL || *name ==
'\0')
2463 SG_SERROR(
"FATAL: Parameter::add_type(): `name' is empty!\n");
2467 SG_SERROR(
"FATAL: Parameter::add_type(): "
2468 "Double parameter `%s'!\n", name);
2471 new TParameter(type, param, name, description)
2519 if (!strcmp(own->m_name, current->
m_name))
2521 if (own->m_datatype==current_type)
2532 own->m_datatype.to_string(own_type, l);
2533 SG_SERROR(
"given parameter \"%s\" has a different type (%s)"
2534 " than existing one (%s)\n", current->
m_name,
2535 given_type, own_type);
2546 SG_SERROR(
"parameter with name %s does not exist\n",
2551 if (current_type.
m_ptype==PT_SGOBJECT)
2554 if (own->m_datatype.m_stype==ST_NONE)
2556 if (own->m_datatype.m_ctype==CT_SCALAR)
2561 if ((*to_ref)!=(*to_unref))
2574 for (
index_t j=0; j<own->m_datatype.get_num_elements(); ++j)
2576 if ((*to_ref)[j]!=(*to_unref)[j])
2585 SG_SERROR(
"primitive type PT_SGOBJECT occurred with structure "
2586 "type other than ST_NONE");
2592 if (current_type.
m_ctype==CT_SCALAR)
2595 dest=own->m_parameter;
2601 if (own->m_datatype.m_ptype==PT_SGOBJECT)
2616 switch (own->m_datatype.m_ptype)
2634 memcpy(dest, source, own->m_datatype.get_size());
2652 if (!strcmp(name,
m_params[i]->m_name))
2679 SG_SDEBUG(
"entering TParameter::allocate_data_from_scratch(%d,%d) of "
2680 "\"%s\"\n", len_y, len_x,
m_name);
2688 case CT_VECTOR:
case CT_SGVECTOR:
2692 case CT_MATRIX:
case CT_SGMATRIX:
2708 SG_SERROR(
"TParameter::allocate_data_from_scratch must not be called "
2709 "when the underlying TParameter instance already has data.\n");
2744 **(
void***)data_p=NULL;
2754 new_cont(len_y, len_x);
2757 SG_SDEBUG(
"leaving TParameter::allocate_data_from_scratch(%d,%d) of "
2758 "\"%s\"\n", len_y, len_x,
m_name);
2778 SG_SDEBUG(
"Copying scalar data of size %d from %p to %p\n",
2798 for (
index_t j=0; j<length; ++j)