SHOGUN  v3.0.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
IterativeLinearSolver.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 ITERATIVE_LINEAR_SOLVER_H_
11 #define ITERATIVE_LINEAR_SOLVER_H_
12 
13 #include <shogun/lib/config.h>
15 
16 namespace shogun
17 {
18 
24 template<class T, class ST=T> class CIterativeLinearSolver : public CLinearSolver<T, ST>
25 {
26 
27 public:
30 
32  CIterativeLinearSolver(bool store_residuals);
33 
35  virtual ~CIterativeLinearSolver();
36 
45 
47  void set_iteration_limit(index_t iteration_limit)
48  {
49  m_max_iteration_limit=iteration_limit;
51  {
54  }
55  }
56 
59  {
60  return m_max_iteration_limit;
61  }
62 
64  void set_relative_tolerence(float64_t relative_tolerence)
65  {
66  m_relative_tolerence=relative_tolerence;
67  }
68 
71  {
72  return m_relative_tolerence;
73  }
74 
76  void set_absolute_tolerence(float64_t absolute_tolerence)
77  {
78  m_absolute_tolerence=absolute_tolerence;
79  }
80 
83  {
84  return m_absolute_tolerence;
85  }
86 
89  {
90  return m_residuals;
91  }
92 
94  virtual const char* get_name() const
95  {
96  return "IterativeLinearSolver";
97  }
98 
99 protected:
100 
103 
106 
109 
112 
115 private:
117  void init();
118 
119 };
120 
121 }
122 
123 #endif // ITERATIVE_LINEAR_SOLVER_H_
virtual const char * get_name() const
int32_t index_t
Definition: common.h:60
const index_t get_iteration_limit() const
void set_relative_tolerence(float64_t relative_tolerence)
void set_iteration_limit(index_t iteration_limit)
abstract template base for all iterative linear solvers such as conjugate gradient (CG) solvers...
SGVector< float64_t > get_residuals() const
double float64_t
Definition: common.h:48
Abstract template base class that represents a linear operator, e.g. a matrix.
void set_const(T const_elem)
Definition: SGVector.cpp:124
virtual SGVector< T > solve(CLinearOperator< T > *A, SGVector< ST > b)=0
void set_absolute_tolerence(float64_t absolute_tolerence)
Abstract template base class that provides an abstract solve method for linear systems, that takes a linear operator , a vector , solves the system and returns the vector .
Definition: LinearSolver.h:25
const float64_t get_absolute_tolerence() const
const float64_t get_relative_tolerence() const

SHOGUN Machine Learning Toolbox - Documentation