BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
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 39 of file MinimTransformFunction.h.
Public Types | |
typedef T | BackendType |
typedef ROOT::Math::IMultiGradFunction::BaseFunc | BaseFunc |
typedef IGradientMultiDimTempl< T > | BaseGrad |
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) | |
~MinimTransformFunction () | |
IMultiGenFunction * | Clone () const |
clone: not supported (since unique_ptr used in the fVariables) More... | |
T | Derivative (const T *x, unsigned int icoord=0) const |
virtual void | FdF (const T *x, T &f, T *df) const |
virtual void | Gradient (const T *x, T *grad) const |
void | GradientTransformation (const double *x, const double *gExt, double *gInt) const |
transform gradient vector (external -> internal) at internal point x More... | |
void | InvStepTransformation (const double *x, const double *sext, double *sint) const |
inverse transformation for steps (external -> internal) at external point x More... | |
void | InvTransformation (const double *xext, double *xint) const |
inverse transformation (external -> internal) More... | |
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] More... | |
unsigned int | NDim () const |
virtual unsigned int | NDim () const=0 |
unsigned int | NTot () const |
T | operator() (const T *x) const |
const IMultiGradFunction * | OriginalFunction () const |
const double * | Transformation (const double *x) const |
transform from internal to external result is cached also inside the class More... | |
void | Transformation (const double *xint, double *xext) const |
transform from internal to external More... | |
Private Member Functions | |
MinimTransformFunction (const MinimTransformFunction &) | |
virtual double | DoDerivative (const double *x, unsigned int icoord) const |
calculate derivatives More... | |
virtual double | DoEval (const double *x) const |
function evaluation More... | |
MinimTransformFunction & | operator= (const MinimTransformFunction &) |
Private Attributes | |
const IMultiGradFunction * | fFunc |
std::vector< unsigned int > | fIndex |
std::vector< MinimTransformVariable > | fVariables |
std::vector< double > | fX |
|
inherited |
Definition at line 66 of file IFunction.h.
Definition at line 44 of file MinimTransformFunction.h.
|
inherited |
Definition at line 331 of file IFunction.h.
Definition at line 43 of file MinimTransformFunction.h.
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 (which is managed by the class) 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)
|
inline |
Destructor (delete function pointer)
Definition at line 60 of file MinimTransformFunction.h.
References fFunc.
|
inlineprivate |
Definition at line 128 of file MinimTransformFunction.h.
|
inlinevirtual |
clone: not supported (since unique_ptr used in the fVariables)
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 72 of file MinimTransformFunction.h.
|
inlineinherited |
Return the partial derivative with respect to the passed coordinate
Definition at line 217 of file IFunction.h.
References ROOT::Math::IGradientMultiDimTempl< T >::DoDerivative().
Referenced by DoDerivative(), and ROOT::Math::IGradientFunctionMultiDimTempl< T >::Gradient().
|
inlineprivatevirtual |
calculate derivatives
Definition at line 119 of file MinimTransformFunction.h.
References ROOT::Math::IGradientMultiDimTempl< T >::Derivative(), ROOT::Math::MinimTransformVariable::DerivativeIntToExt(), fFunc, fIndex, fVariables, ROOT::Math::MinimTransformVariable::IsLimited(), and Transformation().
|
inlineprivatevirtual |
function evaluation
Definition at line 108 of file MinimTransformFunction.h.
References fFunc, fVariables, and Transformation().
|
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
Implements ROOT::Math::IGradientMultiDimTempl< T >.
Definition at line 357 of file IFunction.h.
References ROOT::Math::IGradientFunctionMultiDimTempl< T >::Gradient(), and ROOT::Math::IBaseFunctionMultiDimTempl< T >::operator()().
|
inlinevirtualinherited |
Evaluate all the vector of function derivatives (gradient) at a point x. Derived classes must re-implement it if more efficient than evaluting one at a time
Implements ROOT::Math::IGradientMultiDimTempl< T >.
Definition at line 342 of file IFunction.h.
References ROOT::Math::IGradientMultiDimTempl< T >::Derivative(), and ROOT::Math::IGradientFunctionMultiDimTempl< T >::NDim().
Referenced by ROOT::Math::IGradientFunctionMultiDimTempl< T >::FdF().
void ROOT::Math::MinimTransformFunction::GradientTransformation | ( | const double * | x, |
const double * | gExt, | ||
double * | gInt | ||
) | const |
transform gradient vector (external -> internal) at internal point x
void ROOT::Math::MinimTransformFunction::InvStepTransformation | ( | const double * | x, |
const double * | sext, | ||
double * | sint | ||
) | const |
inverse transformation for steps (external -> internal) at external point x
void ROOT::Math::MinimTransformFunction::InvTransformation | ( | const double * | xext, |
double * | xint | ||
) | const |
inverse transformation (external -> internal)
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]
|
inlinevirtual |
Retrieve the dimension of the function
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 67 of file MinimTransformFunction.h.
References fIndex.
|
inherited |
Retrieve the dimension of the function
Referenced by ROOT::Math::IGradientFunctionMultiDimTempl< T >::Gradient(), NTot(), and ROOT::Math::GSLMultiMinimizer::Set().
|
inline |
Definition at line 69 of file MinimTransformFunction.h.
References fFunc, and ROOT::Math::IGradientFunctionMultiDimTempl< T >::NDim().
|
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 92 of file IFunction.h.
References ROOT::Math::IBaseFunctionMultiDimTempl< T >::DoEval().
Referenced by ROOT::Math::IGradientFunctionMultiDimTempl< T >::FdF().
|
inlineprivate |
Definition at line 133 of file MinimTransformFunction.h.
|
inline |
|
inline |
transform from internal to external result is cached also inside the class
Definition at line 79 of file MinimTransformFunction.h.
References fX.
Referenced by DoDerivative(), and DoEval().
void ROOT::Math::MinimTransformFunction::Transformation | ( | const double * | xint, |
double * | xext | ||
) | const |
transform from internal to external
|
private |
Definition at line 144 of file MinimTransformFunction.h.
Referenced by ~MinimTransformFunction(), DoDerivative(), DoEval(), NTot(), and OriginalFunction().
|
private |
Definition at line 143 of file MinimTransformFunction.h.
Referenced by DoDerivative(), and NDim().
|
private |
Definition at line 142 of file MinimTransformFunction.h.
Referenced by DoDerivative(), and DoEval().
|
mutableprivate |
Definition at line 141 of file MinimTransformFunction.h.
Referenced by Transformation().