SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
distance
RealDistance.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) 1999-2009 Soeren Sonnenburg
8
* Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9
*/
10
11
#ifndef _REALDISTANCE_H__
12
#define _REALDISTANCE_H__
13
14
#include <
shogun/distance/DenseDistance.h
>
15
#include <
shogun/lib/common.h
>
16
17
namespace
shogun
18
{
20
class
CRealDistance
:
public
CDenseDistance
<float64_t>
21
{
22
public
:
24
CRealDistance
() :
CDenseDistance
<
float64_t
>() {}
25
32
virtual
bool
init
(
CFeatures
* l,
CFeatures
* r)
33
{
34
CDenseDistance<float64_t>::init
(l,r);
35
36
ASSERT
(l->
get_feature_type
()==
F_DREAL
)
37
ASSERT
(r->
get_feature_type
()==
F_DREAL
)
38
39
return
true
;
40
}
41
46
virtual
EFeatureType
get_feature_type
() {
return
F_DREAL
; }
47
53
virtual
const
char
*
get_name
()
const
{
return
"RealDistance"
; }
54
59
virtual
void
cleanup
()=0;
60
67
virtual
EDistanceType
get_distance_type
()=0 ;
68
69
protected
:
73
virtual
float64_t
compute
(int32_t x, int32_t y)=0;
74
};
75
}
// namespace shogun
76
#endif
SHOGUN
机器学习工具包 - 项目文档