SHOGUN  3.2.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
IndependentJob.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) 2013 Soumyajit De
8  */
9 
10 #ifndef INDEPENDENT_JOB_H_
11 #define INDEPENDENT_JOB_H_
12 
13 #include <shogun/lib/config.h>
14 #include <shogun/base/SGObject.h>
15 #include <shogun/base/Parameter.h>
17 
18 namespace shogun
19 {
20 
26 class CIndependentJob : public CSGObject
27 {
28 public:
31  : CSGObject()
32  {
33  init();
34  }
35 
42  : CSGObject(), m_aggregator(aggregator)
43  {
44  init();
45 
46  m_aggregator=aggregator;
48  }
49 
51  virtual ~CIndependentJob()
52  {
54  }
55 
60  virtual void compute() = 0;
61 
63  virtual const char* get_name() const
64  {
65  return "IndependentJob";
66  }
67 protected:
70 
71 private:
73  void init()
74  {
75  m_aggregator=NULL;
76 
77  SG_ADD((CSGObject**)&m_aggregator, "job_result_aggregator",
78  "Job result aggregator for current job", MS_NOT_AVAILABLE);
79  }
80 };
81 
82 }
83 
84 #endif // INDEPENDENT_JOB_H_
#define SG_UNREF(x)
Definition: SGRefObject.h:35
virtual const char * get_name() const
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:98
CIndependentJob(CJobResultAggregator *aggregator)
#define SG_REF(x)
Definition: SGRefObject.h:34
Abstract base class that provides an interface for computing an aggeregation of the job results of in...
Abstract base for general computation jobs to be registered in CIndependentComputationEngine. compute method produces a job result and submits it to the internal JobResultAggregator. Each set of jobs that form a result will share the same job result aggregator.
virtual void compute()=0
#define SG_ADD(...)
Definition: SGObject.h:67
CJobResultAggregator * m_aggregator

SHOGUN 机器学习工具包 - 项目文档