ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ROOT::Math::GradFunctor Class Reference

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 590 of file Functor.h.

Public Types

typedef FunctorImpl
< IGradientFunctionMultiDim
Impl
 
typedef
IGradientFunctionMultiDim::BaseFunc 
ImplBase
 
- Public Types inherited from ROOT::Math::IGradientFunctionMultiDim
typedef IBaseFunctionMultiDim BaseFunc
 
typedef IGradientMultiDim BaseGrad
 
- Public Types inherited from ROOT::Math::IBaseFunctionMultiDim
typedef IBaseFunctionMultiDim 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...
 
virtual ~GradFunctor ()
 Destructor (no operations) More...
 
 GradFunctor (const GradFunctor &rhs)
 Copy constructor for functor based on ROOT::Math::IMultiGradFunction. More...
 
GradFunctoroperator= (const GradFunctor &rhs)
 Assignment operator. More...
 
ImplBaseClone () const
 Clone a function. More...
 
unsigned int NDim () const
 Retrieve the dimension of the function. More...
 
- Public Member Functions inherited from ROOT::Math::IGradientFunctionMultiDim
virtual ~IGradientFunctionMultiDim ()
 Virtual Destructor (no operations) More...
 
virtual void Gradient (const double *x, double *grad) const
 Evaluate all the vector of function derivatives (gradient) at a point x. More...
 
virtual void FdF (const double *x, double &f, double *df) const
 Optimized method to evaluate at the same time the function value and derivative at a point x. More...
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDim
 IBaseFunctionMultiDim ()
 
virtual ~IBaseFunctionMultiDim ()
 virtual destructor More...
 
double operator() (const double *x) const
 Evaluate the function at a point x[]. More...
 
- Public Member Functions inherited from ROOT::Math::IGradientMultiDim
virtual ~IGradientMultiDim ()
 virual destructor More...
 
double Derivative (const double *x, unsigned int icoord=0) const
 Return the partial derivative with respect to the passed coordinate. More...
 

Private Member Functions

double DoEval (const double *x) const
 Implementation of the evaluation function. More...
 
double DoDerivative (const double *x, unsigned int icoord) const
 function to evaluate the derivative with respect each coordinate. More...
 

Private Attributes

std::auto_ptr< ImplfImpl
 

#include <Math/Functor.h>

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

Member Typedef Documentation

Definition at line 595 of file Functor.h.

Definition at line 596 of file Functor.h.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 602 of file Functor.h.

Referenced by Clone().

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 610 of file Functor.h.

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 618 of file Functor.h.

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 628 of file Functor.h.

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

Destructor (no operations)

Definition at line 636 of file Functor.h.

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

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

Definition at line 642 of file Functor.h.

Member Function Documentation

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

Clone a function.

Each derived class must implement their version of the Clone method

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 663 of file Functor.h.

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

function to evaluate the derivative with respect each coordinate.

To be implemented by the derived class

Implements ROOT::Math::IGradientMultiDim.

Definition at line 676 of file Functor.h.

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

Implementation of the evaluation function.

Must be implemented by derived classes

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 671 of file Functor.h.

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

Retrieve the dimension of the function.

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 666 of file Functor.h.

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

Assignment operator.

Definition at line 652 of file Functor.h.

Member Data Documentation

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

Definition at line 680 of file Functor.h.

Referenced by DoDerivative(), DoEval(), GradFunctor(), NDim(), and operator=().

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

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