Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
ROOT::Math::MinimTransformFunction Class Reference

MinimTransformFunction class to perform a transformations on the variables to deal with fixed or limited variables (support both double and single bounds) The class manages the passed function pointer.

Definition at line 41 of file MinimTransformFunction.h.

Public Types

typedef double BackendType
typedef ROOT::Math::IMultiGradFunction::BaseFunc BaseFunc
typedef ROOT::Math::IMultiGradFunction BaseGradFunc

Public Member Functions

 MinimTransformFunction (const IMultiGradFunction *f, const std::vector< ROOT::Math::EMinimVariableType > &types, const std::vector< double > &values, const std::map< unsigned int, std::pair< double, double > > &bounds)
 Constructor from a IMultiGradFunction interface that is externally managed vector specifying the variable types (free, bounded or fixed, defined in enum EMinimVariableTypes ) variable values (used for the fixed ones) and a map with the bounds (for the bounded variables).
 ~MinimTransformFunction () override
 Destructor (no operation).
IMultiGenFunctionClone () const override
 clone: not supported (since unique_ptr used in the fVariables)
double Derivative (const double *x, unsigned int icoord, double *previous_grad, double *previous_g2, double *previous_gstep) const
 In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.
double Derivative (const double *x, unsigned int icoord=0) const
 Return the partial derivative with respect to the passed coordinate.
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.
virtual void Gradient (const double *x, double *grad) const
 Evaluate all the vector of function derivatives (gradient) at a point x.
void GradientTransformation (const double *x, const double *gExt, double *gInt) const
 transform gradient vector (external -> internal) at internal point x
bool HasGradient () const override
void InvStepTransformation (const double *x, const double *sext, double *sint) const
 inverse transformation for steps (external -> internal) at external point x
void InvTransformation (const double *xext, double *xint) const
 inverse transformation (external -> internal)
void MatrixTransformation (const double *x, const double *covInt, double *covExt) const
 transform covariance matrix (internal -> external) at internal point x use row storages for matrices m(i,j) = rep[ i * dim + j]
unsigned int NDim () const override
 Retrieve the dimension of the function.
unsigned int NTot () const
double operator() (const double *x) const
 Evaluate the function at a point x[].
const IMultiGradFunctionOriginalFunction () const
const doubleTransformation (const double *x) const
 transform from internal to external result is cached also inside the class
void Transformation (const double *xint, double *xext) const
 transform from internal to external

Private Member Functions

 MinimTransformFunction (const MinimTransformFunction &)
double DoDerivative (const double *x, unsigned int icoord) const override
 calculate derivatives
virtual double DoDerivativeWithPrevResult (const double *x, unsigned int icoord, double *, double *, double *) const
 In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.
double DoEval (const double *x) const override
 function evaluation
MinimTransformFunctionoperator= (const MinimTransformFunction &)

Private Attributes

const IMultiGradFunctionfFunc
 user function
std::vector< unsigned intfIndex
 vector with external indices for internal variables
std::vector< MinimTransformVariablefVariables
 vector of variable settings and transformation function
std::vector< doublefX
 internal cached of external values

#include <Math/MinimTransformFunction.h>

Inheritance diagram for ROOT::Math::MinimTransformFunction:
ROOT::Math::IGradientFunctionMultiDimTempl< double > ROOT::Math::IBaseFunctionMultiDimTempl< double >

Member Typedef Documentation

◆ BackendType

typedef double ROOT::Math::IBaseFunctionMultiDimTempl< double >::BackendType
inherited

Definition at line 67 of file IFunction.h.

◆ BaseFunc

◆ BaseGradFunc

Constructor & Destructor Documentation

◆ MinimTransformFunction() [1/2]

ROOT::Math::MinimTransformFunction::MinimTransformFunction ( const IMultiGradFunction * f,
const std::vector< ROOT::Math::EMinimVariableType > & types,
const std::vector< double > & values,
const std::map< unsigned int, std::pair< double, double > > & bounds )

Constructor from a IMultiGradFunction interface that is externally managed vector specifying the variable types (free, bounded or fixed, defined in enum EMinimVariableTypes ) variable values (used for the fixed ones) and a map with the bounds (for the bounded variables).

Definition at line 24 of file MinimTransformFunction.cxx.

◆ ~MinimTransformFunction()

ROOT::Math::MinimTransformFunction::~MinimTransformFunction ( )
inlineoverride

Destructor (no operation).

Definition at line 62 of file MinimTransformFunction.h.

◆ MinimTransformFunction() [2/2]

ROOT::Math::MinimTransformFunction::MinimTransformFunction ( const MinimTransformFunction & )
inlineprivate

Definition at line 127 of file MinimTransformFunction.h.

Member Function Documentation

◆ Clone()

IMultiGenFunction * ROOT::Math::MinimTransformFunction::Clone ( ) const
inlineoverridevirtual

clone: not supported (since unique_ptr used in the fVariables)

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

Definition at line 71 of file MinimTransformFunction.h.

◆ Derivative() [1/2]

double ROOT::Math::IBaseFunctionMultiDimTempl< double >::Derivative ( const double * x,
unsigned int icoord,
double * previous_grad,
double * previous_g2,
double * previous_gstep ) const
inlineinherited

In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.

The previous_* arrays can also be used to return second derivative and step size so that these can be passed forward again as well at the call site, if necessary.

Definition at line 120 of file IFunction.h.

◆ Derivative() [2/2]

double ROOT::Math::IBaseFunctionMultiDimTempl< double >::Derivative ( const double * x,
unsigned int icoord = 0 ) const
inlineinherited

Return the partial derivative with respect to the passed coordinate.

