Gaudi Framework, version v23r4

Home   Generated: Mon Sep 17 2012

Helpers.cpp

Go to the documentation of this file.
00001 // $Id: Helpers.cpp,v 1.1 2003/11/19 16:55:59 mato Exp $
00002 // ============================================================================
00003 // Include files
00004 // ============================================================================
00005 // CLHEP
00006 // ============================================================================
00007 #include "CLHEP/GenericFunctions/AbsFunction.hh"
00008 // Handle CLHEP 2.0.x move to CLHEP namespace
00009 namespace CLHEP { }
00010 using namespace CLHEP;
00011 // ============================================================================
00012 // local
00013 // ============================================================================
00014 #include "Helpers.h"
00015 // ============================================================================
00016 
00017 namespace Genfun
00018 {
00019   namespace GaudiMathImplementation
00020   {
00021 
00022     // ========================================================================
00023     GSL_Helper::GSL_Helper
00024     ( const Genfun::AbsFunction& function ,
00025       Genfun::Argument&          argument ,
00026       const size_t               index    )
00027       : m_function ( function ) ,
00028         m_argument ( argument ) ,
00029         m_index    ( index    )
00030     {}
00031     // ========================================================================
00032 
00033     // ========================================================================
00034     GSL_Helper::~GSL_Helper(){}
00035     // ========================================================================
00036 
00037     // ========================================================================
00038     double GSL_Adaptor( double x , void* params )
00039     {
00040       // get parameters
00041       GSL_Helper* aux = (GSL_Helper*) params ;
00042       // decode parameters
00043       const Genfun::AbsFunction& function = aux -> m_function  ;
00044       const size_t               index    = aux -> m_index     ;
00045       Genfun::Argument&          argument = aux -> m_argument  ;
00046       // save the current value of argument
00047       const double x_prev = argument[index] ;
00048       // modify the argument
00049       argument[index]= x       ;
00050       // evaluate the function
00051       const double fun = function( argument ) ;
00052       // restore the argument
00053       argument[index] = x_prev  ;
00054       return fun ;
00055     }
00056     // ========================================================================
00057 
00058   } // end of namespace GaudiMathImplementation
00059 } // end of namespace Genfun
00060 
00061 // ============================================================================
00062 // The END
00063 // ============================================================================
00064 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Mon Sep 17 2012 13:49:29 for Gaudi Framework, version v23r4 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004