The Gaudi Framework  v29r0 (ff2e7097)
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:
27 
28 public:
34  StatusCode solver( const Equations& funcs, Arg& arg ) const override;
35 
37  StatusCode initialize() override;
38 
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()=delete
default constructor is private
std::vector< Equations > Jacobi
Definition: EqSolver.h:26
Header file for class GaudiAlgorithm.
Implementation of property with value of concrete type.
Definition: Property.h:319
const Equations * m_eqs
Definition: EqSolver.h:65
const Jacobi & jacobi() const
Definition: EqSolver.h:53
Gaudi::Property< std::string > m_algType
Definition: EqSolver.h:81
The simplest concrete implementation of IEqSolver interface.
Definition: EqSolver.h:23
Gaudi::Property< double > m_max_iter
Definition: EqSolver.h:83
StatusCode initialize() override
Overriding initialize.
Definition: EqSolver.cpp:193
const Arg & argument() const
Definition: EqSolver.h:50
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
const Equations * equations() const
Definition: EqSolver.h:52
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
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
const gsl_multiroot_fdfsolver_type * m_type
Definition: EqSolver.h:86
EqSolverMisc & operator=(const EqSolverMisc &)=delete
Gaudi::Property< double > m_norm_residual
Definition: EqSolver.h:84