Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 public:
26 
27 public:
33  StatusCode solver( const Equations& funcs, Arg& arg ) const override;
34 
36  StatusCode initialize() override;
37 
38  class EqSolverMisc {
39  public:
43  EqSolverMisc( const Equations& funcs, Arg& arg );
44  // destructor
45  ~EqSolverMisc();
46 
47  public:
48  inline const Arg& argument() const { return m_argum; }
49  inline Arg& argument() { return m_argum; }
50  inline const Equations* equations() const { return m_eqs; }
51  inline const Jacobi& jacobi() const { return m_jac; }
52 
53  private:
54  // default constructor is disabled
55  EqSolverMisc() = delete;
56  // copy constructor is disabled
57  EqSolverMisc( const EqSolverMisc& ) = delete;
58  // assignment operator is disabled
59  EqSolverMisc& operator=( const EqSolverMisc& ) = delete;
60 
61  private:
62  Arg m_argum;
63  const Equations* m_eqs;
64  Jacobi m_jac;
65  };
66 
68  using extends::extends;
69 
70 private:
72  EqSolver() = delete;
74  EqSolver( const EqSolver& ) = delete;
76  EqSolver& operator=( const EqSolver& ) = delete;
77 
78 private:
79  Gaudi::Property<std::string> m_algType{this, "Algorithm", "fdfsolver_hybridsj",
80  "type of the algorithm for root finding"};
81  Gaudi::Property<double> m_max_iter{this, "Iteration", 1000, "maximum of iteration"};
82  Gaudi::Property<double> m_norm_residual{this, "Residual", 1.0e-7, "absolute error bound for the residual value"};
83 
84  const gsl_multiroot_fdfsolver_type* m_type = nullptr;
85 };
86 
87 // ============================================================================
88 // The END
89 // ============================================================================
90 #endif // ALGTOOLS_EQSOLVER_H
EqSolver()=delete
default constructor is private
std::vector< Equations > Jacobi
Definition: EqSolver.h:25
Header file for class GaudiAlgorithm.
Implementation of property with value of concrete type.
Definition: Property.h:352
const Equations * m_eqs
Definition: EqSolver.h:63
const Jacobi & jacobi() const
Definition: EqSolver.h:51
Gaudi::Property< std::string > m_algType
Definition: EqSolver.h:79
The simplest concrete implementation of IEqSolver interface.
Definition: EqSolver.h:23
Gaudi::Property< double > m_max_iter
Definition: EqSolver.h:81
StatusCode initialize() override
Overriding initialize.
Definition: EqSolver.cpp:175
const Arg & argument() const
Definition: EqSolver.h:48
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
const Equations * equations() const
Definition: EqSolver.h:50
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:119
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
const gsl_multiroot_fdfsolver_type * m_type
Definition: EqSolver.h:84
EqSolverMisc & operator=(const EqSolverMisc &)=delete
Gaudi::Property< double > m_norm_residual
Definition: EqSolver.h:82