| The Gaudi Framework v28r2-patches (bc4ad17a)

- 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 StatusCode finalize() override;
39
40 ~EqSolver() override;
41
42 class EqSolverMisc
43 {
44 public:
48 EqSolverMisc( const Equations& funcs, Arg& arg );
49 // destructor
50 ~EqSolverMisc();
51
52 public:
53 inline const Arg& argument() const { return m_argum; }
54 inline Arg& argument() { return m_argum; }
55 inline const Equations* equations() const { return m_eqs; }
56 inline const Jacobi& jacobi() const { return m_jac; }
57 private:
58 // default constructor is disabled
59 EqSolverMisc() = delete;
60 // copy constructor is disabled
61 EqSolverMisc( const EqSolverMisc& ) = delete;
62 // assignment operator is disabled
63 EqSolverMisc& operator=( const EqSolverMisc& ) = delete;
64
65 private:
66 Arg m_argum;
67 const Equations* m_eqs;
68 Jacobi m_jac;
69 };
70
72 using extends::extends;
73
74 private:
76 EqSolver() = delete;
78 EqSolver( const EqSolver& ) = delete;
80 EqSolver& operator=( const EqSolver& ) = delete;
81
82 private:
83 Gaudi::Property<std::string> m_algType{this, "Algorithm", "fdfsolver_hybridsj",
84 "type of the algorithm for root finding"};
85 Gaudi::Property<double> m_max_iter{this, "Iteration", 1000, "maximum of iteration"};
86 Gaudi::Property<double> m_norm_residual{this, "Residual", 1.0e-7, "absolute error bound for the residual value"};
87
88 const gsl_multiroot_fdfsolver_type* m_type = nullptr;
89 };
90
91 // ============================================================================
92 // The END
93 // ============================================================================
94 #endif // ALGTOOLS_EQSOLVER_H
95 // ============================================================================
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:314
EqSolver::EqSolverMisc::m_eqs
const Equations * m_eqs
Definition: EqSolver.h:67
EqSolver::EqSolverMisc::m_argum
Arg m_argum
Definition: EqSolver.h:66
EqSolver::EqSolverMisc::EqSolverMisc
EqSolverMisc()=delete
EqSolver::EqSolverMisc::jacobi
const Jacobi & jacobi() const
Definition: EqSolver.h:56
EqSolver::m_algType
Gaudi::Property< std::string > m_algType
Definition: EqSolver.h:83
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:85
EqSolver::initialize
StatusCode initialize() override
Overriding initialize.
Definition: EqSolver.cpp:249
EqSolver::EqSolverMisc::argument
const Arg & argument() const
Definition: EqSolver.h:53
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
EqSolver::EqSolverMisc::~EqSolverMisc
~EqSolverMisc()
Definition: EqSolver.cpp:54
EqSolver::EqSolverMisc
Definition: EqSolver.h:42
EqSolver::EqSolverMisc::equations
const Equations * equations() const
Definition: EqSolver.h:55
EqSolver::EqSolverMisc::m_jac
Jacobi m_jac
Definition: EqSolver.h:68
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:167
std::vector< Equations >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
EqSolver::finalize
StatusCode finalize() override
Definition: EqSolver.cpp:304
EqSolver::m_type
const gsl_multiroot_fdfsolver_type * m_type
Definition: EqSolver.h:88
EqSolver::EqSolverMisc::operator=
EqSolverMisc & operator=(const EqSolverMisc &)=delete
EqSolver::~EqSolver
~EqSolver() override
Destructor.
Definition: EqSolver.cpp:317
EqSolver::m_norm_residual
Gaudi::Property< double > m_norm_residual
Definition: EqSolver.h:86
EqSolver::EqSolverMisc::argument
Arg & argument()
Definition: EqSolver.h:54