SHOGUN  v3.2.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
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>
17 #include <shogun/labels/Labels.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:
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:
134 };
135 }
136 #endif
CDistance * get_distance() const
Class Distance, a base class for all the distances used in the Shogun toolbox.
Definition: Distance.h:80
virtual void store_model_features()
virtual CMulticlassLabels * apply_multiclass(CFeatures *data=NULL)
void distances_lhs(float64_t *result, int32_t idx_a1, int32_t idx_a2, int32_t idx_b)
static void * run_distance_thread_lhs(void *p)
virtual const char * get_name() const
A generic DistanceMachine interface.
A generic learning machine interface.
Definition: Machine.h:138
Multiclass Labels for multi-class classification.
double float64_t
Definition: common.h:48
virtual float64_t apply_one(int32_t num)
void distances_rhs(float64_t *result, int32_t idx_b1, int32_t idx_b2, int32_t idx_a)
The class Features is the base class of all feature objects.
Definition: Features.h:62
void set_distance(CDistance *d)
static void * run_distance_thread_rhs(void *p)

SHOGUN Machine Learning Toolbox - Documentation