SHOGUN
v3.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
DenseDistance.cpp
Go to the documentation of this file.
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
Machine Learning Toolbox - Documentation