00001 #ifndef GLU_COMPOSITION_H 00002 #define GLU_COMPOSITION_H 00003 00004 00005 #include "GObject.h" 00006 #include "GMatrix.h" 00007 #include "GVector.h" 00008 #include "io/GError_Output.h" 00009 #include <string> 00010 00011 namespace GMathLib{ 00012 00013 namespace GMatrix_Util{ 00014 00018 class GLU_Composition : public GObject 00019 { 00020 public: 00024 GLU_Composition(); 00025 00029 ~GLU_Composition(); 00030 00047 bool LU_Composition(GMatrix& A, int combined_flag=GLU_Composition::LU_NOT_COMBINED); 00048 00054 inline GMatrix* Get_L(){ 00055 if(combined_flag == GLU_Composition::LU_NOT_COMBINED){ 00056 return p_L; 00057 }else{ 00058 const std::string context = "GLU_Composition::LU_NOT_COMBINED is not specified in LU_Composition()."; 00059 IO::GError_Output::Puts(Class_Name() + "Get_L()", context); 00060 return 0; 00061 } 00062 } 00063 00069 inline GMatrix* Get_U(){ 00070 if(combined_flag == GLU_Composition::LU_NOT_COMBINED){ 00071 return p_U; 00072 }else{ 00073 const std::string context = "GLU_Composition::LU_NOT_COMBINED is not specified in LU_Composition()."; 00074 IO::GError_Output::Puts(Class_Name() + "Get_L()", context); 00075 return 0; 00076 } 00077 } 00078 00086 inline GMatrix* Get_LU(){ 00087 if(combined_flag == GLU_Composition::LU_COMBINED){ 00088 return p_LU; 00089 }else{ 00090 const std::string context = "GLU_Composition::LU_COMBINED is not specified in LU_Composition()."; 00091 IO::GError_Output::Puts(Class_Name() + "Get_L()", context); 00092 return 0; 00093 } 00094 } 00095 00100 inline GMatrix* Get_P(){ return p_P; } 00101 00102 00103 const static int LU_NOT_COMBINED = 0; /*<< LU 分解の結果を L と U 別々の行列で保持する状態を示す定数 */ 00104 const static int LU_COMBINED = 1; /*<< LU 分解の結果を 1 つの行列(L, U を結合)で保持する状態を示す定数 */ 00105 00106 private: 00110 void delete_mx_object(); 00111 00112 bool lu_composition(GMatrix& target_mx, GVector& pv_mx); 00113 00114 int combined_flag; 00115 00116 GMatrix* p_L; 00117 GMatrix* p_U; 00118 GMatrix* p_LU; 00119 GMatrix* p_P; 00120 }; 00121 00122 } 00123 } 00124 #endif