Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches

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 585 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.
 
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
 
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)
 
 GradFunctor (const GradFunctor &rhs)
 Copy constructor for functor based on ROOT::Math::IMultiGradFunction.
 
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
 
virtual ~GradFunctor ()
 Destructor (no operations)
 
ImplBaseClone () const
 Clone a function.
 
unsigned int NDim () const
 Retrieve the dimension of the function.
 
GradFunctoroperator= (const GradFunctor &rhs)
 Assignment operator.
 
- Public Member Functions inherited from ROOT::Math::IGradientFunctionMultiDimTempl< T >
virtual ~IGradientFunctionMultiDimTempl ()
 Virtual Destructor (no operations)
 
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.
 
virtual void Gradient (const T *x, T *grad) const
 Evaluate all the vector of function derivatives (gradient) at a point x.
 
virtual unsigned int NDim () const=0
 Retrieve the dimension of the function.
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
 IBaseFunctionMultiDimTempl ()
 
virtual ~IBaseFunctionMultiDimTempl ()
 virtual destructor
 
operator() (const T *x) const
 Evaluate the function at a point x[].
 
- Public Member Functions inherited from ROOT::Math::IGradientMultiDimTempl< T >
virtual ~IGradientMultiDimTempl ()
 virual destructor
 
Derivative (const T *x, unsigned int icoord=0) const
 Return the partial derivative with respect to the passed coordinate.
 

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

◆ ImplBase

Constructor & Destructor Documentation

◆ GradFunctor() [1/5]

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

Default constructor.

Definition at line 597 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 605 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 613 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 623 of file Functor.h.

◆ ~GradFunctor()

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

Destructor (no operations)

Definition at line 631 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 637 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 655 of file Functor.h.

◆ DoDerivative()

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

Definition at line 668 of file Functor.h.

◆ DoEval()

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

Definition at line 663 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 658 of file Functor.h.

◆ operator=()

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

Assignment operator.

Definition at line 647 of file Functor.h.

Member Data Documentation

◆ fImpl

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

Definition at line 672 of file Functor.h.

Libraries for ROOT::Math::GradFunctor:

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