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 Kevin Hughes 00008 * 00009 * Thanks to Andreas Ziehe and Cedric Gouy-Pailler 00010 */ 00011 00012 #ifndef JADIAG_H_ 00013 #define JADIAG_H_ 00014 00015 #include <shogun/lib/config.h> 00016 00017 #ifdef HAVE_EIGEN3 00018 00019 #include <shogun/mathematics/ajd/ApproxJointDiagonalizer.h> 00020 #include <shogun/mathematics/Math.h> 00021 00022 namespace shogun 00023 { 00024 00035 class CJADiag : public CApproxJointDiagonalizer 00036 { 00037 public: 00038 00040 CJADiag() 00041 { 00042 } 00043 00045 virtual ~CJADiag() 00046 { 00047 } 00048 00056 static SGMatrix<float64_t> diagonalize(SGNDArray<float64_t> C, 00057 SGMatrix<float64_t> V0 = SGMatrix<float64_t>(NULL,0,0,false), 00058 double eps=CMath::MACHINE_EPSILON, 00059 int itermax=200); 00060 00068 virtual SGMatrix<float64_t> compute(SGNDArray<float64_t> C, 00069 SGMatrix<float64_t> V0 = SGMatrix<float64_t>(NULL,0,0,false), 00070 double eps=CMath::MACHINE_EPSILON, 00071 int itermax=200) 00072 { 00073 m_V = diagonalize(C,V0,eps,itermax); 00074 return m_V; 00075 } 00076 00078 virtual const char* get_name() const { return "JADiag"; } 00079 }; 00080 } 00081 #endif //HAVE_EIGEN3 00082 #endif //JADIAG_H_