SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OperatorFunction.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) 2013 Soumyajit De
8  */
9 
10 #ifndef OPERATOR_FUNCTION_H_
11 #define OPERATOR_FUNCTION_H_
12 
13 #include <shogun/lib/config.h>
14 #include <shogun/base/SGObject.h>
15 #include <shogun/base/Parameter.h>
18 
19 namespace shogun
20 {
21 
24 {
26  OF_LOG=1,
29 };
30 
31 template<class T> class SGVector;
32 class CJobResultAggregator;
33 template<class RetType, class OperandType> class CLinearOperator;
34 
40 template<class T> class COperatorFunction : public CSGObject
41 {
42 public:
45  : CSGObject(),
47  {
48  init();
49  }
50 
61  : CSGObject(),
62  m_function_type(type)
63  {
64  init();
65 
68 
69  m_computation_engine=engine;
71  }
72 
75  {
78  }
79 
82  {
83  return m_linear_operator;
84  }
85 
91  virtual void precompute() = 0;
92 
103  virtual CJobResultAggregator* submit_jobs(SGVector<T> sample) = 0;
104 
106  virtual const char* get_name() const
107  {
108  return "OperatorFunction";
109  }
110 protected:
113 
116 
119 
120 private:
122  void init()
123  {
124  m_linear_operator=NULL;
126 
127  SG_ADD((CSGObject**)&m_linear_operator, "linear_operator",
128  "Linear operator of this operator function", MS_NOT_AVAILABLE);
129 
130  SG_ADD((CSGObject**)&m_computation_engine, "computation_engine",
131  "Computation engine for the jobs this will generate", MS_NOT_AVAILABLE);
132  }
133 };
134 }
135 
136 #endif // OPERATOR_FUCNTION_H_

SHOGUN Machine Learning Toolbox - Documentation