SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
features
MatrixFeatures.h
浏览该文件的文档.
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
97
SGMatrix< ST >
get_feature_vector
(int32_t num)
const
;
98
105
void
get_feature_vector_col
(
SGVector< ST >
out, int32_t num, int32_t col)
const
;
106
112
void
set_feature_vector
(
SGMatrix< ST >
const
vec, int32_t num);
113
118
inline
SGMatrixList< ST >
get_features
()
const
{
return
m_features; }
119
125
void
set_features
(
SGMatrixList< ST >
features, int32_t num_feats);
126
128
virtual
const
char
*
get_name
()
const
{
return
"MatrixFeatures"
; }
129
131
inline
int32_t
get_num_features
()
const
{
return
m_num_features; }
132
136
static
CMatrixFeatures
*
obtain_from_generic
(
CFeatures
*
const
base_features);
137
138
private
:
140
void
init();
141
143
void
cleanup();
144
145
private
:
147
int32_t m_num_vectors;
148
150
int32_t m_num_features;
151
153
SGMatrixList< ST >
m_features;
154
155
};
/* class CMatrixFeatures */
156
157
}
/* namespace shogun */
158
159
#endif
/* _MATRIX_FEATURES__H__ */
SHOGUN
机器学习工具包 - 项目文档