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 * Copyright (C) 2012 Sergey Lisitsyn 00008 */ 00009 00010 #ifndef SPINVCOV_H_ 00011 #define SPINVCOV_H_ 00012 #include <shogun/base/SGObject.h> 00013 #include <shogun/lib/SGMatrix.h> 00014 00015 namespace shogun 00016 { 00017 00022 class CSparseInverseCovariance : public CSGObject 00023 { 00024 public: 00025 00027 CSparseInverseCovariance(); 00028 00030 virtual ~CSparseInverseCovariance(); 00031 00037 SGMatrix<float64_t> estimate(SGMatrix<float64_t> S, float64_t lambda_c); 00038 00040 const char* get_name() const { return "SparseInverseCovariance"; }; 00041 00042 00046 int32_t get_lasso_max_iter() const { return m_lasso_max_iter; } 00050 int32_t get_max_iter() const { return m_max_iter; } 00054 float64_t get_f_gap() const { return m_f_gap; } 00058 float64_t get_x_gap() const { return m_x_gap; } 00062 float64_t get_xtol() const { return m_xtol; } 00063 00067 void set_lasso_max_iter(int32_t lasso_max_iter) 00068 { 00069 m_lasso_max_iter = lasso_max_iter; 00070 } 00074 void set_max_iter(int32_t max_iter) 00075 { 00076 m_max_iter = max_iter; 00077 } 00081 void set_f_gap(int32_t f_gap) 00082 { 00083 m_f_gap = f_gap; 00084 } 00088 void set_x_gap(int32_t x_gap) 00089 { 00090 m_x_gap = x_gap; 00091 } 00095 void set_xtol(int32_t xtol) 00096 { 00097 m_xtol = xtol; 00098 } 00099 00100 private: 00101 00103 void register_parameters(); 00104 00105 protected: 00106 00108 int32_t m_lasso_max_iter; 00109 00111 int32_t m_max_iter; 00112 00114 float64_t m_f_gap; 00115 00117 float64_t m_x_gap; 00118 00120 float64_t m_xtol; 00121 }; 00122 00123 } 00124 #endif