9 #include "AIDA/IFunction.h" 15 namespace GaudiMathImplementation
21 , m_dim ( fun.dimension() )
22 , m_arg ( fun.dimension() , 0 )
36 for (
size_t i = 0; i <
m_dim; ++i ) {
m_arg[i] = 0.0 ; }
43 for (
size_t i = 0; i <
m_dim; ++i ) {
m_arg[i] = x[i] ; }
52 return Genfun::FunctionNoop( &aux ) ;
55 return Genfun::FunctionNoop ( &aux ) ;
72 double Adapter2DoubleFunction::operator()
74 {
return m_func ( x , 0 ) ; }
76 double Adapter2DoubleFunction::operator()
77 (
const Genfun::Argument& x )
const 78 {
return m_func ( x[0] , x[1] ) ; }
80 double Adapter2DoubleFunction::operator()
82 const double y )
const 83 {
return m_func ( x , y ) ; }
91 return Genfun::FunctionNoop( &aux ) ;
94 return Genfun::FunctionNoop ( &aux ) ;
111 double Adapter3DoubleFunction::operator()
113 {
return m_func ( x , 0 , 0 ) ; }
115 double Adapter3DoubleFunction::operator()
116 (
const Genfun::Argument& x )
const 117 {
return m_func ( x[0] , x[1] , x[2] ) ; }
119 double Adapter3DoubleFunction::operator()
122 const double z )
const 123 {
return m_func ( x , y , z ) ; }
131 return Genfun::FunctionNoop( &aux ) ;
134 return Genfun::FunctionNoop ( &aux ) ;
150 , m_func2 (
nullptr )
151 , m_func3 (
nullptr )
167 , m_func1 (
nullptr )
169 , m_arg2 (
new double[dim] )
170 , m_func3 (
nullptr )
187 , m_func1 (
nullptr )
188 , m_func2 (
nullptr )
201 , m_DIM ( right.
m_DIM )
209 m_arg2.reset(
new double[m_DIM] );
225 return Genfun::FunctionNoop( &aux ) ;
228 return Genfun::FunctionNoop( &aux );
240 result = (*m_func1) ( value ) ; break ;
244 result = (*m_func2) ( m_arg2.get() ) ; break ;
246 std::fill ( m_arg3.begin () , m_arg3.end () , 0.0 );
248 result = (*m_func3) ( m_arg3 ) ; break ;
265 result = (*m_func1) ( argument[0] ) ; break ;
267 for(
size_t i = 0 ; i < m_DIM ; ++i ) { m_arg2[i] = argument[i] ; }
268 return (*m_func2)( m_arg2.get() ) ; ; break ;
270 for(
size_t i = 0 ; i < m_DIM ; ++i ) { m_arg3[i] = argument[i] ; }
271 result = (*m_func3) ( m_arg3 ) ; break ;
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
double(* Function1)(const double)
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
std::unique_ptr< double[]> m_arg2
mandatory macro from CLHEP/GenericFunctions
double operator()(double) const override
Function value.
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
double operator()(double a) const override
mandatory macro from CLHEP/GenericFunctions
std::vector< double > m_arg3
mandatory macro from CLHEP/GenericFunctions
const AIDA::IFunction * m_fun
std::vector< double > m_arg
double fun(const std::vector< double > &x)
double(* Function2)(const double *)
~AdapterIFunction() override
desctructor
double(* Function3)(const std::vector< double > &)
double(* Function)(const double, const double)
the actual type of the function "to be adapted"
~Adapter3DoubleFunction() override
destructor
double(* Function)(const double, const double, const double)
the actual type of the function "to be adapted"
Genfun::GaudiMathImplementation::Constant Constant
constructor from the IFunction ( see AIDA/IFunction.h)
~Adapter2DoubleFunction() override
destructor