Logo ROOT  
Reference Guide
ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType > Class Template Reference

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
class ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >

OneDimMultiFunctionAdapter class to wrap a multidimensional function in one dimensional one.

Given a f(x1,x2,x3,....xn) transforms in a f( x_i) given the coordinate intex i and the vector x[] of the coordinates. It provides the possibility to copy and own the data array of the coordinates or to maintain internally a pointer to an external array for being more efficient. In this last case the user must garantee the life of the given passed pointer

Definition at line 66 of file OneDimFunctionAdapter.h.

Public Member Functions

 OneDimMultiFunctionAdapter (const OneDimMultiFunctionAdapter &rhs)
 
 OneDimMultiFunctionAdapter (MultiFuncType f, const double *x, unsigned int icoord=0, const double *p=0)
 Constructor from the function object , pointer to an external array of x values and coordinate we want to adapt. More...
 
 OneDimMultiFunctionAdapter (MultiFuncType f, unsigned int dim=1, unsigned int icoord=0, const double *p=0)
 Constructor from the function object , dimension of the function and and coordinate we want to adapt. More...
 
virtual ~OneDimMultiFunctionAdapter ()
 Destructor (no operations) More...
 
virtual OneDimMultiFunctionAdapterClone () const
 clone More...
 
void SetCoord (int icoord)
 
void SetX (const double *x)
 set values More...
 
void SetX (double *x)
 set pointer without copying the values More...
 
template<class Iterator >
void SetX (Iterator begin, Iterator end)
 Set X values in case vector is own, iterator size must match previous set dimension. More...
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionOneDim
 IBaseFunctionOneDim ()
 
virtual ~IBaseFunctionOneDim ()
 virtual destructor More...
 
double operator() (const double *x) const
 Evaluate the function at a point x[]. More...
 
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. More...
 

Private Member Functions

double DoEval (double x) const
 evaluate function at the values x[] given in the constructor and as function of the coordinate fCoord. More...
 
OneDimMultiFunctionAdapteroperator= (const OneDimMultiFunctionAdapter &rhs)
 

Private Attributes

unsigned int fCoord
 
unsigned int fDim
 
MultiFuncType fFunc
 
bool fOwn
 
const doublefParams
 
doublefX
 

Additional Inherited Members

- Public Types inherited from ROOT::Math::IBaseFunctionOneDim
typedef IBaseFunctionOneDim BaseFunc
 

#include <Math/OneDimFunctionAdapter.h>

Inheritance diagram for ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >:
[legend]

Constructor & Destructor Documentation

◆ OneDimMultiFunctionAdapter() [1/3]

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::OneDimMultiFunctionAdapter ( MultiFuncType  f,
const double x,
unsigned int  icoord = 0,
const double p = 0 
)
inline

Constructor from the function object , pointer to an external array of x values and coordinate we want to adapt.

Definition at line 75 of file OneDimFunctionAdapter.h.

◆ OneDimMultiFunctionAdapter() [2/3]

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::OneDimMultiFunctionAdapter ( MultiFuncType  f,
unsigned int  dim = 1,
unsigned int  icoord = 0,
const double p = 0 
)
inline

Constructor from the function object , dimension of the function and and coordinate we want to adapt.

The coordinate cached vector is created inside and eventually the values must be passed later with the SetX which will copy them

Definition at line 91 of file OneDimFunctionAdapter.h.

◆ ~OneDimMultiFunctionAdapter()

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
virtual ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::~OneDimMultiFunctionAdapter ( )
inlinevirtual

Destructor (no operations)

Definition at line 105 of file OneDimFunctionAdapter.h.

◆ OneDimMultiFunctionAdapter() [3/3]

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::OneDimMultiFunctionAdapter ( const OneDimMultiFunctionAdapter< MultiFuncType > &  rhs)
inline

Definition at line 152 of file OneDimFunctionAdapter.h.

Member Function Documentation

◆ Clone()

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
virtual OneDimMultiFunctionAdapter* ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::Clone ( ) const
inlinevirtual

clone

Implements ROOT::Math::IBaseFunctionOneDim.

Definition at line 110 of file OneDimFunctionAdapter.h.

◆ DoEval()

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
double ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::DoEval ( double  x) const
inlineprivatevirtual

evaluate function at the values x[] given in the constructor and as function of the coordinate fCoord.

Implements ROOT::Math::IBaseFunctionOneDim.

Definition at line 179 of file OneDimFunctionAdapter.h.

◆ operator=()

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
OneDimMultiFunctionAdapter& ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::operator= ( const OneDimMultiFunctionAdapter< MultiFuncType > &  rhs)
inlineprivate

Definition at line 170 of file OneDimFunctionAdapter.h.

◆ SetCoord()

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
void ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::SetCoord ( int  icoord)
inline

Definition at line 149 of file OneDimFunctionAdapter.h.

◆ SetX() [1/3]

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
void ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::SetX ( const double x)
inline

set values

Definition at line 142 of file OneDimFunctionAdapter.h.

◆ SetX() [2/3]

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
void ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::SetX ( double x)
inline

set pointer without copying the values

Definition at line 135 of file OneDimFunctionAdapter.h.

◆ SetX() [3/3]

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
template<class Iterator >
void ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::SetX ( Iterator  begin,
Iterator  end 
)
inline

Set X values in case vector is own, iterator size must match previous set dimension.

Definition at line 127 of file OneDimFunctionAdapter.h.

Member Data Documentation

◆ fCoord

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
unsigned int ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::fCoord
private

Definition at line 203 of file OneDimFunctionAdapter.h.

◆ fDim

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
unsigned int ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::fDim
private

Definition at line 204 of file OneDimFunctionAdapter.h.

◆ fFunc

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
MultiFuncType ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::fFunc
private

Definition at line 200 of file OneDimFunctionAdapter.h.

◆ fOwn

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
bool ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::fOwn
private

Definition at line 205 of file OneDimFunctionAdapter.h.

◆ fParams

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
const double* ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::fParams
private

Definition at line 202 of file OneDimFunctionAdapter.h.

◆ fX

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
double* ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::fX
mutableprivate

Definition at line 201 of file OneDimFunctionAdapter.h.


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