| The Gaudi Framework v27r1

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
EqSolver Class Reference

The simplest concrete implementation of IEqSolver interface. More...

`#include <src/Components/EqSolver.h>`

Inheritance diagram for EqSolver:
[legend]
Collaboration diagram for EqSolver:
[legend]

## Classes
class | EqSolverMisc

## Public Types
typedef std::vector< Equations > | Jacobi
Public Types inherited from extends< GaudiTool, IEqSolver >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces...>
| Typedef to the base of this class. More...
Public Types inherited from AlgTool
typedef Gaudi::PluginService::Factory< IAlgTool *, const std::string &, const std::string &, const IInterface * > | Factory
Public Types inherited from CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces...>
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
| take union of the ext_iids of all Interfaces... More...

## Public Member Functions
StatusCode | solver (const Equations &funcs, Arg &arg) const override
| Solving nonlinear system with N equations in N unknowns of the function "GenFunc". More...
StatusCode | initialize () override
| Overriding initialize. More...
StatusCode | finalize () override
| ~EqSolver () override
| Destructor. More...
| EqSolver (const std::string &type, const std::string &name, const IInterface *parent)
| Standard constructor. More...
Public Member Functions inherited from extends< GaudiTool, IEqSolver >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| ~extends () override=default
| Virtual destructor. More...
Public Member Functions inherited from GaudiTool
StatusCode | initialize () override
| standard initialization method More...
StatusCode | finalize () override
| standard finalization method More...
INTupleSvc * | ntupleSvc () const
| Access the standard N-Tuple. More...
INTupleSvc * | evtColSvc () const
| Access the standard event collection service. More...
IDataProviderSvc * | detSvc () const
| accessor to detector service More...
IIncidentSvc * | incSvc () const
| accessor to Incident Service More...
IChronoStatSvc * | chronoSvc () const
| accessor to Chrono & Stat Service More...
IHistogramSvc * | histoSvc () const
| acessor to the histogram service More...
IAlgContextSvc * | contextSvc () const
| acessor to the Algorithm Context Service More...
DataObject * | put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const
| Register a data object or container into Gaudi Event Transient Store. More...
DataObject * | put (DataObject *object, const std::string &address, const bool useRootInTES=true) const
| Register a data object or container into Gaudi Event Transient Store. More...
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type | get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Templated access to the data in Gaudi Transient Store. More...
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type | getIfExists (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Templated access to the data in Gaudi Transient Store. More...
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type | get (const std::string &location, const bool useRootInTES=true) const
| Templated access to the data from Gaudi Event Transient Store. More...
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type | getIfExists (const std::string &location, const bool useRootInTES=true) const
| Templated access to the data in Gaudi Transient Store. More...
template<class TYPE >
TYPE * | getDet (IDataProviderSvc *svc, const std::string &location) const
| Templated access to the detector data from the Gaudi Detector Transient Store. More...
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type | getDetIfExists (IDataProviderSvc *svc, const std::string &location) const
| Templated access to the detector data from the Gaudi Detector Transient Store. More...
template<class TYPE >
TYPE * | getDet (const std::string &location) const
| Templated access to the detector data from the Gaudi Detector Transient Store. More...
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type | getDetIfExists (const std::string &location) const
| Templated access to the detector data from the Gaudi Detector Transient Store. More...
template<class TYPE >
bool | exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Check the existence of a data object or container in the Gaudi Transient Event Store. More...
template<class TYPE >
bool | exist (const std::string &location, const bool useRootInTES=true) const
| Check the existence of a data object or container in the Gaudi Transient Event Store. More...
template<class TYPE >
bool | existDet (IDataProviderSvc *svc, const std::string &location) const
| Check the existence of detector objects in the Gaudi Transient Detector Store. More...
template<class TYPE >
bool | existDet (const std::string &location) const
| Check the existence of detector objects in the Gaudi Transient Detector Store. More...
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE >::return_type | getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Get the existing data object from Gaudi Event Transient store. More...
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE >::return_type | getOrCreate (const std::string &location, const bool useRootInTES=true) const
| Get the existing data object from Gaudi Event Transient store. More...
StatusCode | Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
| Print the error message and return with the given StatusCode. More...
StatusCode | Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
| Print the warning message and return with the given StatusCode. More...
StatusCode | Info (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const size_t mx=10) const
| Print the info message and return with the given StatusCode. More...
template<class T >
Property * | declareProperty (const std::string &name, DataObjectHandle< T > &hndl, const std::string &doc="none") const
Public Member Functions inherited from GaudiCommon< AlgTool >
Gaudi::Utils::GetData< TYPE >::return_type | get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Templated access to the data in Gaudi Transient Store. More...
Gaudi::Utils::GetData< TYPE >::return_type | getIfExists (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Quicker version of the get function which bypasses the check on the retrieved data. More...
bool | exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Check the existence of a data object or container in the Gaudi Transient Event Store. More...
Gaudi::Utils::GetData< TYPE >::return_type | getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Get the existing data object from Gaudi Event Transient store. More...
DataObject * | put (IDataProviderSvc *svc, DataObject *object, const std::string &location, const bool useRootInTES=true) const
| Register a data object or container into Gaudi Event Transient Store. More...
TOOL * | tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const
| Useful method for the easy location of tools. More...
TOOL * | tool (const std::string &type, const IInterface *parent=0, bool create=true) const
| A useful method for the easy location of tools. More...
SmartIF< SERVICE > | svc (const std::string &name, const bool create=true) const
| A useful method for the easy location of services. More...
IUpdateManagerSvc * | updMgrSvc () const
| Short-cut to locate the Update Manager Service. More...
StatusCode | Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
| Print the error message and return with the given StatusCode. More...
StatusCode | Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
| Print the warning message and return with the given StatusCode. More...
StatusCode | Info (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const size_t mx=10) const
| Print the info message and return with the given StatusCode. More...
StatusCode | Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const
| Print the message and return with the given StatusCode. More...
void | Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Assertion - throw exception if the given condition is not fulfilled. More...
void | Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Assertion - throw exception if the given condition is not fulfilled. More...
void | Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Create and (re)-throw a given GaudiException. More...
void | Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Create and (re)-throw a given exception. More...
void | Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Create and throw an exception with the given message. More...
const Statistics & | counters () const
| accessor to all counters More...
StatEntity & | counter (const std::string &tag) const
| accessor to certain counter by name More...
bool | typePrint () const
| Insert the actual C++ type of the algorithm/tool in the messages ? More...
bool | propsPrint () const
| Print properties at initialization ? More...
bool | statPrint () const
| Print statistical counters at finalization ? More...
bool | errorsPrint () const
| Print error counters at finalization ? More...
long | printStat (const MSG::Level level=MSG::ALWAYS) const
| perform the actual printout of statistical counters More...
long | printErrors (const MSG::Level level=MSG::ALWAYS) const
| perform the actual printout of error counters More...
long | printProps (const MSG::Level level=MSG::ALWAYS) const
| perform the actual printout of properties More...
void | registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=nullptr)
| register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
void | registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL)
| register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
void | registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL)
| just to avoid conflicts with the version using a pointer to a template class. More...
void | registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL)
| register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
StatusCode | runUpdate ()
| asks the UpdateManagerSvc to perform an update of the instance (if needed) without waiting the next BeginEvent incident. More...
| GaudiCommon (const std::string &name, ISvcLocator *pSvcLocator)
| Algorithm constructor. More...
| GaudiCommon (const std::string &type, const std::string &name, const IInterface *parent)
| Tool constructor. More...
StatusCode | initialize () override
| standard initialization method More...
StatusCode | finalize () override
| standard finalization method More...
StatusCode | release (const IInterface *interface) const
| Manual forced (and 'safe') release of the active tool or service. More...
const Services & | services () const
| get the list of aquired services More...
const std::string & | context () const
| Returns the "context" string. Used to identify different processing states. More...
const std::string & | rootInTES () const
| Returns the "rootInTES" string. More...
const std::string | fullTESLocation (const std::string &location, const bool useRootInTES) const
| Returns the full correct event location given the rootInTes settings. More...
Public Member Functions inherited from AlgTool
StatusCode | queryInterface (const InterfaceID &riid, void **ppvUnknown) override
| Query for a given interface. More...
const std::string & | name () const override
| Retrieve full identifying name of the concrete tool object. More...
const std::string & | type () const override
| Retrieve type (concrete class) of the sub-algtool. More...
const IInterface * | parent () const override
| Retrieve parent of the sub-algtool. More...
StatusCode | configure () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | terminate () override
StatusCode | reinitialize () override
StatusCode | restart () override
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | sysInitialize () override
| Initialize AlgTool. More...
StatusCode | sysStart () override
| Start AlgTool. More...
StatusCode | sysStop () override
| Stop AlgTool. More...
StatusCode | sysFinalize () override
| Finalize AlgTool. More...
StatusCode | sysReinitialize () override
| Initialize AlgTool. More...
StatusCode | sysRestart () override
| Start AlgTool. More...
StatusCode | setProperty (const Property &p) override
| Default implementations for IProperty interface. More...
StatusCode | setProperty (const std::string &s) override
StatusCode | setProperty (const std::string &n, const std::string &v) override
StatusCode | getProperty (Property *p) const override
const Property & | getProperty (const std::string &name) const override
StatusCode | getProperty (const std::string &n, std::string &v) const override
const std::vector< Property * > & | getProperties () const override
bool | hasProperty (const std::string &name) const override
PropertyMgr * | getPropertyMgr () const
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
| AlgTool (const std::string &type, const std::string &name, const IInterface *parent)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
ISvcLocator * | svcLoc () const
| shortcut for the method service locator More...
IDataProviderSvc * | evtSvc () const
| accessor to event service service More...
IToolSvc * | toolSvc () const
| The standard ToolSvc service, Return a pointer to the service if present. More...
StatusCode | setProperties ()
| Method for setting declared properties to the values specified in the jobOptions via the job option service. More...
template<class T >
StatusCode | service (const std::string &name, T *&svc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &type, const std::string &name, T *&svc) const
| Access a service by name, type creating it if it doesn't already exist. More...
SmartIF< IService > | service (const std::string &name, const bool createIf=true, const bool quiet=false) const
| Return a pointer to the service identified by name (or "type/name") More...
template<typename T >
SmartIF< T > | service (const std::string &name, const bool createIf=true, const bool quiet=false) const
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
| Declare remote named properties. More...
template<class T >
Property * | declareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none") const
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
template<class T >
Property * | declareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none") const
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override
virtual const DataObjIDColl & | extraInputDeps () const override
virtual const DataObjIDColl & | extraOutputDeps () const override
virtual void | acceptDHVisitor (IDataHandleVisitor *) const override
DataObjIDColl | inputDataObjs () const
DataObjIDColl | outputDataObjs () const
void | commitHandles () override
void | registerTool (IAlgTool *tool) const
void | deregisterTool (IAlgTool *tool) const
template<class T >
StatusCode | declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used public tool. More...
template<class T >
StatusCode | declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used private tool. More...
const std::vector< IAlgTool * > & | tools () const
IAuditorSvc * | auditorSvc () const
| Access the auditor service. More...
IMonitorSvc * | monitorSvc () const
| Access the monitor service. More...
template<class T >
void | declareInfo (const std::string &name, const T &var, const std::string &desc) const
| Declare monitoring information. More...
void | declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
| Declare monitoring information (special case) More...
| ~AlgTool () override
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from extend_interfaces< Interfaces...>
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Private Member Functions
| EqSolver ()
| default constructor is private More...
| EqSolver (const EqSolver &)
| copy constructor is private More...
EqSolver & | operator= (const EqSolver &)
| assignment operator is More...

