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
EuclideanDistance.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) 2007-2009 Soeren Sonnenburg
8
* Copyright (C) 2007-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9
*/
10
11
#ifndef _EUCLIDEANDISTANCE_H__
12
#define _EUCLIDEANDISTANCE_H__
13
14
#include <
shogun/lib/common.h
>
15
#include <
shogun/distance/RealDistance.h
>
16
#include <
shogun/features/DenseFeatures.h
>
17
18
namespace
shogun
19
{
43
class
CEuclideanDistance
:
public
CRealDistance
44
{
45
public
:
47
CEuclideanDistance
();
48
54
CEuclideanDistance
(
CDenseFeatures<float64_t>
* l,
CDenseFeatures<float64_t>
* r);
55
virtual
~CEuclideanDistance
();
56
63
virtual
bool
init
(
CFeatures
* l,
CFeatures
* r);
64
66
virtual
void
cleanup
();
67
72
virtual
EDistanceType
get_distance_type
() {
return
D_EUCLIDEAN
; }
73
78
inline
virtual
EFeatureType
get_feature_type
() {
return
F_DREAL
; }
79
84
virtual
const
char
*
get_name
()
const
{
return
"EuclideanDistance"
; }
85
91
virtual
bool
get_disable_sqrt
() {
return
disable_sqrt
; };
92
98
virtual
void
set_disable_sqrt
(
bool
state) {
disable_sqrt
=state; };
99
112
virtual
float64_t
distance_upper_bounded
(int32_t idx_a, int32_t idx_b,
float64_t
upper_bound);
113
114
protected
:
118
virtual
float64_t
compute
(int32_t idx_a, int32_t idx_b);
119
120
private
:
121
void
init();
122
123
protected
:
125
bool
disable_sqrt
;
126
};
127
128
}
// namespace shogun
129
#endif
/* _EUCLIDEANDISTANCE_H__ */
SHOGUN
Machine Learning Toolbox - Documentation