SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
IterativeShiftedLinearFamilySolver.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 ITERATIVE_SHIFTED_LINEAR_FAMILY_SOLVER_H_
11 #define ITERATIVE_SHIFTED_LINEAR_FAMILY_SOLVER_H_
12 
13 #include <shogun/lib/config.h>
15 
16 namespace shogun
17 {
18 template <class T> class SGVector;
19 template <class RetType, class OperandType> class CLinearOperator;
20 
34 template<class T, class ST=T> class CIterativeShiftedLinearFamilySolver : public CIterativeLinearSolver<T, T>
35 {
36 
37 public:
40 
42  CIterativeShiftedLinearFamilySolver(bool store_residuals);
43 
46 
56 
69  SGVector<T> b, SGVector<ST> shifts, SGVector<ST> weights) = 0;
70 
72  virtual const char* get_name() const
73  {
74  return "IterativeShiftedLinearFamilySolver";
75  }
76 
77 protected:
92  void compute_zeta_sh_new(const SGVector<ST>& zeta_sh_old,
93  const SGVector<ST>& zeta_sh_cur, const SGVector<ST>& shifts,
94  const T& beta_old, const T& beta_cur, const T& alpha, SGVector<ST>& zeta_sh_new);
95 
105  void compute_beta_sh(const SGVector<ST>& zeta_sh_new,
106  const SGVector<ST>& zeta_sh_cur, const T& beta_cur, SGVector<ST>& beta_sh);
107 
119  void compute_alpha_sh(const SGVector<ST>& zeta_sh_cur,
120  const SGVector<ST>& zeta_sh_old, const SGVector<ST>& beta_sh_old,
121  const T& beta_old, const T& alpha, SGVector<ST>& alpha_sh);
122 
123 };
124 
125 }
126 
127 #endif // ITERATIVE_SHIFTED_LINEAR_FAMILY_SOLVER_H_
void compute_zeta_sh_new(const SGVector< ST > &zeta_sh_old, const SGVector< ST > &zeta_sh_cur, const SGVector< ST > &shifts, const T &beta_old, const T &beta_cur, const T &alpha, SGVector< ST > &zeta_sh_new)
void compute_beta_sh(const SGVector< ST > &zeta_sh_new, const SGVector< ST > &zeta_sh_cur, const T &beta_cur, SGVector< ST > &beta_sh)
virtual SGVector< ST > solve_shifted_weighted(CLinearOperator< SGVector< T >, SGVector< T > > *A, SGVector< T > b, SGVector< ST > shifts, SGVector< ST > weights)=0
abstract template base for all iterative linear solvers such as conjugate gradient (CG) solvers...
shogun vector
virtual SGVector< T > solve(CLinearOperator< SGVector< T >, SGVector< T > > *A, SGVector< T > b)=0
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
Abstract template base class that represents a linear operator, e.g. a matrix.
void compute_alpha_sh(const SGVector< ST > &zeta_sh_cur, const SGVector< ST > &zeta_sh_old, const SGVector< ST > &beta_sh_old, const T &beta_old, const T &alpha, SGVector< ST > &alpha_sh)
abstract template base for CG based solvers to the solution of shifted linear systems of the form fo...

SHOGUN Machine Learning Toolbox - Documentation