SHOGUN
v2.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
labels
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
>
15
#include <
shogun/labels/LabelTypes.h
>
16
#include <
shogun/lib/DynamicObjectArray.h
>
17
#include <
shogun/lib/StructuredData.h
>
18
#include <
shogun/lib/StructuredDataTypes.h
>
19
20
namespace
shogun {
21
23
class
CStructuredLabels
:
public
CLabels
24
{
25
26
public
:
28
CStructuredLabels
();
29
38
CStructuredLabels
(int32_t num_labels);
39
41
virtual
~CStructuredLabels
();
42
47
static
CStructuredLabels
*
obtain_from_generic
(
CLabels
* base_labels);
48
55
virtual
void
ensure_valid
(
const
char
* context = NULL);
56
65
void
add_label
(
CStructuredData
* label);
66
73
CDynamicObjectArray
*
get_labels
()
const
;
74
81
CStructuredData
*
get_label
(int32_t idx);
82
93
bool
set_label
(int32_t idx,
CStructuredData
* label);
94
99
virtual
int32_t
get_num_labels
();
100
102
virtual
const
char
*
get_name
()
const
{
return
"StructuredLabels"
; }
103
108
virtual
ELabelType
get_label_type
() {
return
LT_STRUCTURED
; }
109
114
inline
EStructuredDataType
get_structured_data_type
() {
return
m_sdt
; }
115
116
private
:
118
void
init();
119
121
void
ensure_valid_sdt(
CStructuredData
* label);
122
123
protected
:
125
CDynamicObjectArray
*
m_labels
;
126
128
EStructuredDataType
m_sdt
;
129
130
};
/* class CStructuredLabels */
131
132
}
/* namespace shogun */
133
134
#endif
/* _STRUCTUREDLABELS_H__ */
SHOGUN
Machine Learning Toolbox - Documentation