SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DistanceMachine.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) 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/config.h>
16 
17 #include <shogun/lib/common.h>
18 #include <shogun/machine/Machine.h>
19 
20 #include <stdio.h>
21 
22 namespace shogun
23 {
24  class CDistance;
25  class CFeatures;
26  class CMulticlassLabels;
27 
32 class CDistanceMachine : public CMachine
33 {
34  public:
37 
39  virtual ~CDistanceMachine();
40 
45  void set_distance(CDistance* d);
46 
51  CDistance* get_distance() const;
52 
62  void distances_lhs(float64_t* result,int32_t idx_a1,int32_t idx_a2,int32_t idx_b);
63 
73  void distances_rhs(float64_t* result,int32_t idx_b1,int32_t idx_b2,int32_t idx_a);
74 
80  virtual const char* get_name() const { return "DistanceMachine"; }
81 
89  virtual CMulticlassLabels* apply_multiclass(CFeatures* data=NULL);
90 
98  virtual float64_t apply_one(int32_t num);
99 
100  protected:
110  virtual void store_model_features();
111 
117  static void* run_distance_thread_lhs(void* p);
118 
124  static void* run_distance_thread_rhs(void* p);
125 
126  private:
127  void init();
128 
129  protected:
132 };
133 }
134 #endif

SHOGUN Machine Learning Toolbox - Documentation