00001 // fabric class for SuperLU 00002 00003 #ifndef superLUfabric_hh 00004 #define superLUfabric_hh 00005 00006 #include "superLU.hh" 00007 #include "solverFabric.hh" 00008 #include "sparseMatrix.hh" 00009 #include "CRS.hh" 00010 00011 namespace concepts { 00012 00013 // ********************************************************* SuperLUFabric ** 00014 00018 template<class F = Real> 00019 class SuperLUFabric : public SolverFabric<F> { 00020 public: 00021 virtual Operator<F>* operator()(Operator<F>& matrix) { 00022 if (dynamic_cast<concepts::CRSConvertable<F>*>(&matrix)) 00023 return new SuperLU<F>(matrix); 00024 else { 00025 concepts::SparseMatrix<F> tmpMatrix(matrix); 00026 return new SuperLU<F>(tmpMatrix); 00027 } 00028 } 00029 protected: 00030 virtual std::ostream& info(std::ostream& os) const { 00031 return os << "SuperLUFabric()"; 00032 } 00033 }; 00034 00035 } // concepts 00036 00037 #endif // superLUfabric_hh