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
distance
RealDistance.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) 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
inline
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
Machine Learning Toolbox - Documentation