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

Functor1D class for one-dimensional functions.

It is used to wrap in a very simple and convenient way:

  • any C++ callable object implementation double operator()( double )
  • a free C function of type double ()(double )
  • a member function with the correct signature like Foo::Eval(double ). In this case one pass the object pointer and a pointer to the member function (&Foo::Eval)

Definition at line 578 of file Functor.h.

Public Types

typedef FunctorImpl< IBaseFunctionOneDimImpl
 
typedef IBaseFunctionOneDim::BaseFunc ImplBase
 
- Public Types inherited from ROOT::Math::IBaseFunctionOneDim
typedef IBaseFunctionOneDim BaseFunc
 

Public Member Functions

 Functor1D ()
 Default constructor.
 
template<typename Func >
 Functor1D (const Func &f)
 construct from a callable object with the right signature implementing operator() (double x)
 
 Functor1D (const Functor1D &rhs)
 Copy constructor for Functor based on ROOT::Math::IGenFunction.
 
template<class PtrObj , typename MemFn >
 Functor1D (const PtrObj &p, MemFn memFn)
 construct from a pointer to member function (1D type)
 
 Functor1D (const std::function< double(double)> &f)
 specialized constructor from a std::function implementing the function evaluation.
 
virtual ~Functor1D ()
 Destructor (no operations)
 
ImplBaseClone () const
 Clone a function.
 
Functor1Doperator= (const Functor1D &rhs)
 Assignment operator.
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionOneDim
 IBaseFunctionOneDim ()
 
virtual ~IBaseFunctionOneDim ()
 virtual destructor
 
double operator() (const double *x) const
 Evaluate the function at a point x[].
 
double operator() (double x) const
 Evaluate the function at a point x Use the a pure virtual private method DoEval which must be implemented by sub-classes.
 

Private Member Functions

double DoEval (double x) const
 implementation of the evaluation function. Must be implemented by derived classes
 

Private Attributes

std::unique_ptr< ImplfImpl
 

#include <Math/Functor.h>

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

Member Typedef Documentation

◆ Impl

◆ ImplBase

Constructor & Destructor Documentation

◆ Functor1D() [1/5]

ROOT::Math::Functor1D::Functor1D ( )
inline

Default constructor.

Definition at line 589 of file Functor.h.

◆ Functor1D() [2/5]

template<typename Func >
ROOT::Math::Functor1D::Functor1D ( const Func &  f)
inline

construct from a callable object with the right signature implementing operator() (double x)

Definition at line 596 of file Functor.h.

◆ Functor1D() [3/5]

template<class PtrObj , typename MemFn >
ROOT::Math::Functor1D::Functor1D ( const PtrObj &  p,
MemFn  memFn 
)
inline

construct from a pointer to member function (1D type)

Definition at line 605 of file Functor.h.

◆ Functor1D() [4/5]

ROOT::Math::Functor1D::Functor1D ( const std::function< double(double)> &  f)
inline

specialized constructor from a std::function implementing the function evaluation.

This specialized constructor is introduced in order to use the Functor class in Python passing Python user defined functions

Definition at line 614 of file Functor.h.

◆ ~Functor1D()

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

Destructor (no operations)

Definition at line 621 of file Functor.h.

◆ Functor1D() [5/5]

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

Copy constructor for Functor based on ROOT::Math::IGenFunction.

Definition at line 627 of file Functor.h.

Member Function Documentation

◆ Clone()

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

Clone a function.

Each derived class will implement their version of the provate DoClone method

Implements ROOT::Math::IBaseFunctionOneDim.

Definition at line 646 of file Functor.h.

◆ DoEval()

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

implementation of the evaluation function. Must be implemented by derived classes

Implements ROOT::Math::IBaseFunctionOneDim.

Definition at line 650 of file Functor.h.

◆ operator=()

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

Assignment operator.

Definition at line 639 of file Functor.h.

Member Data Documentation

◆ fImpl

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

Definition at line 654 of file Functor.h.

Libraries for ROOT::Math::Functor1D:

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