00001 #ifndef __CThomasLS_H__ 00002 #define __CThomasLS_H__ 00003 00004 00029 #include "AbsCTriDiagonalLS.hpp" 00030 00031 00032 class CThomasLS : public AbsCTriDiagonalLS 00033 { 00034 private: 00035 00036 CVector* uOut; 00037 CVector* dOut; 00038 CVector* lOut; 00039 00040 CVector* y; 00041 00042 protected: 00043 00045 void computeLRdecomposition(); 00046 00048 void forwardSubstitution(); 00050 void backwardSubstitution(); 00051 00052 public: 00053 00054 CThomasLS(int asize):AbsCTriDiagonalLS(asize) 00055 { 00056 uOut= new CVector(N-1); 00057 dOut= new CVector(N); 00058 lOut= new CVector(N-1); 00059 00060 y= new CVector(N); 00061 } 00062 00063 virtual ~CThomasLS(){delete uOut; delete dOut; delete lOut; delete y;} 00064 00065 virtual void loadA(CTriDiagonalMatrix* m); 00066 virtual void loadMatrix(CVector* u1, CVector* d1, CVector* l1); 00067 virtual void loadX(CVector* data); 00068 virtual void loadB(CVector* data); 00069 00070 00071 virtual bool solve(); // SOLVING to define later 00072 00073 00074 virtual void output() 00075 { 00076 printf("Complex Thomas "); 00077 AbsCTriDiagonalLS::output(); 00078 } 00079 00080 virtual void output(FILE* file) 00081 { 00082 fprintf(file, "ComplexThomas "); 00083 AbsCTriDiagonalLS::output(file); 00084 } 00085 }; 00086 00087 #endif 00088 00089 00090