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
structure
HMSVMLabels.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 _HMSVM_LABELS__H__
12
#define _HMSVM_LABELS__H__
13
14
#include <
shogun/labels/StructuredLabels.h
>
15
#include <
shogun/lib/SGVector.h
>
16
#include <
shogun/lib/StructuredData.h
>
17
#include <
shogun/lib/StructuredDataTypes.h
>
18
19
namespace
shogun
20
{
21
22
class
CHMSVMLabels;
23
26
class
CSequence
:
public
CStructuredData
27
{
28
public
:
30
STRUCTURED_DATA_TYPE
(
SDT_SEQUENCE
);
31
36
CSequence
(
SGVector< int32_t >
seq =
SGVector<int32_t>
()) :
CStructuredData
(),
data
(seq) { }
37
39
~CSequence
() { }
40
45
static
CSequence
*
obtain_from_generic
(
CStructuredData
* base_data)
46
{
47
if
( base_data->
get_structured_data_type
() ==
SDT_SEQUENCE
)
48
return
(
CSequence
*) base_data;
49
else
50
SG_SERROR
(
"base_data must be of dynamic type CSequence\n"
);
51
52
return
NULL;
53
}
54
56
virtual
const
char
*
get_name
()
const
{
return
"Sequence"
; }
57
59
SGVector<int32_t>
get_data
()
const
{
return
data
; }
60
61
protected
:
62
64
SGVector< int32_t >
data
;
65
66
};
67
72
class
CHMSVMLabels
:
public
CStructuredLabels
73
{
74
public
:
76
CHMSVMLabels
();
77
83
CHMSVMLabels
(int32_t num_labels, int32_t num_states);
84
95
CHMSVMLabels
(
SGVector< int32_t >
labels, int32_t label_length, int32_t num_labels, int32_t num_states);
96
98
virtual
~CHMSVMLabels
();
99
101
virtual
const
char
*
get_name
()
const
{
return
"HMSVMLabels"
; }
102
112
void
add_label
(
SGVector< int32_t >
label);
113
118
inline
int32_t
get_num_states
()
const
{
return
m_num_states; };
119
120
private
:
122
void
init();
123
124
private
:
129
int32_t m_num_states;
130
131
};
/* CHMSVMLabels */
132
133
}
/* namespace shogun */
134
135
#endif
/* _HMSVM_LABELS__H__ */
SHOGUN
Machine Learning Toolbox - Documentation