SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StructuredLabels.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2012 Fernando José Iglesias García
8  * Copyright (C) 2012 Fernando José Iglesias García
9  */
10 
11 #ifndef _STRUCTURED_LABELS__H__
12 #define _STRUCTURED_LABELS__H__
13 
14 #include <shogun/labels/Labels.h>
19 
20 namespace shogun {
21 
23 class CStructuredLabels : public CLabels
24 {
25 
26  public:
29 
38  CStructuredLabels(int32_t num_labels);
39 
41  virtual ~CStructuredLabels();
42 
49  virtual void ensure_valid(const char* context = NULL);
50 
59  void add_label(CStructuredData* label);
60 
68 
75  CStructuredData* get_label(int32_t idx);
76 
87  bool set_label(int32_t idx, CStructuredData* label);
88 
93  virtual int32_t get_num_labels() const;
94 
96  virtual const char* get_name() const { return "StructuredLabels"; }
97 
102  virtual ELabelType get_label_type() const { return LT_STRUCTURED; }
103 
109 
110  private:
112  void init();
113 
115  void ensure_valid_sdt(CStructuredData* label);
116 
117  protected:
120 
123 
124 }; /* class CStructuredLabels */
125 
126 } /* namespace shogun */
127 
128 #endif /* _STRUCTUREDLABELS_H__ */

SHOGUN Machine Learning Toolbox - Documentation