SHOGUN
v3.2.0
|
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2013 Soumyajit De 00008 */ 00009 00010 #ifndef LANCZOS_EIGEN_SOLVER_H_ 00011 #define LANCZOS_EIGEN_SOLVER_H_ 00012 00013 #include <shogun/lib/config.h> 00014 00015 #ifdef HAVE_LAPACK 00016 #ifdef HAVE_EIGEN3 00017 #include <shogun/mathematics/linalg/eigsolver/EigenSolver.h> 00018 00019 namespace shogun 00020 { 00021 template<class T> class CLinearOperator; 00022 00026 class CLanczosEigenSolver : public CEigenSolver 00027 { 00028 public: 00030 CLanczosEigenSolver(); 00031 00038 CLanczosEigenSolver(CLinearOperator<float64_t>* linear_operator); 00039 00041 virtual ~CLanczosEigenSolver(); 00042 00046 virtual void compute(); 00047 00049 void set_max_iteration_limit(int64_t max_iteration_limit) 00050 { 00051 m_max_iteration_limit=max_iteration_limit; 00052 } 00053 00055 const int64_t get_max_iteration_limit() const 00056 { 00057 return m_max_iteration_limit; 00058 } 00059 00061 void set_relative_tolerence(float64_t relative_tolerence) 00062 { 00063 m_relative_tolerence=relative_tolerence; 00064 } 00065 00067 const float64_t get_relative_tolerence() const 00068 { 00069 return m_relative_tolerence; 00070 } 00071 00073 void set_absolute_tolerence(float64_t absolute_tolerence) 00074 { 00075 m_absolute_tolerence=absolute_tolerence; 00076 } 00077 00079 const float64_t get_absolute_tolerence() const 00080 { 00081 return m_absolute_tolerence; 00082 } 00083 00085 virtual const char* get_name() const 00086 { 00087 return "LanczosEigenSolver"; 00088 } 00089 00090 private: 00092 int64_t m_max_iteration_limit; 00093 00095 float64_t m_relative_tolerence; 00096 00098 float64_t m_absolute_tolerence; 00099 00101 void init(); 00102 00103 }; 00104 00105 } 00106 00107 #endif // HAVE_EIGEN3 00108 #endif // HAVE_LAPACK 00109 #endif // LANCZOS_EIGEN_SOLVER_H_