15 using namespace shogun;
24 const char* description) {
26 add_type(&type, param, name, description);
31 const char* description) {
33 add_type(&type, param, name, description);
38 const char* description) {
40 add_type(&type, param, name, description);
45 const char* description) {
47 add_type(&type, param, name, description);
52 const char* description) {
54 add_type(&type, param, name, description);
59 const char* description) {
61 add_type(&type, param, name, description);
66 const char* description) {
68 add_type(&type, param, name, description);
73 const char* description) {
75 add_type(&type, param, name, description);
80 const char* description) {
82 add_type(&type, param, name, description);
87 const char* description) {
89 add_type(&type, param, name, description);
94 const char* description) {
96 add_type(&type, param, name, description);
101 const char* description) {
103 add_type(&type, param, name, description);
108 const char* description) {
110 add_type(&type, param, name, description);
115 const char* name,
const char* description) {
117 add_type(&type, param, name, description);
122 const char* description) {
124 add_type(&type, param, name, description);
129 const char* description) {
131 add_type(&type, param, name, description);
136 const char* description) {
138 add_type(&type, param, name, description);
143 const char* description) {
145 add_type(&type, param, name, description);
150 const char* description) {
152 add_type(&type, param, name, description);
157 const char* description) {
159 add_type(&type, param, name, description);
164 const char* description) {
166 add_type(&type, param, name, description);
171 const char* description) {
173 add_type(&type, param, name, description);
178 const char* description) {
180 add_type(&type, param, name, description);
185 const char* description) {
187 add_type(&type, param, name, description);
192 const char* description) {
193 TSGDataType type(CT_SCALAR, ST_STRING, PT_FLOAT32);
194 add_type(&type, param, name, description);
199 const char* description) {
200 TSGDataType type(CT_SCALAR, ST_STRING, PT_FLOAT64);
201 add_type(&type, param, name, description);
206 const char* description) {
207 TSGDataType type(CT_SCALAR, ST_STRING, PT_FLOATMAX);
208 add_type(&type, param, name, description);
213 const char* description) {
215 add_type(&type, param, name, description);
220 const char* description) {
222 add_type(&type, param, name, description);
227 const char* description) {
229 add_type(&type, param, name, description);
234 const char* description) {
236 add_type(&type, param, name, description);
241 const char* description) {
243 add_type(&type, param, name, description);
248 const char* description) {
250 add_type(&type, param, name, description);
255 const char* description) {
257 add_type(&type, param, name, description);
262 const char* description) {
264 add_type(&type, param, name, description);
269 const char* description) {
271 add_type(&type, param, name, description);
276 const char* description) {
278 add_type(&type, param, name, description);
283 const char* description) {
284 TSGDataType type(CT_SCALAR, ST_SPARSE, PT_FLOAT32);
285 add_type(&type, param, name, description);
290 const char* description) {
291 TSGDataType type(CT_SCALAR, ST_SPARSE, PT_FLOAT64);
292 add_type(&type, param, name, description);
297 const char* description) {
298 TSGDataType type(CT_SCALAR, ST_SPARSE, PT_FLOATMAX);
299 add_type(&type, param, name, description);
307 bool** param,
index_t* length,
const char* name,
308 const char* description) {
309 TSGDataType type(CT_VECTOR, ST_NONE, PT_BOOL, length);
310 add_type(&type, param, name, description);
315 char** param,
index_t* length,
const char* name,
316 const char* description) {
317 TSGDataType type(CT_VECTOR, ST_NONE, PT_CHAR, length);
318 add_type(&type, param, name, description);
323 int8_t** param,
index_t* length,
const char* name,
324 const char* description) {
325 TSGDataType type(CT_VECTOR, ST_NONE, PT_INT8, length);
326 add_type(&type, param, name, description);
331 uint8_t** param,
index_t* length,
const char* name,
332 const char* description) {
333 TSGDataType type(CT_VECTOR, ST_NONE, PT_UINT8, length);
334 add_type(&type, param, name, description);
339 int16_t** param,
index_t* length,
const char* name,
340 const char* description) {
341 TSGDataType type(CT_VECTOR, ST_NONE, PT_INT16, length);
342 add_type(&type, param, name, description);
347 uint16_t** param,
index_t* length,
const char* name,
348 const char* description) {
349 TSGDataType type(CT_VECTOR, ST_NONE, PT_UINT16, length);
350 add_type(&type, param, name, description);
355 int32_t** param,
index_t* length,
const char* name,
356 const char* description) {
357 TSGDataType type(CT_VECTOR, ST_NONE, PT_INT32, length);
358 add_type(&type, param, name, description);
363 uint32_t** param,
index_t* length,
const char* name,
364 const char* description) {
365 TSGDataType type(CT_VECTOR, ST_NONE, PT_UINT32, length);
366 add_type(&type, param, name, description);
371 int64_t** param,
index_t* length,
const char* name,
372 const char* description) {
373 TSGDataType type(CT_VECTOR, ST_NONE, PT_INT64, length);
374 add_type(&type, param, name, description);
379 uint64_t** param,
index_t* length,
const char* name,
380 const char* description) {
381 TSGDataType type(CT_VECTOR, ST_NONE, PT_UINT64, length);
382 add_type(&type, param, name, description);
388 const char* description) {
389 TSGDataType type(CT_VECTOR, ST_NONE, PT_FLOAT32, length);
390 add_type(&type, param, name, description);
396 const char* description) {
397 TSGDataType type(CT_VECTOR, ST_NONE, PT_FLOAT64, length);
398 add_type(&type, param, name, description);
404 const char* description) {
405 TSGDataType type(CT_VECTOR, ST_NONE, PT_FLOATMAX, length);
406 add_type(&type, param, name, description);
411 const char* name,
const char* description) {
414 add_type(&type, param, name, description);
419 const char* name,
const char* description) {
420 TSGDataType type(CT_VECTOR, ST_STRING, PT_BOOL, length);
421 add_type(&type, param, name, description);
426 const char* name,
const char* description) {
427 TSGDataType type(CT_VECTOR, ST_STRING, PT_CHAR, length);
428 add_type(&type, param, name, description);
433 const char* name,
const char* description) {
434 TSGDataType type(CT_VECTOR, ST_STRING, PT_INT8, length);
435 add_type(&type, param, name, description);
440 const char* name,
const char* description) {
441 TSGDataType type(CT_VECTOR, ST_STRING, PT_UINT8, length);
442 add_type(&type, param, name, description);
447 const char* name,
const char* description) {
448 TSGDataType type(CT_VECTOR, ST_STRING, PT_INT16, length);
449 add_type(&type, param, name, description);
454 const char* name,
const char* description) {
455 TSGDataType type(CT_VECTOR, ST_STRING, PT_UINT16, length);
456 add_type(&type, param, name, description);
461 const char* name,
const char* description) {
462 TSGDataType type(CT_VECTOR, ST_STRING, PT_INT32, length);
463 add_type(&type, param, name, description);
468 const char* name,
const char* description) {
469 TSGDataType type(CT_VECTOR, ST_STRING, PT_UINT32, length);
470 add_type(&type, param, name, description);
475 const char* name,
const char* description) {
476 TSGDataType type(CT_VECTOR, ST_STRING, PT_INT64, length);
477 add_type(&type, param, name, description);
482 const char* name,
const char* description) {
483 TSGDataType type(CT_VECTOR, ST_STRING, PT_UINT64, length);
484 add_type(&type, param, name, description);
489 const char* name,
const char* description) {
490 TSGDataType type(CT_VECTOR, ST_STRING, PT_FLOAT32, length);
491 add_type(&type, param, name, description);
496 const char* name,
const char* description) {
497 TSGDataType type(CT_VECTOR, ST_STRING, PT_FLOAT64, length);
498 add_type(&type, param, name, description);
503 const char* name,
const char* description) {
504 TSGDataType type(CT_VECTOR, ST_STRING, PT_FLOATMAX, length);
505 add_type(&type, param, name, description);
510 const char* name,
const char* description) {
511 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_BOOL, length);
512 add_type(&type, param, name, description);
517 const char* name,
const char* description) {
518 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_CHAR, length);
519 add_type(&type, param, name, description);
524 const char* name,
const char* description) {
525 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_INT8, length);
526 add_type(&type, param, name, description);
531 const char* name,
const char* description) {
532 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_UINT8, length);
533 add_type(&type, param, name, description);
538 const char* name,
const char* description) {
539 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_INT16, length);
540 add_type(&type, param, name, description);
545 const char* name,
const char* description) {
546 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_UINT16, length);
547 add_type(&type, param, name, description);
552 const char* name,
const char* description) {
553 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_INT32, length);
554 add_type(&type, param, name, description);
559 const char* name,
const char* description) {
560 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_UINT32, length);
561 add_type(&type, param, name, description);
566 const char* name,
const char* description) {
567 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_INT64, length);
568 add_type(&type, param, name, description);
573 const char* name,
const char* description) {
574 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_UINT64, length);
575 add_type(&type, param, name, description);
580 const char* name,
const char* description) {
581 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_FLOAT32, length);
582 add_type(&type, param, name, description);
587 const char* name,
const char* description) {
588 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_FLOAT64, length);
589 add_type(&type, param, name, description);
594 const char* name,
const char* description) {
595 TSGDataType type(CT_VECTOR, ST_SPARSE, PT_FLOATMAX, length);
596 add_type(&type, param, name, description);
603 const char* description)
606 add_type(&type, param, name, description);
610 const char* description)
613 add_type(&type, param, name, description);
617 const char* description)
620 add_type(&type, param, name, description);
624 const char* description)
627 add_type(&type, param, name, description);
631 const char* description)
634 add_type(&type, param, name, description);
638 const char* description)
641 add_type(&type, param, name, description);
645 const char* description)
648 add_type(&type, param, name, description);
652 const char* description)
655 add_type(&type, param, name, description);
659 const char* description)
662 add_type(&type, param, name, description);
666 const char* description)
669 add_type(&type, param, name, description);
673 const char* description)
676 add_type(&type, param, name, description);
680 const char* description)
683 add_type(&type, param, name, description);
687 const char* description)
690 add_type(&type, param, name, description);
694 const char* description)
697 add_type(&type, param, name, description);
701 const char* description)
703 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_BOOL, ¶m->vlen);
704 add_type(&type, param, name, description);
708 const char* description)
710 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_CHAR, ¶m->vlen);
711 add_type(&type, param, name, description);
715 const char* name,
const char* description)
717 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_INT8, ¶m->vlen);
718 add_type(&type, param, name, description);
722 const char* name,
const char* description)
724 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_UINT8, ¶m->vlen);
725 add_type(&type, param, name, description);
729 const char* name,
const char* description)
731 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_INT16, ¶m->vlen);
732 add_type(&type, param, name, description);
736 const char* name,
const char* description)
738 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_UINT16, ¶m->vlen);
739 add_type(&type, param, name, description);
743 const char* name,
const char* description)
745 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_INT32, ¶m->vlen);
746 add_type(&type, param, name, description);
750 const char* name,
const char* description)
752 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_UINT32, ¶m->vlen);
753 add_type(&type, param, name, description);
757 const char* name,
const char* description)
759 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_INT64, ¶m->vlen);
760 add_type(&type, param, name, description);
764 const char* name,
const char* description)
766 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_UINT64, ¶m->vlen);
767 add_type(&type, param, name, description);
771 const char* name,
const char* description)
773 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_FLOAT32, ¶m->vlen);
774 add_type(&type, param, name, description);
778 const char* name,
const char* description)
780 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_FLOAT64, ¶m->vlen);
781 add_type(&type, param, name, description);
785 const char* name,
const char* description)
787 TSGDataType type(CT_SGVECTOR, ST_STRING, PT_FLOATMAX, ¶m->vlen);
788 add_type(&type, param, name, description);
792 const char* name,
const char* description)
794 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_BOOL, ¶m->vlen);
795 add_type(&type, param, name, description);
799 const char* name,
const char* description)
801 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_CHAR, ¶m->vlen);
802 add_type(&type, param, name, description);
806 const char* name,
const char* description)
808 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_INT8, ¶m->vlen);
809 add_type(&type, param, name, description);
813 const char* name,
const char* description)
815 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_UINT8, ¶m->vlen);
816 add_type(&type, param, name, description);
820 const char* name,
const char* description)
822 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_INT16, ¶m->vlen);
823 add_type(&type, param, name, description);
827 const char* name,
const char* description)
829 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_UINT16, ¶m->vlen);
830 add_type(&type, param, name, description);
834 const char* name,
const char* description)
836 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_INT32, ¶m->vlen);
837 add_type(&type, param, name, description);
841 const char* name,
const char* description)
843 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_UINT32, ¶m->vlen);
844 add_type(&type, param, name, description);
848 const char* name,
const char* description)
850 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_INT64, ¶m->vlen);
851 add_type(&type, param, name, description);
855 const char* name,
const char* description)
857 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_UINT64, ¶m->vlen);
858 add_type(&type, param, name, description);
862 const char* name,
const char* description)
864 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_FLOAT32, ¶m->vlen);
865 add_type(&type, param, name, description);
869 const char* name,
const char* description)
871 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_FLOAT64, ¶m->vlen);
872 add_type(&type, param, name, description);
876 const char* name,
const char* description)
878 TSGDataType type(CT_SGVECTOR, ST_SPARSE, PT_FLOATMAX, ¶m->vlen);
879 add_type(&type, param, name, description);
888 const char* name,
const char* description) {
889 TSGDataType type(CT_MATRIX, ST_NONE, PT_BOOL, length_y,
891 add_type(&type, param, name, description);
897 const char* name,
const char* description) {
898 TSGDataType type(CT_MATRIX, ST_NONE, PT_CHAR, length_y,
900 add_type(&type, param, name, description);
906 const char* name,
const char* description) {
907 TSGDataType type(CT_MATRIX, ST_NONE, PT_INT8, length_y,
909 add_type(&type, param, name, description);
915 const char* name,
const char* description) {
916 TSGDataType type(CT_MATRIX, ST_NONE, PT_UINT8, length_y,
918 add_type(&type, param, name, description);
924 const char* name,
const char* description) {
925 TSGDataType type(CT_MATRIX, ST_NONE, PT_INT16, length_y,
927 add_type(&type, param, name, description);
933 const char* name,
const char* description) {
934 TSGDataType type(CT_MATRIX, ST_NONE, PT_UINT16, length_y,
936 add_type(&type, param, name, description);
942 const char* name,
const char* description) {
943 TSGDataType type(CT_MATRIX, ST_NONE, PT_INT32, length_y,
945 add_type(&type, param, name, description);
951 const char* name,
const char* description) {
952 TSGDataType type(CT_MATRIX, ST_NONE, PT_UINT32, length_y,
954 add_type(&type, param, name, description);
960 const char* name,
const char* description) {
961 TSGDataType type(CT_MATRIX, ST_NONE, PT_INT64, length_y,
963 add_type(&type, param, name, description);
969 const char* name,
const char* description) {
970 TSGDataType type(CT_MATRIX, ST_NONE, PT_UINT64, length_y,
972 add_type(&type, param, name, description);
978 const char* name,
const char* description) {
979 TSGDataType type(CT_MATRIX, ST_NONE, PT_FLOAT32, length_y,
981 add_type(&type, param, name, description);
987 const char* name,
const char* description) {
988 TSGDataType type(CT_MATRIX, ST_NONE, PT_FLOAT64, length_y,
990 add_type(&type, param, name, description);
996 const char* name,
const char* description) {
997 TSGDataType type(CT_MATRIX, ST_NONE, PT_FLOATMAX, length_y,
999 add_type(&type, param, name, description);
1005 const char* name,
const char* description) {
1007 length_y, length_x);
1008 add_type(&type, param, name, description);
1014 const char* name,
const char* description) {
1015 TSGDataType type(CT_MATRIX, ST_STRING, PT_BOOL, length_y,
1017 add_type(&type, param, name, description);
1023 const char* name,
const char* description) {
1024 TSGDataType type(CT_MATRIX, ST_STRING, PT_CHAR, length_y,
1026 add_type(&type, param, name, description);
1032 const char* name,
const char* description) {
1033 TSGDataType type(CT_MATRIX, ST_STRING, PT_INT8, length_y,
1035 add_type(&type, param, name, description);
1041 const char* name,
const char* description) {
1042 TSGDataType type(CT_MATRIX, ST_STRING, PT_UINT8, length_y,
1044 add_type(&type, param, name, description);
1050 const char* name,
const char* description) {
1051 TSGDataType type(CT_MATRIX, ST_STRING, PT_INT16, length_y,
1053 add_type(&type, param, name, description);
1059 const char* name,
const char* description) {
1060 TSGDataType type(CT_MATRIX, ST_STRING, PT_UINT16, length_y,
1062 add_type(&type, param, name, description);
1068 const char* name,
const char* description) {
1069 TSGDataType type(CT_MATRIX, ST_STRING, PT_INT32, length_y,
1071 add_type(&type, param, name, description);
1077 const char* name,
const char* description) {
1078 TSGDataType type(CT_MATRIX, ST_STRING, PT_UINT32, length_y,
1080 add_type(&type, param, name, description);
1086 const char* name,
const char* description) {
1087 TSGDataType type(CT_MATRIX, ST_STRING, PT_INT64, length_y,
1089 add_type(&type, param, name, description);
1095 const char* name,
const char* description) {
1096 TSGDataType type(CT_MATRIX, ST_STRING, PT_UINT64, length_y,
1098 add_type(&type, param, name, description);
1104 const char* name,
const char* description) {
1105 TSGDataType type(CT_MATRIX, ST_STRING, PT_FLOAT32, length_y,
1107 add_type(&type, param, name, description);
1113 const char* name,
const char* description) {
1114 TSGDataType type(CT_MATRIX, ST_STRING, PT_FLOAT64, length_y,
1116 add_type(&type, param, name, description);
1122 const char* name,
const char* description) {
1123 TSGDataType type(CT_MATRIX, ST_STRING, PT_FLOATMAX, length_y,
1125 add_type(&type, param, name, description);
1131 const char* name,
const char* description) {
1132 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_BOOL, length_y,
1134 add_type(&type, param, name, description);
1140 const char* name,
const char* description) {
1141 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_CHAR, length_y,
1143 add_type(&type, param, name, description);
1149 const char* name,
const char* description) {
1150 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_INT8, length_y,
1152 add_type(&type, param, name, description);
1158 const char* name,
const char* description) {
1159 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_UINT8, length_y,
1161 add_type(&type, param, name, description);
1167 const char* name,
const char* description) {
1168 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_INT16, length_y,
1170 add_type(&type, param, name, description);
1176 const char* name,
const char* description) {
1177 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_UINT16, length_y,
1179 add_type(&type, param, name, description);
1185 const char* name,
const char* description) {
1186 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_INT32, length_y,
1188 add_type(&type, param, name, description);
1194 const char* name,
const char* description) {
1195 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_UINT32, length_y,
1197 add_type(&type, param, name, description);
1203 const char* name,
const char* description) {
1204 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_INT64, length_y,
1206 add_type(&type, param, name, description);
1212 const char* name,
const char* description) {
1213 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_UINT64, length_y,
1215 add_type(&type, param, name, description);
1221 const char* name,
const char* description) {
1222 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_FLOAT32, length_y,
1224 add_type(&type, param, name, description);
1230 const char* name,
const char* description) {
1231 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_FLOAT64, length_y,
1233 add_type(&type, param, name, description);
1239 const char* name,
const char* description) {
1240 TSGDataType type(CT_MATRIX, ST_SPARSE, PT_FLOATMAX, length_y,
1242 add_type(&type, param, name, description);
1249 const char* description)
1253 add_type(&type, param, name, description);
1257 const char* description)
1261 add_type(&type, param, name, description);
1265 const char* description)
1269 add_type(&type, param, name, description);
1273 const char* description)
1277 add_type(&type, param, name, description);
1281 const char* description)
1285 add_type(&type, param, name, description);
1289 const char* description)
1293 add_type(&type, param, name, description);
1297 const char* description)
1301 add_type(&type, param, name, description);
1305 const char* description)
1309 add_type(&type, param, name, description);
1313 const char* description)
1317 add_type(&type, param, name, description);
1321 const char* description)
1325 add_type(&type, param, name, description);
1329 const char* description)
1333 add_type(&type, param, name, description);
1337 const char* description)
1341 add_type(&type, param, name, description);
1345 const char* description)
1349 add_type(&type, param, name, description);
1353 const char* description)
1357 add_type(&type, param, name, description);
1361 const char* description)
1363 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_BOOL, ¶m->num_rows,
1365 add_type(&type, param, name, description);
1369 const char* description)
1371 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_CHAR, ¶m->num_rows,
1373 add_type(&type, param, name, description);
1377 const char* name,
const char* description)
1379 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_INT8, ¶m->num_rows,
1381 add_type(&type, param, name, description);
1385 const char* name,
const char* description)
1387 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_UINT8, ¶m->num_rows,
1389 add_type(&type, param, name, description);
1393 const char* name,
const char* description)
1395 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_INT16, ¶m->num_rows,
1397 add_type(&type, param, name, description);
1401 const char* name,
const char* description)
1403 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_UINT16, ¶m->num_rows,
1405 add_type(&type, param, name, description);
1409 const char* name,
const char* description)
1411 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_INT32, ¶m->num_rows,
1413 add_type(&type, param, name, description);
1417 const char* name,
const char* description)
1419 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_UINT32, ¶m->num_rows,
1421 add_type(&type, param, name, description);
1425 const char* name,
const char* description)
1427 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_INT64, ¶m->num_rows,
1429 add_type(&type, param, name, description);
1433 const char* name,
const char* description)
1435 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_UINT64, ¶m->num_rows,
1437 add_type(&type, param, name, description);
1441 const char* name,
const char* description)
1443 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_FLOAT32, ¶m->num_rows,
1445 add_type(&type, param, name, description);
1449 const char* name,
const char* description)
1451 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_FLOAT64, ¶m->num_rows,
1453 add_type(&type, param, name, description);
1457 const char* name,
const char* description)
1459 TSGDataType type(CT_SGMATRIX, ST_STRING, PT_FLOATMAX, ¶m->num_rows,
1461 add_type(&type, param, name, description);
1465 const char* name,
const char* description)
1467 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_BOOL, ¶m->num_rows,
1469 add_type(&type, param, name, description);
1473 const char* name,
const char* description)
1475 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_CHAR, ¶m->num_rows,
1477 add_type(&type, param, name, description);
1481 const char* name,
const char* description)
1483 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_INT8, ¶m->num_rows,
1485 add_type(&type, param, name, description);
1489 const char* name,
const char* description)
1491 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_UINT8, ¶m->num_rows,
1493 add_type(&type, param, name, description);
1497 const char* name,
const char* description)
1499 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_INT16, ¶m->num_rows,
1501 add_type(&type, param, name, description);
1505 const char* name,
const char* description)
1507 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_UINT16, ¶m->num_rows,
1509 add_type(&type, param, name, description);
1513 const char* name,
const char* description)
1515 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_INT32, ¶m->num_rows,
1517 add_type(&type, param, name, description);
1521 const char* name,
const char* description)
1523 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_UINT32, ¶m->num_rows,
1525 add_type(&type, param, name, description);
1529 const char* name,
const char* description)
1531 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_INT64, ¶m->num_rows,
1533 add_type(&type, param, name, description);
1537 const char* name,
const char* description)
1539 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_UINT64, ¶m->num_rows,
1541 add_type(&type, param, name, description);
1545 const char* name,
const char* description)
1547 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_FLOAT32, ¶m->num_rows,
1549 add_type(&type, param, name, description);
1553 const char* name,
const char* description)
1555 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_FLOAT64, ¶m->num_rows,
1557 add_type(&type, param, name, description);
1561 const char* name,
const char* description)
1563 TSGDataType type(CT_SGMATRIX, ST_SPARSE, PT_FLOATMAX, ¶m->num_rows,
1565 add_type(&type, param, name, description);
1571 const char* name,
const char* description)
1572 :m_datatype(*datatype)
1586 TParameter::new_prefix(
const char* s1,
const char* s2)
1588 char* tmp =
SG_MALLOC(
char, strlen(s1)+strlen(s2)+2);
1590 sprintf(tmp,
"%s%s/", s1, s2);
1609 char* p = new_prefix(prefix,
m_name);
1616 TParameter::delete_cont()
1634 if (*(
void**) data_start != NULL) {
1639 case CT_MATRIX:
case CT_SGMATRIX:
1641 case CT_SCALAR:
case CT_VECTOR:
case CT_SGVECTOR:
break;
1649 SG_FREE(*(
bool**) data_start);
break;
1651 SG_FREE(*(
char**) data_start);
break;
1653 SG_FREE(*(int8_t**) data_start);
break;
1655 SG_FREE(*(uint8_t**) data_start);
break;
1657 SG_FREE(*(int16_t**) data_start);
break;
1659 SG_FREE(*(uint16_t**) data_start);
break;
1661 SG_FREE(*(int32_t**) data_start);
break;
1663 SG_FREE(*(uint32_t**) data_start);
break;
1665 SG_FREE(*(int64_t**) data_start);
break;
1667 SG_FREE(*(uint64_t**) data_start);
break;
1677 for (
index_t i=0; i<old_length; i++)
1678 if (buf[i] != NULL)
SG_UNREF(buf[i]);
1684 for (
index_t i=0; i<old_length; i++) {
1718 SG_SERROR(
"TParameter::delete_cont(): Implementation "
1719 "error: Could not delete "
1720 "String<SGSerializable*>");
1725 for (
index_t i=0; i<old_length; i++) {
1759 SG_SERROR(
"TParameter::delete_cont(): Implementation "
1760 "error: Could not delete "
1761 "Sparse<SGSerializable*>");
1768 *(
void**) data_start = NULL;
1776 index_t new_length = new_len_y*new_len_x;
1777 if (new_length == 0)
return;
1799 *(
bool**) data_start
1802 *(
char**) data_start
1805 *(int8_t**) data_start
1808 *(uint8_t**) data_start
1809 =
SG_MALLOC(uint8_t, new_length);
break;
1811 *(int16_t**) data_start
1812 =
SG_MALLOC(int16_t, new_length);
break;
1814 *(uint16_t**) data_start
1815 =
SG_MALLOC(uint16_t, new_length);
break;
1817 *(int32_t**) data_start
1818 =
SG_MALLOC(int32_t, new_length);
break;
1820 *(uint32_t**) data_start
1821 =
SG_MALLOC(uint32_t, new_length);
break;
1823 *(int64_t**) data_start
1824 =
SG_MALLOC(int64_t, new_length);
break;
1826 *(uint64_t**) data_start
1827 =
SG_MALLOC(uint64_t, new_length);
break;
1885 SG_SERROR(
"TParameter::new_cont(): Implementation "
1886 "error: Could not allocate "
1887 "String<SGSerializable*>");
1890 memset(*(
void**) data_start, 0, new_length
1935 SG_SERROR(
"TParameter::new_cont(): Implementation "
1936 "error: Could not allocate "
1937 "Sparse<SGSerializable*>");
1940 memset(*(
void**) data_start, 0, new_length
1947 TParameter::new_sgserial(
CSGObject** param,
1948 EPrimitiveType
generic,
1949 const char* sgserializable_name,
1957 if (*param == NULL) {
1968 "Class `C%s%s' was not listed during compiling Shogun"
1969 " :( ... Can not construct it for `%s%s'!",
1970 sgserializable_name, buf, prefix,
m_name);
1984 const char* sgserial_name =
"";
1988 sgserial_name = (*(
CSGObject**) param)->get_name();
1989 (*(
CSGObject**) param)->is_generic(&
generic);
1992 if (!file->write_sgserializable_begin(
1995 if (*sgserial_name !=
'\0') {
1996 char* p = new_prefix(prefix,
m_name);
1998 ->save_serializable(file, p);
2000 if (!result)
return false;
2002 if (!file->write_sgserializable_end(
2007 param))
return false;
2020 if (!file->read_sgserializable_begin(
2023 if (*sgserial_name !=
'\0') {
2024 if (!new_sgserial((
CSGObject**) param,
generic,
2025 sgserial_name, prefix))
2028 char* p = new_prefix(prefix,
m_name);
2030 ->load_serializable(file, p);
2032 if (!result)
return false;
2034 if (!file->read_sgserializable_end(
2039 param))
return false;
2054 if (!save_ptype(file, param, prefix))
return false;
2057 len_real = str_ptr->
slen;
2058 if (str_ptr->
string == NULL && len_real != 0) {
2059 SG_SWARNING(
"Inconsistency between data structure and "
2060 "len during saving string `%s%s'! Continuing"
2065 if (!file->write_string_begin(
2067 for (
index_t i=0; i<len_real; i++) {
2068 if (!file->write_stringentry_begin(
2070 if (!save_ptype(file, (
char*) str_ptr->
string
2073 if (!file->write_stringentry_end(
2076 if (!file->write_string_end(
2081 if (spr_ptr->
features == NULL && len_real != 0) {
2082 SG_SWARNING(
"Inconsistency between data structure and "
2083 "len during saving sparse `%s%s'! Continuing"
2088 if (!file->write_sparse_begin(
2090 len_real))
return false;
2091 for (
index_t i=0; i<len_real; i++) {
2095 if (!file->write_sparseentry_begin(
2100 prefix))
return false;
2101 if (!file->write_sparseentry_end(
2105 if (!file->write_sparse_end(
2107 len_real))
return false;
2124 if (!load_ptype(file, param, prefix))
return false;
2127 if (!file->read_string_begin(
2130 str_ptr->
string = len_real > 0
2132 for (
index_t i=0; i<len_real; i++) {
2133 if (!file->read_stringentry_begin(
2135 if (!load_ptype(file, (
char*) str_ptr->
string
2138 if (!file->read_stringentry_end(
2141 if (!file->read_string_end(
2144 str_ptr->
slen = len_real;
2147 if (!file->read_sparse_begin(
2149 &len_real))
return false;
2153 for (
index_t i=0; i<len_real; i++) {
2157 if (!file->read_sparseentry_begin(
2162 prefix))
return false;
2163 if (!file->read_sparseentry_end(
2167 if (!file->read_sparse_end(
2169 len_real))
return false;
2180 const int32_t buflen=100;
2193 if (!save_stype(file,
m_parameter, prefix))
return false;
2195 case CT_VECTOR:
case CT_MATRIX:
case CT_SGVECTOR:
case CT_SGMATRIX:
2196 index_t len_real_y = 0, len_real_x = 0;
2199 if (*(
void**)
m_parameter == NULL && len_real_y != 0) {
2200 SG_SWARNING(
"Inconsistency between data structure and "
2201 "len_y during saving `%s%s'! Continuing with "
2211 case CT_VECTOR:
case CT_SGVECTOR:
2214 case CT_MATRIX:
case CT_SGMATRIX:
2216 if (*(
void**)
m_parameter == NULL && len_real_x != 0) {
2217 SG_SWARNING(
"Inconsistency between data structure and "
2218 "len_x during saving `%s%s'! Continuing "
2224 if (len_real_x *len_real_y == 0)
2225 len_real_x = len_real_y = 0;
2228 case CT_SCALAR:
break;
2232 len_real_y, len_real_x))
2237 for (
index_t x=0; x<len_real_x; x++)
2238 for (
index_t y=0; y<len_real_y; y++) {
2239 if (!file->write_item_begin(
2260 file, (*(
char**) data_start)
2262 prefix))
return false;
2263 if (!file->write_item_end(
2271 len_real_y, len_real_x))
2286 const int32_t buflen=100;
2304 case CT_VECTOR:
case CT_MATRIX:
case CT_SGVECTOR:
case CT_SGMATRIX:
2305 index_t len_read_y = 0, len_read_x = 0;
2308 &len_read_y, &len_read_x))
2315 case CT_VECTOR:
case CT_SGVECTOR:
2317 new_cont(len_read_y, len_read_x);
2319 case CT_MATRIX:
case CT_SGMATRIX:
2320 new_cont(len_read_y, len_read_x);
2326 for (
index_t x=0; x<len_read_x; x++)
2328 for (
index_t y=0; y<len_read_y; y++)
2330 if (!file->read_item_begin(
2351 file, (*(
char**) data_start)
2353 prefix))
return false;
2354 if (!file->read_item_end(
2364 case CT_VECTOR:
case CT_SGVECTOR:
2367 case CT_MATRIX:
case CT_SGMATRIX:
2376 len_read_y, len_read_x))
2403 const char* name,
const char* description)
2405 if (name == NULL || *name ==
'\0')
2406 SG_SERROR(
"FATAL: Parameter::add_type(): `name' is empty!");
2410 SG_SERROR(
"FATAL: Parameter::add_type(): "
2411 "Double parameter `%s'!", name);
2414 new TParameter(type, param, name, description)
2462 if (!strcmp(own->m_name, current->
m_name))
2464 if (own->m_datatype==current_type)
2471 SG_SERROR(
"given parameter name %s has a different type"
2472 " than existing one\n", current->
m_name);
2481 SG_SERROR(
"parameter with name %s does not exist\n",
2486 if (current_type.
m_ptype==PT_SGOBJECT)
2489 if (own->m_datatype.m_stype==ST_NONE)
2491 if (own->m_datatype.m_ctype==CT_SCALAR)
2496 if ((*to_ref)!=(*to_unref))
2509 for (
index_t j=0; j<own->m_datatype.get_num_elements(); ++j)
2511 if ((*to_ref)[j]!=(*to_unref)[j])
2520 SG_SERROR(
"primitive type PT_SGOBJECT occurred with structure "
2521 "type other than ST_NONE");
2527 if (current_type.
m_ctype==CT_SCALAR)
2530 dest=own->m_parameter;
2536 if (own->m_datatype.m_ptype==PT_SGOBJECT)
2551 switch (own->m_datatype.m_ptype)
2569 memcpy(dest, source, own->m_datatype.get_size());
2587 if (!strcmp(name,
m_params[i]->m_name))