## Private Attributes
std::string | m_algType
double | m_max_iter
double | m_norm_residual
const gsl_multiroot_fdfsolver_type * | m_type

## Additional Inherited Members
Static Public Member Functions inherited from GaudiTool
static bool | enableSummary (bool)
| enable/disable summary More...
static bool | summaryEnabled ()
| is summary enabled? More...
Protected Types inherited from GaudiCommon< AlgTool >
using | base_class = AlgTool
typedef std::map< std::string, StatEntity > | Statistics
| the actual type of general counters More...
typedef std::map< std::string, unsigned int > | Counter
| the actual type error/warning counter More...
typedef std::vector< IAlgTool * > | AlgTools
| storage for active tools More...
typedef std::vector< SmartIF< IService > > | Services
| storage for active services More...
Protected Member Functions inherited from GaudiTool
| GaudiTool (const std::string &type, const std::string &name, const IInterface *parent)
| Standard constructor. More...
| ~GaudiTool () override
| destructor, virtual and protected More...
Protected Member Functions inherited from GaudiCommon< AlgTool >
| ~GaudiCommon () override=default
| Destructor. More...
StatusCode | releaseTool (const IAlgTool *tool) const
| manual forced (and 'safe') release of the tool More...
StatusCode | releaseSvc (const IInterface *svc) const
| manual forced (and 'safe') release of the service More...
Protected Member Functions inherited from AlgTool
template<typename I >
void | declareInterface (I *i)
virtual void | declareInput (Gaudi::DataHandle *im) override
virtual void | declareOutput (Gaudi::DataHandle *im) override
std::vector< IAlgTool * > & | tools ()
Protected Member Functions inherited from CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...
Protected Attributes inherited from GaudiCommon< AlgTool >
SmartIF< ICounterSummarySvc > | m_counterSummarySvc
| a pointer to the CounterSummarySvc More...
std::vector< std::string > | m_counterList
| list of counters to declare. Set by property CounterList. This can be a regular expression. More...
std::vector< std::string > | m_statEntityList
Protected Attributes inherited from AlgTool
std::unique_ptr< IDataHandleVisitor > | m_updateDataHandles
| Hook for for derived classes to provide a custom visitor for data handles. More...
SmartIF< PropertyMgr > | m_propertyMgr
| Property Manager. More...
Static Protected Attributes inherited from GaudiCommon< AlgTool >
static const bool | IgnoreRootInTES
| Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods. More...
static const bool | UseRootInTES
| Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods. More...

