![]() |
|
|
Generated: 18 Jul 2008 |
00001 // $Id: EqSolver.h,v 1.3 2006/11/30 10:40:53 mato Exp $ 00002 // ============================================================================ 00003 #ifndef ALGTOOLS_EQSOLVER_H 00004 #define ALGTOOLS_EQSOLVER_H 1 00005 // Include files 00006 // from CLHEP 00007 #include "CLHEP/GenericFunctions/GenericFunctions.hh" 00008 #include "CLHEP/GenericFunctions/Argument.hh" 00009 #include "CLHEP/GenericFunctions/AbsFunction.hh" 00010 // from Gaudi 00011 #include "GaudiAlg/GaudiTool.h" 00012 //from GSL 00013 #include "gsl/gsl_multiroots.h" 00014 00015 // local 00016 #include "GaudiGSL/IEqSolver.h" 00017 00019 template <class TOOL> class ToolFactory; 00020 00028 class EqSolver : public GaudiTool, 00029 virtual public IEqSolver 00030 00031 { 00032 // friend factory for instantiation 00033 friend class ToolFactory<EqSolver> ; 00034 public: 00035 typedef std::vector<Equations> Jacobi ; 00036 public: 00037 00043 virtual StatusCode solver( const Equations& funcs , 00044 Arg& arg ) const; 00045 00047 virtual StatusCode initialize (); 00048 virtual StatusCode finalize (); 00049 00050 virtual ~EqSolver( ); 00051 00052 class EqSolverMisc 00053 { 00054 public: 00058 EqSolverMisc ( const Equations& funcs , 00059 Arg& arg ) ; 00060 // destructor 00061 ~EqSolverMisc (); 00062 public: 00063 inline const Arg& argument () const { return m_argum ; } 00064 inline Arg& argument () { return m_argum ; } 00065 inline const Equations* equations () const { return m_eqs ; } 00066 inline const Jacobi& jacobi () const { return m_jac ; } 00067 private: 00068 // default constructor is disabled 00069 EqSolverMisc () ; 00070 // copy constructor is disabled 00071 EqSolverMisc ( const EqSolverMisc& ); 00072 // assignement operator is disabled 00073 EqSolverMisc& operator=( const EqSolverMisc& ); 00074 private: 00075 Arg m_argum ; 00076 const Equations* m_eqs ; 00077 Jacobi m_jac ; 00078 }; 00079 00080 00087 EqSolver( const std::string& type, 00088 const std::string& name, 00089 const IInterface* parent); 00090 00091 private: 00092 00094 EqSolver(); 00096 EqSolver ( const EqSolver& ); 00098 EqSolver& operator=( const EqSolver& ); 00099 00100 private: 00101 00102 std::string m_algType ; 00103 double m_max_iter ; 00104 double m_norm_residual ; 00105 const gsl_multiroot_fdfsolver_type* m_type ; 00106 00107 }; 00108 00109 // ============================================================================ 00110 // The END 00111 // ============================================================================ 00112 #endif // ALGTOOLS_EQSOLVER_H 00113 // ============================================================================