|
Gaudi Framework, version v23r2 |
| Home | Generated: Thu Jun 28 2012 |
#include <GaudiMath/Adapters.h>

Public Types | |
| typedef double(* | Function1 )(const double) |
| typedef double(* | Function2 )(const double *) |
| typedef double(* | Function3 )(const std::vector< double > &) |
Public Member Functions | |
| SimpleFunction (Function1 func) | |
| From CLHEP/GenericFunctions. | |
| SimpleFunction (Function2 func, const size_t dim) | |
| constructor from the simple function with array-like argument | |
| SimpleFunction (Function3 func, const size_t dim) | |
| constructor from the simple function with vector argument | |
| SimpleFunction (const SimpleFunction &) | |
| copy constructor | |
| virtual | ~SimpleFunction () |
| destructor | |
| virtual unsigned int | dimensionality () const |
| dimensionality of the problem | |
| virtual bool | hasAnalyticDerivative () const |
| Does this function have an analytic derivative? | |
| virtual double | operator() (double) const |
| Function value. | |
| virtual double | operator() (const Argument &) const |
| Function value. | |
| virtual Genfun::Derivative | partial (unsigned int i) const |
| Derivatives. | |
Protected Types | |
| enum | Case { TrivialArg, ArrayArg, VectorArg } |
Private Member Functions | |
| SimpleFunction () | |
| SimpleFunction & | operator= (const SimpleFunction &) |
Private Attributes | |
| Case | m_case |
| size_t | m_DIM |
| Function1 | m_func1 |
| Function2 | m_func2 |
| double * | m_arg2 |
| Function3 | m_func3 |
| std::vector< double > | m_arg3 |
Definition at line 202 of file FunAdapters.h.
| typedef double(* Genfun::GaudiMathImplementation::SimpleFunction::Function1)(const double) |
Definition at line 205 of file FunAdapters.h.
| typedef double(* Genfun::GaudiMathImplementation::SimpleFunction::Function2)(const double *) |
Definition at line 206 of file FunAdapters.h.
| typedef double(* Genfun::GaudiMathImplementation::SimpleFunction::Function3)(const std::vector< double > &) |
Definition at line 207 of file FunAdapters.h.
enum Genfun::GaudiMathImplementation::SimpleFunction::Case [protected] |
Definition at line 209 of file FunAdapters.h.
{ TrivialArg , ArrayArg , VectorArg } ;
| Genfun::GaudiMathImplementation::SimpleFunction::SimpleFunction | ( | SimpleFunction::Function1 | func ) |
From CLHEP/GenericFunctions.
from CLHGEP/GenericFunctions
constructor from the trivial function
| func | pointer to trivial function |
Definition at line 156 of file Adapter.cpp.
| Genfun::GaudiMathImplementation::SimpleFunction::SimpleFunction | ( | SimpleFunction::Function2 | func, |
| const size_t | dim | ||
| ) |
constructor from the simple function with array-like argument
| func | pointer to trivial function |
| dim | dimension of the argument |
Definition at line 175 of file Adapter.cpp.
| Genfun::GaudiMathImplementation::SimpleFunction::SimpleFunction | ( | Function3 | func, |
| const size_t | dim | ||
| ) |
constructor from the simple function with vector argument
| func | pointer to trivial function |
| dim | dimension of the argument |
| Genfun::GaudiMathImplementation::SimpleFunction::SimpleFunction | ( | const SimpleFunction & | right ) |
copy constructor
Definition at line 214 of file Adapter.cpp.
| Genfun::GaudiMathImplementation::SimpleFunction::~SimpleFunction | ( | ) | [virtual] |
destructor
Definition at line 234 of file Adapter.cpp.
| Genfun::GaudiMathImplementation::SimpleFunction::SimpleFunction | ( | ) | [private] |
| virtual unsigned int Genfun::GaudiMathImplementation::SimpleFunction::dimensionality | ( | ) | const [inline, virtual] |
| virtual bool Genfun::GaudiMathImplementation::SimpleFunction::hasAnalyticDerivative | ( | ) | const [inline, virtual] |
Does this function have an analytic derivative?
Definition at line 245 of file FunAdapters.h.
{ return true ; }
| double Genfun::GaudiMathImplementation::SimpleFunction::operator() | ( | const Argument & | argument ) | const [virtual] |
Function value.
Definition at line 280 of file Adapter.cpp.
{
double result = 0 ;
switch ( m_case )
{
case TrivialArg :
result = (*m_func1) ( argument[0] ) ; break ;
case ArrayArg :
for( size_t i = 0 ; i < m_DIM ; ++i ) { m_arg2[i] = argument[i] ; }
return (*m_func2)( m_arg2 ) ; ; break ;
case VectorArg :
for( size_t i = 0 ; i < m_DIM ; ++i ) { m_arg3[i] = argument[i] ; }
result = (*m_func3) ( m_arg3 ) ; break ;
default:
break ;
}
return result ;
}
| double Genfun::GaudiMathImplementation::SimpleFunction::operator() | ( | double | value ) | const [virtual] |
Function value.
Definition at line 255 of file Adapter.cpp.
{
double result = 0 ;
switch ( m_case )
{
case TrivialArg :
result = (*m_func1) ( value ) ; break ;
case ArrayArg :
std::fill ( m_arg2 , m_arg2 + m_DIM , 0.0 );
m_arg2[0] = value ;
result = (*m_func2) ( m_arg2 ) ; break ;
case VectorArg :
std::fill ( m_arg3.begin () , m_arg3.end () , 0.0 );
m_arg3[0] = value ;
result = (*m_func3) ( m_arg3 ) ; break ;
default:
break ;
};
return result ;
}
| SimpleFunction& Genfun::GaudiMathImplementation::SimpleFunction::operator= | ( | const SimpleFunction & | ) | [private] |
| Genfun::Derivative Genfun::GaudiMathImplementation::SimpleFunction::partial | ( | unsigned int | i ) | const [virtual] |
Derivatives.
Definition at line 241 of file Adapter.cpp.
{
if ( i >= m_DIM )
{
const AbsFunction& aux = GaudiMath::Constant( 0 , m_DIM ) ;
return Genfun::FunctionNoop( &aux ) ;
}
const AbsFunction& aux = GaudiMath::Derivative( *this , i ) ;
return Genfun::FunctionNoop( &aux );
}
double* Genfun::GaudiMathImplementation::SimpleFunction::m_arg2 [private] |
Definition at line 268 of file FunAdapters.h.
std::vector<double> Genfun::GaudiMathImplementation::SimpleFunction::m_arg3 [mutable, private] |
Definition at line 271 of file FunAdapters.h.
Definition at line 262 of file FunAdapters.h.
Definition at line 263 of file FunAdapters.h.
Definition at line 265 of file FunAdapters.h.
Definition at line 267 of file FunAdapters.h.
Definition at line 270 of file FunAdapters.h.