## Detailed Description

The simplest concrete implementation of IEqSolver interface.

See also
  GaudiGSL/IEqSolver.h

Author
  Kirill Miklyaev kiril.nosp@m.lm@i.nosp@m.ris1..nosp@m.itep.nosp@m..ru

Date
  2003-07-07

Definition at line 23 of file EqSolver.h.

## Member Typedef Documentation

typedef std::vector<Equations> EqSolver::Jacobi

Definition at line 26 of file EqSolver.h.

## Constructor & Destructor Documentation

EqSolver::~EqSolver | ( |  | ) |
| override

Destructor.

Definition at line 338 of file EqSolver.cpp.

339 {}

EqSolver::EqSolver | ( | const std::string & | type,
|  | const std::string & | name,
|  | const IInterface * | parent
| ) |  |

Standard constructor.

See also
  GaudiTool

Parameters

  type | tool type
  name | tool name
  parent | parent of the tool

declare type of the algorithm for root finding

declare maximum of iteration

declare the absolute error bound for the residual value

Definition at line 72 of file EqSolver.cpp.

75 : base_class ( type, name , parent )
76 , m_algType ( "fdfsolver_hybridsj" )
77 , m_max_iter ( 1000 )
78 , m_norm_residual ( 1.0e-7 )
79 , m_type ( nullptr )
80
81 {
83 declareProperty ( "Algorithm", m_algType );
85 declareProperty ( "Iteration", m_max_iter );
87 declareProperty ( "Residual" , m_norm_residual );
88 }
extends< GaudiTool, IEqSolver >::base_class
extends base_class
Typedef to this class.
Definition: extends.h:14
EqSolver::m_algType
std::string m_algType
Definition: EqSolver.h:93
EqSolver::m_norm_residual
double m_norm_residual
Definition: EqSolver.h:95
GaudiTool::declareProperty
Property * declareProperty(const std::string &name, DataObjectHandle< T > &hndl, const std::string &doc="none") const
Definition: GaudiTool.h:834
EqSolver::m_max_iter
double m_max_iter
Definition: EqSolver.h:94
EqSolver::m_type
const gsl_multiroot_fdfsolver_type * m_type
Definition: EqSolver.h:96

