00001 #ifndef __F_LULinearSolver_H__ 00002 #define __F_LULinearSolver_H__ 00003 00004 00032 #include <stdio.h> 00033 #include "AbsFLinearSolver.hpp" 00034 00035 #include "AFSymMatrix.hpp" 00036 00037 enum LUtype { Doolittle=0, Crout=1 }; 00038 00039 class F_LULinearSolver : public AbsFLinearSolver 00040 { 00041 private: 00042 00043 LUtype type; 00044 00045 bool factorisationFlag; 00046 00047 AFSymMatrix* lu; 00048 00049 FloatVector* y; // temporary intermediate result 00050 00051 protected: 00052 00053 // A= L1*U or L*U1 00054 virtual void factorise(AFSymMatrix* m); 00055 00056 public: 00057 F_LULinearSolver(LUtype atype= Doolittle){type= atype; lu=0; y=0; factorisationFlag=true;} 00058 virtual ~F_LULinearSolver(){} 00059 00060 virtual void init(){factorisationFlag=true;} 00061 00062 // A * u = b 00063 virtual FloatVector* solve(AFloatMatrix* m, FloatVector* b, bool factoriseAll, FloatVector* dest); 00064 virtual FloatVector* solve(AFloatMatrix* m, FloatVector* b, FloatVector* dest) 00065 { return solve(m, b, false, dest); } 00066 00067 }; 00068 00069 #endif 00070