Commit de6eb162 authored by cvs2svn's avatar cvs2svn
Browse files

This commit was manufactured by cvs2svn to create tag

'GAUDI_v19r3-pre'.

git-svn-id: svn+ssh://svn.cern.ch/reps/gaudi/distribution/tags/GAUDI/GAUDI_v19r3-pre@3724 53ecefc3-a64d-0410-9bdf-b8581fa3287e
parent 13bf3436
// $Id: GaudiGSL.h,v 1.1 2003/11/19 17:15:59 mato Exp $
// ============================================================================
// CVS tag $Name: $
// ============================================================================
// $Log: GaudiGSL.h,v $
// Revision 1.1 2003/11/19 17:15:59 mato
// Incoorporeated changes from Kirill Miklyaev
//
// Revision 1.1.1.1 2002/05/14 15:25:36 mato
// New Gaudi error handling package for GSL (Gnu Scientific Library)
//
// ============================================================================
#ifndef GAUDIGSL_GAUDIGSL_H
#define GAUDIGSL_GAUDIGSL_H 1
// Include files
class IGslSvc; // from GaudiGSL
/** @class GaudiGSL GaudiGSL.h GaudiGSL/GaudiGSL.h
*
* Helper class to get (static) access to Gaudi GSL Service
* General users are not supposed to use it.
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 29/04/2002
*/
class GaudiGSL
{
public:
/** static accessor to Gaudi GSL Service
* @return (const) pointer to Gaudi GSL Service
*/
static const IGslSvc* gslSvc () ;
/**set new value for static Gaudi GSL Service
* @return (const) pointer to Gaudi GSL Service
*/
static const IGslSvc* setGslSvc ( const IGslSvc* value ) ;
private:
static const IGslSvc* s_gslSvc ;
};
// ============================================================================
// The END
// ============================================================================
#endif // GAUDIGSL_GAUDIGSL_H
// ============================================================================
// $Id: GslError.h,v 1.2 2003/11/19 16:55:57 mato Exp $
// ============================================================================
#ifndef GAUDIGSL_GSLERROR_H
#define GAUDIGSL_GSLERROR_H 1
// Include files
// STD & STL
#include <string>
/** @struct GslError GslError.h
*
* Helper class to represent GSL errors
*
* @author Vanya Belyaev Ivan.Belyaev
* @date 29/04/2002
*/
class GslError
{
public:
/// error message ('reason')
std::string reason ;
/// file name
std::string file ;
/// line number
int line ;
/// error code (GSL)
int code ;
/// constructor
GslError( const std::string& r = "" ,
const std::string& f = "" ,
const int l = 0 ,
const int c = 0 )
: reason ( r ) , file ( f ) , line ( l ) , code ( c ) {};
/// comparison (ordering) criteria
bool operator<( const GslError& right ) const
{
return
code < right.code ? true :
right.code < code ? false :
reason < right.reason ? true :
right.reason < reason ? false :
file < right.file ? true :
right.file < file ? false : line < right.line ;
};
};
// ============================================================================
// The END
// ============================================================================
#endif // GSLERROR_H
// ============================================================================
// $Id: GslErrorHandlers.h,v 1.1 2003/11/19 17:15:59 mato Exp $
// ============================================================================
// CVS tag $Name: $
// ============================================================================
// $Log: GslErrorHandlers.h,v $
// Revision 1.1 2003/11/19 17:15:59 mato
// Incoorporeated changes from Kirill Miklyaev
//
// Revision 1.1.1.1 2002/05/14 15:25:37 mato
// New Gaudi error handling package for GSL (Gnu Scientific Library)
//
// ============================================================================
#ifndef GAUDIGSL_GSLERRORHANDLERS_H
#define GAUDIGSL_GSLERRORHANDLERS_H 1
/** @namespace GslErrorHandlers
*
* The collection of Error Handlers for GSL
*
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 29/04/2002
*/
namespace GslErrorHandlers
{
/** @fn ignoreTheError
*
* The simplest Gsl Error handler,
* It simply ingnores the error
*
* @see IGslSvc
*
* @param reason error reason (message)
* @param file file name
* @param line line number
* @param code error code
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 29/04/2002
*/
void ignoreTheError
( const char* reason ,
const char* file ,
int line ,
int code );
/** @fn handleTheError
*
* The simplest Gsl Error handler,
* It delegates the actual error handling to GSL Service
*
* @see IGslSvc
*
* @param reason error reason (message)
* @param file file name
* @param line line number
* @param code error code
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 29/04/2002
*/
void handleTheError
( const char* reason ,
const char* file ,
int line ,
int code );
/** @fn throwException
*
* The simple Gsl Error handler,
* it throwns the Gaudi Exception
*
* @exception GaudiException
* @see GaudiException
*
* @param reason error reason (message)
* @param file file name
* @param line line number
* @param code error code
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 29/04/2002
*/
void throwException
( const char* reason ,
const char* file ,
int line ,
int code );
};
// ============================================================================
// The END
// ============================================================================
#endif // GSLERRORHANDLERS_H
// ============================================================================
// =============================================================================
#ifndef GAUDIGSL_IEQSOLVER_H
#define GAUDIGSL_IEQSOLVER_H 1
// Include files
// from STL
#include <vector>
#include <string>
// from Gaudi
#include "GaudiKernel/IAlgTool.h"
// forward declarations
namespace Genfun /// CLHEP
{
class AbsFunction;
class Argument;
}
/** @var IID_IEqSolver
* Declaration of the unique interface identifier
* (interface id, major version, minor version)
*/
static const InterfaceID IID_IEqSolver("IEqSolver", 1 , 0);
/** @class IEqSolver IEqSolver.h GaudiGSL/IEqSolver.h
* Interface file for multidimensional root-finding
* (solving nonlinear system with n equations in n unknowns)
* @author Kirill Miklyaev kirillm@iris1.itep.ru
* @date 2003-07-07
*/
class IEqSolver : virtual public IAlgTool
{
public:
/// Function (@see CLHEP/GenericFunctions/AbsFunction.hh)
typedef Genfun::AbsFunction GenFunc ;
/// Vector of the function "GenFunc" which we solver
typedef std::vector<const GenFunc*> Equations ;
/// Argument of function "GenFunc" (@see CLHEP/GenericFunctions/Argument.hh)
typedef Genfun::Argument Arg ;
public:
/// Retrieve interface ID
static const InterfaceID& interfaceID() { return IID_IEqSolver; }
/// Do Multidimensional Root-finding
/** Solving nonlinear system with N equations in N unknowns
* of the function "GenFunc"
* @param equations - vector of functions
* @see CLHEP/GenericFunctions/AbsFunction.hh
* @param solution - argument
* @see CLHEP/GenericFunctions/Argument.hh
* @return StatusCode
*/
virtual StatusCode solver( const Equations& equations ,
Arg& solution ) const = 0 ;
protected:
private:
};
#endif // GAUDIGSL_IEQSOLVER_H
// $Id: IFuncMinimum.h,v 1.4 2005/01/10 14:35:09 mato Exp $
// =============================================================================
#ifndef GAUDIGSL_IFUNCMINIMUM_H
#define GAUDIGSL_IFUNCMINIMUM_H 1
// Include files
// from STL
#include <vector>
#include <string>
// from Gaudi
#include "GaudiKernel/IAlgTool.h"
// forward declarations
namespace Genfun /// CLHEP
{
class AbsFunction ;
class Argument ;
};
namespace CLHEP {
class HepSymMatrix ; /// CLHEP
}
/** @var IID_IFuncMinimum
* Declaration of the unique interface identifier
* (interface id, major version, minor version)
*/
static const InterfaceID IID_IFuncMinimum("IFuncMinimum", 1 , 0);
/** @class IFuncMinimum IFuncMinimum.h GaudiGSL/IFuncMinimum.h
* Interface file to find minimum of the function
* and compute covariance matrix (matrix of error)
* @author Kirill Miklyaev kirillm@iris1.itep.ru
* @date 2002-09-14
*/
class IFuncMinimum : virtual public IAlgTool
{
public:
/// Function which we minimize (@see CLHEP/GenericFunctions/AbsFunction.hh)
typedef Genfun::AbsFunction GenFunc ;
/// Argument of function "GenFunc" (@see CLHEP/GenericFunctions/Argument.hh)
typedef Genfun::Argument Arg ;
/// Covariance matrix (matrix of error) (@see CLHEP/Matrix/SymMatrix.h)
typedef CLHEP::HepSymMatrix Covariance;
public:
/// Retrieve interface ID
static const InterfaceID& interfaceID() { return IID_IFuncMinimum; }
/// Do Multidimensional Minimization
/** Find minimum and gradient of the function "GenFunc"
* @param fun - function @see CLHEP/GenericFunctions/AbsFunction.hh
* @param pars - argument @see CLHEP/GenericFunctions/Argument.hh
* @return StatusCode
*/
virtual StatusCode minimum( const GenFunc& fun ,
Arg& pars ) const = 0 ;
/** Find minimum and gradient of the function "GenFunc"
* @param fun - function @see CLHEP/GenericFunctions/AbsFunction.hh
* @param pars - argument @see CLHEP/GenericFunctions/Argument.hh
* @param covar - covariance matrix (matrix of error)
* @see CLHEP/Matrix/SymMatrix.h
* @return StatusCode
*/
virtual StatusCode minimum( const GenFunc& fun ,
Arg& pars ,
Covariance& covar ) const = 0 ;
protected:
private:
};
#endif // GAUDIGSL_IFUNCMINIMUM_H
// $Id: IGslErrorHandler.h,v 1.2 2003/11/19 16:55:57 mato Exp $
// ============================================================================
#ifndef GAUDIGSL_IGSLERRORHANDLER_H
#define GAUDIGSL_IGSLERRORHANDLER_H 1
// Include files
#include "GaudiKernel/IAlgTool.h"
// local
#include "GaudiGSL/IIDIGslErrorHandler.h"
// forward declarations
class GslError;
/** @class IGslErrorHandler IGslErrorHandler.h GaudiGSL/IGslErrorHandler.h
*
* The abstract interface for arbitrary GSL error handler
*
* @author Vanya Ivan.Belyaev@itep.ru
* @date 30/04/2002
*/
class IGslErrorHandler :
public virtual IAlgTool
{
public:
/** the unique interface identifier (static)
* @return unique interface identifier
* @see IInterface
*/
static const InterfaceID& interfaceID() { return IID_IGslErrorHandler; }
/** handle the GSL error
* @param error error to be handled
* @see GslError
* @return status code
*/
virtual StatusCode handle ( const GslError& error ) const = 0 ;
protected:
/// destructor (virtual and protected)
virtual ~IGslErrorHandler(){};
};
// ============================================================================
// The END
// ============================================================================
#endif // GAUDIGSL_IGSLERRORHANDLER_H
// ============================================================================
// $Id: IGslSvc.h,v 1.2 2003/11/19 16:55:57 mato Exp $
// ============================================================================
#ifndef GAUDIGSL_IGSLSVC_H
#define GAUDIGSL_IGSLSVC_H 1
// Include files
#include "GaudiKernel/IService.h"
// local
#include "GaudiGSL/IIDIGslSvc.h"
// forward declaration
class GslError ;
/** @class IGslSvc IGslSvc.h GaudiGSL/IGslSvc.h
*
* The abstract interface to "deal" with GNU Scientific Library (GLS)
* The main task is the error handling.
* Could be extended in future to cover other aspects as well.
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 29/04/2002
*/
class IGslSvc : virtual public IService
{
public:
/** type definition of "standard" GSL error handler functions
* @param reason error reason (message)
* @param file file name
* @param line line number
* @param code error code
*/
typedef void (*GslErrorHandler)
( const char* /* reason */ ,
const char* /* file */ ,
int /* line */ ,
int /* code */ );
public:
/** retrieve the unique interface identifier (static method)
* @retun unique interface identifier
*/
static const InterfaceID& interfaceID() { return IID_IGslSvc ; }
/** handle the GSL error
* @param error error to be handled
* @see GslError
* @return status code
*/
virtual StatusCode handle
( const GslError& error ) const = 0 ;
/** retrieve the current GSL error handler
* @return current GSL error handler
*/
virtual GslErrorHandler handler () const = 0 ;
/** set new GSL error handler
* @param handler new GSL error handler
* @return GSL error handler
*/
virtual GslErrorHandler setHandler ( GslErrorHandler handler ) const = 0 ;
/** transform GSL error code to Gaudi status code
* @param error GLS error code
* @return status code
*/
virtual StatusCode status ( const int error ) const = 0 ;
protected:
/// destructor (virtual and protected)
virtual ~IGslSvc(){} ;
};
// ============================================================================
// The END
// ============================================================================
#endif // GAUDIGSL_IGSLSVC_H
// ============================================================================
// $Id: IIDIGslErrorHandler.h,v 1.2 2003/11/19 16:55:57 mato Exp $
// ============================================================================
#ifndef GAUDIGSL_IIDIGSLERRORHANDLER_H
#define GAUDIGSL_IIDIGSLERRORHANDLER_H 1
// Include files
/** @file
*
* The unique identifier for interface IGslErrorHandler
* @see IGslErrorHandler
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 30/04/2002
*/
/** @var IID_IGslErrorHandler
*
* The unique identifier for interface IGslErrorHandler
* @see IGslErrorHandler
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 30/04/2002
*/
static const InterfaceID IID_IGslErrorHandler( "IGslErorrHandler" , 1 , 0 );
// ============================================================================
// The END
// ============================================================================
#endif // GAUDIGSL_IIDIGSLERRORHANDLER_H
// ============================================================================
// $Id: IIDIGslSvc.h,v 1.2 2003/11/19 16:55:58 mato Exp $
// ============================================================================
#ifndef GAUDIGSL_IIDIGSLSVC_H
#define GAUDIGSL_IIDIGSLSVC_H 1
// Include files
#include "GaudiKernel/IInterface.h"
/** @file
*
* Definiiton if the unique interface identifier for IGslSvc
* @see IGslSvc
* @see IInterface
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 29/04/2002
*/
/** @var IID_IGslSvc
*
* Definiiton if the unique interface identifier for IGslSvc
* @see IGslSvc
* @see IInterface
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 29/04/2002
*/
static const InterfaceID IID_IGslSvc( "IGslSvc" , 1 , 0 );
// ============================================================================
// The END
// ============================================================================
#endif // GAUDIGSL_IIDIGSLSVC_H
// ============================================================================
// $Id: Adapters.h,v 1.2 2005/11/25 10:27:03 mato Exp $
// ============================================================================
#ifndef GAUDIMATH_ADAPTERS_H
#define GAUDIMATH_ADAPTERS_H 1
// ============================================================================
// Include files
// ============================================================================
// Local
// ============================================================================
#include "GaudiMath/FunAdapters.h"
#include "GaudiMath/GSLFunAdapters.h"
// ============================================================================
namespace GaudiMath
{
typedef Genfun::GaudiMathImplementation::AdapterIFunction
AIDAFunction ;
typedef Genfun::GaudiMathImplementation::Adapter2DoubleFunction
Function2D ;
typedef Genfun::GaudiMathImplementation::Adapter3DoubleFunction
Function3D ;
typedef Genfun::GaudiMathImplementation::SimpleFunction
SimpleFunction ;
typedef Genfun::GaudiMathImplementation::GSLFunctionWithMode
GSLFunctionWithMode ;
typedef Genfun::GaudiMathImplementation::GSLFunctionWithError
GSLFunctionWithError ;
typedef Genfun::GaudiMathImplementation::GSLFunctionWithModeAndError
GSLFunctionWithModeAndError ;
AIDAFunction adapter
( const AIDA::IFunction& function ) ;
Function2D adapter
( Function2D::Function function ) ;
Function3D adapter
( Function3D::Function function ) ;
SimpleFunction adapter
( SimpleFunction::Function1 function ) ;
SimpleFunction adapter
( const size_t dim ,
SimpleFunction::Function2 function ) ;
SimpleFunction adapter
( const size_t dim ,
SimpleFunction::Function3 function ) ;
GSLFunctionWithMode adapter
( GSLFunctionWithMode::Function function ,
const gsl_mode_t& mode ) ;
GSLFunctionWithError adapter
( GSLFunctionWithError::Function function ) ;
GSLFunctionWithModeAndError adapter
( GSLFunctionWithModeAndError::Function function ,
const gsl_mode_t& mode ) ;
}; // end of namespace GaudiMath
#endif // GAUDIMATH_ADAPTERS_H
// ============================================================================
// $Id: Constant.h,v 1.1 2003/11/19 17:09:39 mato Exp $
// ============================================================================
#ifndef GAUDIMATH_CONSTANT_H
#define GAUDIMATH_CONSTANT_H 1
// ============================================================================
// Include files
// ============================================================================
// CLHEP
// ============================================================================
#include "CLHEP/GenericFunctions/AbsFunction.hh"
// ============================================================================
namespace Genfun // due to CLHEP
{
namespace GaudiMathImplementation
{
/** @class Constant Constant.h GaudiMath/Constant.h
*
* Fixed constant function
*
* @author Vanya BELYAEV Ivan.Belyaev@itep.ru
* @date 2003-08-31