SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EigenSolver.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 EIGEN_SOLVER_H_
11 #define EIGEN_SOLVER_H_
12 
13 #include <shogun/lib/config.h>
14 #include <shogun/base/Parameter.h>
16 
17 namespace shogun
18 {
19 
24 class CEigenSolver : public CSGObject
25 {
26 public:
29  : CSGObject()
30  {
31  init();
32  }
33 
41  : CSGObject()
42  {
43  init();
44 
45  m_linear_operator=linear_operator;
47  }
49  virtual ~CEigenSolver()
50  {
52  }
53 
58  virtual void compute() = 0;
59 
61  void set_min_eigenvalue(float64_t min_eigenvalue)
62  {
63  m_min_eigenvalue=min_eigenvalue;
64  m_is_computed_min=true;
65  }
66 
69  {
70  return m_min_eigenvalue;
71  }
72 
74  void set_max_eigenvalue(float64_t max_eigenvalue)
75  {
76  m_max_eigenvalue=max_eigenvalue;
77  m_is_computed_max=true;
78  }
79 
82  {
83  return m_max_eigenvalue;
84  }
85 
87  virtual const char* get_name() const
88  {
89  return "EigenSolver";
90  }
91 protected:
94 
97 
100 
103 
106 
107 private:
109  void init()
110  {
111  m_min_eigenvalue=0.0;
112  m_max_eigenvalue=0.0;
113  m_linear_operator=NULL;
114  m_is_computed_min=false;
115  m_is_computed_max=false;
116 
117  SG_ADD(&m_min_eigenvalue, "min_eigenvalue",
118  "Minimum eigenvalue of a real valued self-adjoint linear operator",
120 
121  SG_ADD(&m_max_eigenvalue, "max_eigenvalue",
122  "Maximum eigenvalue of a real valued self-adjoint linear operator",
124 
125  SG_ADD((CSGObject**)&m_linear_operator, "linear_operator",
126  "Self-adjoint linear operator",
128 
129  SG_ADD(&m_is_computed_min, "is_computed_min",
130  "Flag denoting that the minimum eigenvalue has already been computed",
132 
133  SG_ADD(&m_max_eigenvalue, "is_computed_max",
134  "Flag denoting that the maximum eigenvalue has already been computed",
136 
137  }
138 };
139 
140 }
141 
142 #endif // EIGEN_SOLVER_H_

SHOGUN Machine Learning Toolbox - Documentation