SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
machine
DistanceMachine.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) 2006-2009 Christian Gehl
8
* Written (W) 2006-2009 Soeren Sonnenburg
9
* Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
10
*/
11
12
#ifndef _DISTANCE_MACHINE_H__
13
#define _DISTANCE_MACHINE_H__
14
15
#include <
shogun/lib/common.h
>
16
#include <
shogun/distance/Distance.h
>
17
#include <
shogun/labels/Labels.h
>
18
#include <
shogun/labels/RegressionLabels.h
>
19
#include <
shogun/machine/Machine.h
>
20
21
#include <stdio.h>
22
23
namespace
shogun
24
{
25
class
CLabels;
26
class
CRegressionLabels;
27
class
CDistance;
28
class
CMachine;
29
34
class
CDistanceMachine
:
public
CMachine
35
{
36
public
:
38
CDistanceMachine
();
39
41
virtual
~CDistanceMachine
();
42
47
void
set_distance
(
CDistance
* d);
48
53
CDistance
*
get_distance
()
const
;
54
64
void
distances_lhs
(
float64_t
* result,int32_t idx_a1,int32_t idx_a2,int32_t idx_b);
65
75
void
distances_rhs
(
float64_t
* result,int32_t idx_b1,int32_t idx_b2,int32_t idx_a);
76
82
virtual
const
char
*
get_name
()
const
{
return
"DistanceMachine"
; }
83
91
virtual
CMulticlassLabels
*
apply_multiclass
(
CFeatures
* data=NULL);
92
100
virtual
float64_t
apply_one
(int32_t num);
101
102
protected
:
112
virtual
void
store_model_features
();
113
119
static
void
*
run_distance_thread_lhs
(
void
* p);
120
126
static
void
*
run_distance_thread_rhs
(
void
* p);
127
128
private
:
129
void
init();
130
131
protected
:
133
CDistance
*
distance
;
134
};
135
}
136
#endif
SHOGUN
机器学习工具包 - 项目文档