EqSolver::EqSolver | ( |  | ) |
| private

default constructor is private

EqSolver::EqSolver | ( | const EqSolver & |  | ) |
| private

copy constructor is private

## Member Function Documentation

StatusCode EqSolver::finalize | ( |  | ) |
| override

Definition at line 325 of file EqSolver.cpp.

326 {
327 StatusCode sc = GaudiTool::finalize() ;
328
329 MsgStream log( msgSvc() , name() ) ;
330
331 if ( sc.isFailure() )
332 {
333 return Error("Could not finaliaze base class GaudiTool", sc);
334 }
335 return StatusCode::SUCCESS;
336 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiTool::Error
StatusCode Error(const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
Print the error message and return with the given StatusCode.
Definition: GaudiTool.h:689
GaudiTool::finalize
StatusCode finalize() override
standard finalization method
Definition: GaudiTool.cpp:179
CommonMessagingBase::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:73
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65

StatusCode EqSolver::initialize | ( |  | ) |
| override

Overriding initialize.

Definition at line 270 of file EqSolver.cpp.

272 {
273 StatusCode sc = GaudiTool::initialize() ;
274
275 MsgStream log( msgSvc() , name() ) ;
276
277 if( sc.isFailure() )
278 {
279 return Error ("Could not initiliaze base class GaudiTool", sc);
280 }
281 /* The algorithm for multiional root-finding
282 (solving nonlinear systems with n equations in n unknowns)*/
283
284 if( "fdfsolver_hybridsj" == m_algType )
285 {
286 m_type = gsl_multiroot_fdfsolver_hybridsj ;
287 log << MSG::DEBUG
288 << "Root findind algoritms to be used: "
289 << "'gsl_multiroot_fdfsolver_hybridsj'"
290 << endmsg;
291 }
292 else if ( "fdfsolver_hybridj" == m_algType )
293 {
294 m_type = gsl_multiroot_fdfsolver_hybridj ;
295 log << MSG::DEBUG
296 << "Root findind algoritms to be used: "
297 << "'gsl_multiroot_fdfsolver_hybridj'"
298 << endmsg;
299 }
300 else if ( "fdfsolver_newton" == m_algType )
301 {
302 m_type = gsl_multiroot_fdfsolver_newton ;
303 log << MSG::DEBUG
304 << "Root findind algoritms to be used: "
305 << "'gsl_multiroot_fdfsolver_newton'"
306 << endmsg;
307 }
308 else if ( "fdfsolver_gnewton" == m_algType )
309 {
310 m_type = gsl_multiroot_fdfsolver_gnewton ;
311 log << MSG::DEBUG
312 << "Root findind algoritms to be used: "
313 << "'gsl_multiroot_fdfsolver_gnewton'"
314 << endmsg;
315 }
316 else
317 {
318 return Error(" Unknown algorith type '"
319 + std::string(m_algType) + "'");
320 }
321
322 return StatusCode::SUCCESS;
323 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
MSG::DEBUG
Definition: IMessageSvc.h:18
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
std::string
STL class.
EqSolver::m_algType
std::string m_algType
Definition: EqSolver.h:93
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiTool::Error
StatusCode Error(const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
Print the error message and return with the given StatusCode.
Definition: GaudiTool.h:689
CommonMessagingBase::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:73
EqSolver::m_type
const gsl_multiroot_fdfsolver_type * m_type
Definition: EqSolver.h:96
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
GaudiTool::initialize
StatusCode initialize() override
standard initialization method
Definition: GaudiTool.cpp:161

EqSolver& EqSolver::operator= | ( | const EqSolver & |  | ) |
| private

assignment operator is

StatusCode EqSolver::solver | ( | const Equations & | funcs,
|  | Arg & | arg
| ) |  | const
| override

Solving nonlinear system with N equations in N unknowns of the function "GenFunc".

Solving nonlinear system of the function "GenFunc".

See also
  IEqSolver.h

Returns
  StatusCode

Definition at line 188 of file EqSolver.cpp.

191 {
192 using namespace Genfun;
193
194 gsl_vector_view vect = gsl_vector_view_array ( &arg[0] ,
195 arg.dimension() );
196 MsgStream log( msgSvc(), name() );
197
198 EqSolverMisc local (funcs, arg);
199
200 const gsl_multiroot_fdfsolver_type *T = m_type;
201 gsl_multiroot_fdfsolver *s;
202 int status = 0 ;
203 size_t iter = 0 ;
204
205 gsl_multiroot_function_fdf function;
206
207 function.f = &fun_gsl;
208 function.df = &dfun_gsl;
209 function.fdf = &fdfun_gsl;
210 function.n = vect.vector.size;
211 function.params = (void*) &local;
212
213 s = gsl_multiroot_fdfsolver_alloc(T, vect.vector.size);
214 gsl_multiroot_fdfsolver_set (s, &function, &vect.vector);
215
216 for (iter = 0; iter < m_max_iter; ++iter)
217 {
218 status = gsl_multiroot_fdfsolver_iterate (s);
219 if (status)
220 {
221 return Error
222 ("Error from gsl_gsl_multiroot_fdfsolver_iterate '"
223 + std::string(gsl_strerror(status)) + "'") ;
224 }
225
226 status = gsl_multiroot_test_residual (s->f,
227 m_norm_residual);
228
229 if ( status != GSL_CONTINUE ) { break; }
230 }
231
232 for (unsigned int i = 0; i < vect.vector.size; ++i)
233 {
234 gsl_vector_set (&vect.vector, i, gsl_vector_get (s->x, i));
235 }
236
237 if (status == GSL_SUCCESS)
238 {
239 log << MSG::DEBUG
240 << "We stopped in the method on the " << iter
241 << " iteration (we have maximum " << m_max_iter
242 << " iterations)" << endmsg;
243 }
244 else if (status == GSL_CONTINUE && iter <= m_max_iter )
245 {
246 return Error ( "Method finished with '"
247 + std::string(gsl_strerror(status))
248 + "' error" );
249 }
250 else
251 {
252 return Error ( "Method finished with '" +
253 std::string(gsl_strerror(status))
254 + "' error" );
255 }
256
257 gsl_multiroot_fdfsolver_free (s);
258
259 if (status)
260 {
261 return Error ( "Method finished with '"
262 + std::string(gsl_strerror(status))
263 + "' error" );
264 }
265
266 return GSL_SUCCESS;
267 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
MSG::DEBUG
Definition: IMessageSvc.h:18
std::string
STL class.
EqSolver::m_norm_residual
double m_norm_residual
Definition: EqSolver.h:95
EqSolver::m_max_iter
double m_max_iter
Definition: EqSolver.h:94
GaudiTool::Error
StatusCode Error(const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
Print the error message and return with the given StatusCode.
Definition: GaudiTool.h:689
gaudirun.s
string s
Definition: gaudirun.py:245
CommonMessagingBase::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:73
EqSolver::m_type
const gsl_multiroot_fdfsolver_type * m_type
Definition: EqSolver.h:96
Genfun
CLHEP.
Definition: IEqSolver.h:13
ana.i
list i
Definition: ana.py:128
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

## Member Data Documentation

std::string EqSolver::m_algType
| private

Definition at line 93 of file EqSolver.h.

double EqSolver::m_max_iter
| private

Definition at line 94 of file EqSolver.h.

double EqSolver::m_norm_residual
| private

Definition at line 95 of file EqSolver.h.

const gsl_multiroot_fdfsolver_type* EqSolver::m_type
| private

Definition at line 96 of file EqSolver.h.

The documentation for this class was generated from the following files:

- GaudiGSL/src/Components/EqSolver.h
- GaudiGSL/src/Components/EqSolver.cpp