SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
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 
21 namespace shogun
22 {
23  class CDistance;
24  class CFeatures;
25  class CMulticlassLabels;
26 
31 class CDistanceMachine : public CMachine
32 {
33  public:
36 
38  virtual ~CDistanceMachine();
39 
44  void set_distance(CDistance* d);
45 
50  CDistance* get_distance() const;
51 
61  void distances_lhs(float64_t* result,int32_t idx_a1,int32_t idx_a2,int32_t idx_b);
62 
72  void distances_rhs(float64_t* result,int32_t idx_b1,int32_t idx_b2,int32_t idx_a);
73 
79  virtual const char* get_name() const { return "DistanceMachine"; }
80 
88  virtual CMulticlassLabels* apply_multiclass(CFeatures* data=NULL);
89 
97  virtual float64_t apply_one(int32_t num);
98 
99  protected:
109  virtual void store_model_features();
110 
116  static void* run_distance_thread_lhs(void* p);
117 
123  static void* run_distance_thread_rhs(void* p);
124 
125  private:
126  void init();
127 
128  protected:
131 };
132 }
133 #endif
CDistance * get_distance() const
Class Distance, a base class for all the distances used in the Shogun toolbox.
Definition: Distance.h:87
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:143
Multiclass Labels for multi-class classification.
double float64_t
Definition: common.h:50
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)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
void set_distance(CDistance *d)
static void * run_distance_thread_rhs(void *p)

SHOGUN Machine Learning Toolbox - Documentation