Gaudi Framework, version v25r2

Home   Generated: Wed Jun 4 2014
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Helpers.cpp
Go to the documentation of this file.
1 // $Id: Helpers.cpp,v 1.1 2003/11/19 16:55:59 mato Exp $
2 // ============================================================================
3 // Include files
4 // ============================================================================
5 // CLHEP
6 // ============================================================================
7 #include "CLHEP/GenericFunctions/AbsFunction.hh"
8 // Handle CLHEP 2.0.x move to CLHEP namespace
9 namespace CLHEP { }
10 using namespace CLHEP;
11 // ============================================================================
12 // local
13 // ============================================================================
14 #include "Helpers.h"
15 // ============================================================================
16 
17 namespace Genfun
18 {
19  namespace GaudiMathImplementation
20  {
21 
22  // ========================================================================
23  GSL_Helper::GSL_Helper
24  ( const Genfun::AbsFunction& function ,
25  Genfun::Argument& argument ,
26  const size_t index )
27  : m_function ( function ) ,
28  m_argument ( argument ) ,
29  m_index ( index )
30  {}
31  // ========================================================================
32 
33  // ========================================================================
34  GSL_Helper::~GSL_Helper(){}
35  // ========================================================================
36 
37  // ========================================================================
38  double GSL_Adaptor( double x , void* params )
39  {
40  // get parameters
41  GSL_Helper* aux = (GSL_Helper*) params ;
42  // decode parameters
43  const Genfun::AbsFunction& function = aux -> m_function ;
44  const size_t index = aux -> m_index ;
45  Genfun::Argument& argument = aux -> m_argument ;
46  // save the current value of argument
47  const double x_prev = argument[index] ;
48  // modify the argument
49  argument[index]= x ;
50  // evaluate the function
51  const double fun = function( argument ) ;
52  // restore the argument
53  argument[index] = x_prev ;
54  return fun ;
55  }
56  // ========================================================================
57 
58  } // end of namespace GaudiMathImplementation
59 } // end of namespace Genfun
60 
61 // ============================================================================
62 // The END
63 // ============================================================================
64 

Generated at Wed Jun 4 2014 14:48:56 for Gaudi Framework, version v25r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004