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
features
MatrixFeatures.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 _MATRIX_FEATURES__H__
12
#define _MATRIX_FEATURES__H__
13
14
#include <
shogun/features/Features.h
>
15
#include <
shogun/lib/SGMatrixList.h
>
16
17
18
namespace
shogun
19
{
20
29
template
<
class
ST >
class
CMatrixFeatures
:
public
CFeatures
30
{
31
public
:
33
CMatrixFeatures
();
34
40
CMatrixFeatures
(int32_t num_vecs, int32_t num_feats = 0);
41
47
CMatrixFeatures
(
SGMatrixList< ST >
feats, int32_t num_feats = 0);
48
60
CMatrixFeatures
(
SGMatrix< ST >
feats, int32_t feat_length, int32_t num_vecs);
61
66
virtual
CFeatures
*
duplicate
()
const
;
67
69
virtual
~CMatrixFeatures
();
70
75
virtual
EFeatureType
get_feature_type
()
const
;
76
81
virtual
EFeatureClass
get_feature_class
()
const
;
82
89
virtual
int32_t
get_num_vectors
()
const
{
return
m_num_vectors; }
90
95
virtual
int32_t
get_size
()
const
;
96
103
SGMatrix< ST >
get_feature_vector
(int32_t num)
const
;
104
111
void
get_feature_vector_col
(
SGVector< ST >
out, int32_t num, int32_t col)
const
;
112
118
void
set_feature_vector
(
SGMatrix< ST >
const
& vec, int32_t num);
119
124
inline
SGMatrixList< ST >
get_features
()
const
{
return
m_features; }
125
131
void
set_features
(
SGMatrixList< ST >
features, int32_t num_feats);
132
134
virtual
const
char
*
get_name
()
const
{
return
"MatrixFeatures"
; }
135
137
inline
int32_t
get_num_features
()
const
{
return
m_num_features; }
138
139
private
:
141
void
init();
142
144
void
cleanup();
145
146
private
:
148
int32_t m_num_vectors;
149
151
int32_t m_num_features;
152
154
SGMatrixList< ST >
m_features;
155
156
};
/* class CMatrixFeatures */
157
158
}
/* namespace shogun */
159
160
#endif
/* _MATRIX_FEATURES__H__ */
SHOGUN
Machine Learning Toolbox - Documentation