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

Documentation for class Functor class.

It is used to wrap in a very simple and convenient way multi-dimensional function objects. It can wrap all the following types:

The function dimension is required when constructing the functor.

Definition at line 392 of file Functor.h.

Public Types

typedef FunctorImpl< IBaseFunctionMultiDimImpl
 
typedef IBaseFunctionMultiDim::BaseFunc ImplBase
 
- Public Types inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
typedef T BackendType
 
typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 

Public Member Functions

 Functor ()
 Default constructor. More...
 
template<typename Func >
 Functor (const Func &f, unsigned int dim)
 construct from a callable object of multi-dimension with the right signature (implementing operator()(double *x) More...
 
 Functor (const Functor &rhs)
 Copy constructor for functor based on ROOT::Math::IMultiGenFunction. More...
 
template<class PtrObj , typename MemFn >
 Functor (const PtrObj &p, MemFn memFn, unsigned int dim)
 construct from a pointer to member function (multi-dim type) More...
 
virtual ~Functor ()
 Destructor (no operations) More...
 
ImplBaseClone () const
 Clone a function. More...
 
unsigned int NDim () const
 Retrieve the dimension of the function. More...
 
Functoroperator= (const Functor &rhs)
 Assignment operator. More...
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
 IBaseFunctionMultiDimTempl ()
 
virtual ~IBaseFunctionMultiDimTempl ()
 virtual destructor More...
 
virtual IBaseFunctionMultiDimTempl< T > * Clone () const =0
 Clone a function. More...
 
virtual unsigned int NDim () const =0
 Retrieve the dimension of the function. More...
 
operator() (const T *x) const
 Evaluate the function at a point x[]. More...
 

Private Member Functions

double DoEval (const double *x) const
 

Private Attributes

std::unique_ptr< ImplfImpl
 

#include <Math/Functor.h>

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

Member Typedef Documentation

◆ Impl

Definition at line 397 of file Functor.h.

◆ ImplBase

Definition at line 398 of file Functor.h.

Constructor & Destructor Documentation

◆ Functor() [1/4]

ROOT::Math::Functor::Functor ( )
inline

Default constructor.

Definition at line 403 of file Functor.h.

◆ Functor() [2/4]

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

construct from a pointer to member function (multi-dim type)

Definition at line 410 of file Functor.h.

◆ Functor() [3/4]

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

construct from a callable object of multi-dimension with the right signature (implementing operator()(double *x)

Definition at line 421 of file Functor.h.

◆ ~Functor()

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

Destructor (no operations)

Definition at line 429 of file Functor.h.

◆ Functor() [4/4]

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

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

Definition at line 434 of file Functor.h.

Member Function Documentation

◆ Clone()

ImplBase * ROOT::Math::Functor::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 454 of file Functor.h.

◆ DoEval()

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

Definition at line 462 of file Functor.h.

◆ NDim()

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

Retrieve the dimension of the function.

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

Definition at line 457 of file Functor.h.

◆ operator=()

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

Assignment operator.

Definition at line 446 of file Functor.h.

Member Data Documentation

◆ fImpl

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

Definition at line 467 of file Functor.h.

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

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