Logo ROOT   6.12/07
Reference Guide
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members

GradFunctor class for Multidimensional gradient functions.

It is used to wrap in a very C++ callable object to make gradient functions. It can be constructed in three different way:

  1. from an object implementing both double operator()( const double * ) for the function evaluation and double Derivative(const double *, int icoord) for the partial derivatives
  2. from an object implementing any member function like Foo::XXX(const double *) for the function evaluation and any member function like Foo::XXX(const double *, int icoord) for the partial derivatives
  3. from an function object implementing double operator()( const double * ) for the function evaluation and another function object implementing double operator() (const double *, int icoord) for the partial derivatives

The function dimension is required when constructing the functor.

Definition at line 577 of file Functor.h.

Public Types

typedef FunctorImpl< IGradientFunctionMultiDimImpl
 
typedef IGradientFunctionMultiDim::BaseFunc ImplBase
 
- Public Types inherited from ROOT::Math::IGradientFunctionMultiDimTempl< T >
typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 
typedef IGradientMultiDimTempl< T > BaseGrad
 
- Public Types inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
typedef T BackendType
 
typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 

Public Member Functions

 GradFunctor ()
 Default constructor. More...
 
template<typename Func >
 GradFunctor (const Func &f, unsigned int dim)
 construct from a callable object of multi-dimension implementing operator()(const double *x) and Derivative(const double * x,icoord) More...
 
template<class PtrObj , typename MemFn , typename GradMemFn >
 GradFunctor (const PtrObj &p, MemFn memFn, GradMemFn gradFn, unsigned int dim)
 construct from a pointer to member function and member function types for function and derivative evaluations More...
 
template<typename Func , typename GradFunc >
 GradFunctor (const Func &f, const GradFunc &g, int dim)
 construct for Gradient Functions of multi-dimension Func gives the function evaluatiion, GradFunc the partial derivatives The function dimension is required More...
 
 GradFunctor (const GradFunctor &rhs)
 Copy constructor for functor based on ROOT::Math::IMultiGradFunction. More...
 
virtual ~GradFunctor ()
 Destructor (no operations) More...
 
ImplBaseClone () const
 Clone a function. More...
 
unsigned int NDim () const
 Retrieve the dimension of the function. More...
 
GradFunctoroperator= (const GradFunctor &rhs)
 Assignment operator. More...
 
- Public Member Functions inherited from ROOT::Math::IGradientFunctionMultiDimTempl< T >
virtual ~IGradientFunctionMultiDimTempl ()
 Virtual Destructor (no operations) More...
 
virtual void FdF (const T *x, T &f, T *df) const
 Optimized method to evaluate at the same time the function value and derivative at a point x. More...
 
virtual void Gradient (const T *x, T *grad) const
 Evaluate all the vector of function derivatives (gradient) at a point x. More...
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
 IBaseFunctionMultiDimTempl ()
 
virtual ~IBaseFunctionMultiDimTempl ()
 virtual destructor More...
 
operator() (const T *x) const
 Evaluate the function at a point x[]. More...
 
- Public Member Functions inherited from ROOT::Math::IGradientMultiDimTempl< T >
virtual ~IGradientMultiDimTempl ()
 virual destructor More...
 
Derivative (const T *x, unsigned int icoord=0) const
 Return the partial derivative with respect to the passed coordinate. More...
 

Private Member Functions

double DoDerivative (const double *x, unsigned int icoord) const
 
double DoEval (const double *x) const
 

Private Attributes

std::unique_ptr< ImplfImpl
 

#include <Math/Functor.h>

Inheritance diagram for ROOT::Math::GradFunctor:
[legend]

Member Typedef Documentation

◆ Impl

Definition at line 582 of file Functor.h.

◆ ImplBase

Definition at line 583 of file Functor.h.

Constructor & Destructor Documentation

◆ GradFunctor() [1/5]

ROOT::Math::GradFunctor::GradFunctor ( )
inline

Default constructor.

Definition at line 589 of file Functor.h.

◆ GradFunctor() [2/5]

template<typename Func >
ROOT::Math::GradFunctor::GradFunctor ( const Func &  f,
unsigned int  dim 
)
inline

construct from a callable object of multi-dimension implementing operator()(const double *x) and Derivative(const double * x,icoord)

Definition at line 597 of file Functor.h.

◆ GradFunctor() [3/5]

template<class PtrObj , typename MemFn , typename GradMemFn >
ROOT::Math::GradFunctor::GradFunctor ( const PtrObj &  p,
MemFn  memFn,
GradMemFn  gradFn,
unsigned int  dim 
)
inline

construct from a pointer to member function and member function types for function and derivative evaluations

Definition at line 605 of file Functor.h.

◆ GradFunctor() [4/5]

template<typename Func , typename GradFunc >
ROOT::Math::GradFunctor::GradFunctor ( const Func &  f,
const GradFunc &  g,
int  dim 
)
inline

construct for Gradient Functions of multi-dimension Func gives the function evaluatiion, GradFunc the partial derivatives The function dimension is required

Definition at line 615 of file Functor.h.

◆ ~GradFunctor()

virtual ROOT::Math::GradFunctor::~GradFunctor ( )
inlinevirtual

Destructor (no operations)

Definition at line 623 of file Functor.h.

◆ GradFunctor() [5/5]

ROOT::Math::GradFunctor::GradFunctor ( const GradFunctor rhs)
inline

Copy constructor for functor based on ROOT::Math::IMultiGradFunction.

Definition at line 629 of file Functor.h.

Member Function Documentation

◆ Clone()

ImplBase* ROOT::Math::GradFunctor::Clone ( ) const
inlinevirtual

Clone a function.

Each derived class must implement their version of the Clone method

Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.

Definition at line 647 of file Functor.h.

◆ DoDerivative()

double ROOT::Math::GradFunctor::DoDerivative ( const double *  x,
unsigned int  icoord 
) const
inlineprivate

Definition at line 660 of file Functor.h.

◆ DoEval()

double ROOT::Math::GradFunctor::DoEval ( const double *  x) const
inlineprivate

Definition at line 655 of file Functor.h.

◆ NDim()

unsigned int ROOT::Math::GradFunctor::NDim ( ) const
inlinevirtual

Retrieve the dimension of the function.

Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.

Definition at line 650 of file Functor.h.

◆ operator=()

GradFunctor& ROOT::Math::GradFunctor::operator= ( const GradFunctor rhs)
inline

Assignment operator.

Definition at line 639 of file Functor.h.

Member Data Documentation

◆ fImpl

std::unique_ptr<Impl> ROOT::Math::GradFunctor::fImpl
private

Definition at line 664 of file Functor.h.

Libraries for ROOT::Math::GradFunctor:
[legend]

The documentation for this class was generated from the following file: