| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

EqSolver.h
Go to the documentation of this file.
1 #ifndef ALGTOOLS_EQSOLVER_H
2 #define ALGTOOLS_EQSOLVER_H 1
3 // Include files
4 // from CLHEP
5 #include "CLHEP/GenericFunctions/AbsFunction.hh"
6 #include "CLHEP/GenericFunctions/Argument.hh"
7 #include "CLHEP/GenericFunctions/GenericFunctions.hh"
8 // from Gaudi
9 #include "GaudiAlg/GaudiTool.h"
10 // from GSL
11 #include "gsl/gsl_multiroots.h"
12
13 // local
14 #include "GaudiGSL/IEqSolver.h"
15
23 class EqSolver : public extends<GaudiTool, IEqSolver>
24 {
25 public:
26 typedef std::vector<Equations> Jacobi;
27
28 public:
34 StatusCode solver( const Equations& funcs, Arg& arg ) const override;
35
37 StatusCode initialize() override;
38
39 class EqSolverMisc
40 {
41 public:
45 EqSolverMisc( const Equations& funcs, Arg& arg );
46 // destructor
47 ~EqSolverMisc();
48
49 public:
50 inline const Arg& argument() const { return m_argum; }
51 inline Arg& argument() { return m_argum; }
52 inline const Equations* equations() const { return m_eqs; }
53 inline const Jacobi& jacobi() const { return m_jac; }
54
55 private:
56 // default constructor is disabled
57 EqSolverMisc() = delete;
58 // copy constructor is disabled
59 EqSolverMisc( const EqSolverMisc& ) = delete;
60 // assignment operator is disabled
61 EqSolverMisc& operator=( const EqSolverMisc& ) = delete;
62
63 private:
64 Arg m_argum;
65 const Equations* m_eqs;
66 Jacobi m_jac;
67 };
68
70 using extends::extends;
71
72 private:
74 EqSolver() = delete;
76 EqSolver( const EqSolver& ) = delete;
78 EqSolver& operator=( const EqSolver& ) = delete;
79
80 private:
81 Gaudi::Property<std::string> m_algType{this, "Algorithm", "fdfsolver_hybridsj",
82 "type of the algorithm for root finding"};
83 Gaudi::Property<double> m_max_iter{this, "Iteration", 1000, "maximum of iteration"};
84 Gaudi::Property<double> m_norm_residual{this, "Residual", 1.0e-7, "absolute error bound for the residual value"};
85
86 const gsl_multiroot_fdfsolver_type* m_type = nullptr;
87 };
88
89 // ============================================================================
90 // The END
91 // ============================================================================
92 #endif // ALGTOOLS_EQSOLVER_H
93 // ============================================================================
EqSolver::EqSolver
EqSolver()=delete
default constructor is private
EqSolver::Jacobi
std::vector< Equations > Jacobi
Definition: EqSolver.h:26
GaudiTool.h
Header file for class GaudiAlgorithm.
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
EqSolver::EqSolverMisc::m_eqs
const Equations * m_eqs
Definition: EqSolver.h:65
EqSolver::EqSolverMisc::m_argum
Arg m_argum
Definition: EqSolver.h:64
EqSolver::EqSolverMisc::EqSolverMisc
EqSolverMisc()=delete
EqSolver::EqSolverMisc::jacobi
const Jacobi & jacobi() const
Definition: EqSolver.h:53
EqSolver::m_algType
Gaudi::Property< std::string > m_algType
Definition: EqSolver.h:81
EqSolver
The simplest concrete implementation of IEqSolver interface.
Definition: EqSolver.h:23
EqSolver::m_max_iter
Gaudi::Property< double > m_max_iter
Definition: EqSolver.h:83
EqSolver::initialize
StatusCode initialize() override
Overriding initialize.
Definition: EqSolver.cpp:193
EqSolver::EqSolverMisc::argument
const Arg & argument() const
Definition: EqSolver.h:50
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
EqSolver::EqSolverMisc::~EqSolverMisc
~EqSolverMisc()
Definition: EqSolver.cpp:47
EqSolver::EqSolverMisc
Definition: EqSolver.h:39
EqSolver::EqSolverMisc::equations
const Equations * equations() const
Definition: EqSolver.h:52
EqSolver::EqSolverMisc::m_jac
Jacobi m_jac
Definition: EqSolver.h:66
IEqSolver.h
EqSolver::solver
StatusCode solver(const Equations &funcs, Arg &arg) const override
Solving nonlinear system with N equations in N unknowns of the function "GenFunc".
Definition: EqSolver.cpp:133
std::vector< Equations >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
EqSolver::m_type
const gsl_multiroot_fdfsolver_type * m_type
Definition: EqSolver.h:86
EqSolver::EqSolverMisc::operator=
EqSolverMisc & operator=(const EqSolverMisc &)=delete
EqSolver::m_norm_residual
Gaudi::Property< double > m_norm_residual
Definition: EqSolver.h:84
EqSolver::EqSolverMisc::argument
Arg & argument()
Definition: EqSolver.h:51