Definition at line 115 of file IFunction.h.

◆ DoDerivative()

double ROOT::Math::MinimTransformFunction::DoDerivative ( const double * x,
unsigned int icoord ) const
inlineoverrideprivatevirtual

calculate derivatives

Reimplemented from ROOT::Math::IBaseFunctionMultiDimTempl< double >.

Definition at line 118 of file MinimTransformFunction.h.

◆ DoDerivativeWithPrevResult()

virtual double ROOT::Math::IBaseFunctionMultiDimTempl< double >::DoDerivativeWithPrevResult ( const double * x,
unsigned int icoord,
double * ,
double * ,
double *  ) const
inlineprivatevirtualinherited

In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.

The previous_* arrays can also be used to return second derivative and step size so that these can be passed forward again as well at the call site, if necessary.

Definition at line 136 of file IFunction.h.

◆ DoEval()

double ROOT::Math::MinimTransformFunction::DoEval ( const double * x) const
inlineoverrideprivatevirtual

function evaluation

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

Definition at line 107 of file MinimTransformFunction.h.

◆ FdF()

virtual void ROOT::Math::IBaseFunctionMultiDimTempl< double >::FdF ( const double * x,
double & f,
double * df ) const
inlinevirtualinherited

Optimized method to evaluate at the same time the function value and derivative at a point x.

Often both value and derivatives are needed and it is often more efficient to compute them at the same time. Derived class should implement this method if performances play an important role and if it is faster to evaluate value and derivative at the same time

Definition at line 108 of file IFunction.h.

◆ Gradient()

virtual void ROOT::Math::IBaseFunctionMultiDimTempl< double >::Gradient ( const double * x,
double * grad ) const
inlinevirtualinherited

Evaluate all the vector of function derivatives (gradient) at a point x.

Derived classes must re-implement it if more efficient than evaluating one at a time

Definition at line 96 of file IFunction.h.

◆ GradientTransformation()

void ROOT::Math::MinimTransformFunction::GradientTransformation ( const double * x,
const double * gExt,
double * gInt ) const

transform gradient vector (external -> internal) at internal point x

Definition at line 121 of file MinimTransformFunction.cxx.

◆ HasGradient()

bool ROOT::Math::IGradientFunctionMultiDimTempl< double >::HasGradient ( ) const
inlineoverridevirtualinherited

Reimplemented from ROOT::Math::IBaseFunctionMultiDimTempl< double >.

Definition at line 243 of file IFunction.h.

◆ InvStepTransformation()

void ROOT::Math::MinimTransformFunction::InvStepTransformation ( const double * x,
const double * sext,
double * sint ) const

inverse transformation for steps (external -> internal) at external point x

Definition at line 100 of file MinimTransformFunction.cxx.

◆ InvTransformation()

void ROOT::Math::MinimTransformFunction::InvTransformation ( const double * xext,
double * xint ) const

inverse transformation (external -> internal)

Definition at line 87 of file MinimTransformFunction.cxx.

◆ MatrixTransformation()

void ROOT::Math::MinimTransformFunction::MatrixTransformation ( const double * x,
const double * covInt,
double * covExt ) const

transform covariance matrix (internal -> external) at internal point x use row storages for matrices m(i,j) = rep[ i * dim + j]

Definition at line 136 of file MinimTransformFunction.cxx.

◆ NDim()

unsigned int ROOT::Math::MinimTransformFunction::NDim ( ) const
inlineoverridevirtual

Retrieve the dimension of the function.

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

Definition at line 66 of file MinimTransformFunction.h.

◆ NTot()

unsigned int ROOT::Math::MinimTransformFunction::NTot ( ) const
inline

Definition at line 68 of file MinimTransformFunction.h.

◆ operator()()

double ROOT::Math::IBaseFunctionMultiDimTempl< double >::operator() ( const double * x) const
inlineinherited

Evaluate the function at a point x[].

Use the pure virtual private method DoEval which must be implemented by the sub-classes.

Definition at line 81 of file IFunction.h.

◆ operator=()

MinimTransformFunction & ROOT::Math::MinimTransformFunction::operator= ( const MinimTransformFunction & )
inlineprivate

Definition at line 132 of file MinimTransformFunction.h.

◆ OriginalFunction()

const IMultiGradFunction * ROOT::Math::MinimTransformFunction::OriginalFunction ( ) const
inline

Definition at line 101 of file MinimTransformFunction.h.

◆ Transformation() [1/2]

const double * ROOT::Math::MinimTransformFunction::Transformation ( const double * x) const
inline

transform from internal to external result is cached also inside the class

Definition at line 78 of file MinimTransformFunction.h.

◆ Transformation() [2/2]

void ROOT::Math::MinimTransformFunction::Transformation ( const double * xint,
double * xext ) const

transform from internal to external

Definition at line 63 of file MinimTransformFunction.cxx.

Member Data Documentation

◆ fFunc

const IMultiGradFunction* ROOT::Math::MinimTransformFunction::fFunc
private

user function

Definition at line 143 of file MinimTransformFunction.h.

◆ fIndex

std::vector<unsigned int> ROOT::Math::MinimTransformFunction::fIndex
private

vector with external indices for internal variables

Definition at line 142 of file MinimTransformFunction.h.

◆ fVariables

std::vector<MinimTransformVariable> ROOT::Math::MinimTransformFunction::fVariables
private

vector of variable settings and transformation function

Definition at line 141 of file MinimTransformFunction.h.

◆ fX

std::vector<double> ROOT::Math::MinimTransformFunction::fX
mutableprivate

internal cached of external values

Definition at line 140 of file MinimTransformFunction.h.


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