SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
distance
DenseDistance.cpp
浏览该文件的文档.
1
#include <
shogun/distance/DenseDistance.h
>
2
3
namespace
shogun {
4
5
template
<
class
ST>
bool
CDenseDistance<ST>::init
(
CFeatures
* l,
CFeatures
* r)
6
{
7
CDistance::init(l,r);
8
9
ASSERT
(l->
get_feature_class
()==
C_DENSE
)
10
ASSERT
(r->
get_feature_class
()==
C_DENSE
)
11
ASSERT
(l->
get_feature_type
()==this->get_feature_type())
12
ASSERT
(r->
get_feature_type
()==this->get_feature_type())
13
14
15
if
( ((
CDenseFeatures<ST>
*) l)->get_num_features() != ((
CDenseFeatures<ST>
*) r)->get_num_features() )
16
{
17
SG_ERROR
(
"train or test features #dimension mismatch (l:%d vs. r:%d)\n"
,
18
((
CDenseFeatures<ST>
*) l)->get_num_features(),((
CDenseFeatures<ST>
*) r)->get_num_features());
19
}
20
21
return
true
;
22
}
23
28
template
<>
EFeatureType
CDenseDistance<float64_t>::get_feature_type
() {
return
F_DREAL
; }
29
34
template
<>
EFeatureType
CDenseDistance<uint64_t>::get_feature_type
() {
return
F_ULONG
; }
35
40
template
<>
EFeatureType
CDenseDistance<int32_t>::get_feature_type
() {
return
F_INT
; }
41
46
template
<>
EFeatureType
CDenseDistance<uint16_t>::get_feature_type
() {
return
F_WORD
; }
47
52
template
<>
EFeatureType
CDenseDistance<int16_t>::get_feature_type
() {
return
F_SHORT
; }
53
58
template
<>
EFeatureType
CDenseDistance<uint8_t>::get_feature_type
() {
return
F_BYTE
; }
59
64
template
<>
EFeatureType
CDenseDistance<char>::get_feature_type
() {
return
F_CHAR
; }
65
66
template
class
CDenseDistance<char>
;
67
template
class
CDenseDistance<uint8_t>
;
68
template
class
CDenseDistance<int16_t>
;
69
template
class
CDenseDistance<uint16_t>
;
70
template
class
CDenseDistance<int32_t>
;
71
template
class
CDenseDistance<uint64_t>
;
72
template
class
CDenseDistance<float64_t>
;
73
}
SHOGUN
机器学习工具包 - 项目文档