SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LabelsFactory.cpp
Go to the documentation of this file.
2 
10 
11 using namespace shogun;
12 
14 {
15  ASSERT(base_labels != NULL)
16  if (base_labels->get_label_type() == LT_BINARY)
17  return static_cast<CBinaryLabels*>(base_labels);
18  else
19  SG_SERROR("base_labels must be of dynamic type CBinaryLabels")
20 
21  return NULL;
22 }
23 
25 {
26  ASSERT(base_labels != NULL)
27  if (base_labels->get_label_type() == LT_LATENT)
28  return static_cast<CLatentLabels*>(base_labels);
29  else
30  SG_SERROR("base_labels must be of dynamic type CLatentLabels\n")
31 
32  return NULL;
33 }
34 
36 {
37  ASSERT(base_labels != NULL)
38  if (base_labels->get_label_type() == LT_MULTICLASS)
39  return static_cast<CMulticlassLabels*>(base_labels);
40  else
41  SG_SERROR("base_labels must be of dynamic type CMulticlassLabels\n")
42 
43  return NULL;
44 }
45 
47 {
48  ASSERT(base_labels != NULL)
49  if (base_labels->get_label_type() == LT_REGRESSION)
50  return static_cast<CRegressionLabels*>(base_labels);
51  else
52  SG_SERROR("base_labels must be of dynamic type CRegressionLabels")
53 
54  return NULL;
55 }
56 
58 {
59  ASSERT(base_labels != NULL)
60  if (base_labels->get_label_type() == LT_STRUCTURED)
61  return static_cast<CStructuredLabels*>(base_labels);
62  else
63  SG_SERROR("base_labels must be of dynamic type CStructuredLabels\n")
64 
65  return NULL;
66 }
67 
68 
70 {
71  ASSERT(base_labels != NULL)
72  if (base_labels->get_label_type() == LT_SPARSE_MULTILABEL)
73  return static_cast<CMultilabelLabels*>(base_labels);
74  else
75  SG_SERROR("base_labels must be of dynamic type CMultilabelLabels\n")
76 
77  return NULL;
78 }
79 
81 {
82  ASSERT(base_labels != NULL)
83  CMulticlassSOLabels* labels = dynamic_cast<CMulticlassSOLabels*>(base_labels);
84  if (labels == NULL)
85  SG_SERROR("base_labels must be of dynamic type CMulticlassSOLabels\n")
86 
87  return labels;
88 }

SHOGUN Machine Learning Toolbox - Documentation