54 const std::vector<double> &fcn_gradient =
fFcn.
Gradient();
55 assert(fcn_gradient.size() == extParam.size());
58 std::vector<double> deriv(nvar);
59 std::vector<unsigned int> extIndex(nvar);
60 for (
int i = 0; i < nvar; ++i) {
66 v(i) = fcn_gradient[extIndex[i]] * deriv[i];
68 for (
int j = 0; j <= i; ++j) {
69 h(i, j) = deriv[i] * deriv[j] *
fFcn.
Hessian(extIndex[i], extIndex[j]);
73 MnPrint print(
"FumiliGradientCalculator");
74 print.
Debug([&](std::ostream &os) {
79 os <<
"Fumili Gradient:" <<
v <<
"\nMinuit Gradient" << grd2.
Vec();
80 os <<
"\nFumili Hessian: " <<
h << std::endl;
81 os <<
"Numerical g2 " << grd2.
G2() << std::endl;
107 for (
unsigned int i = 0; i <
n ; i++) {
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
const MnUserTransformation & fTransformation
Extension of the FCNBase for the Fumili method.
virtual void EvaluateAll(const std::vector< double > &par)=0
Evaluate function Value, Gradient and Hessian using Fumili approximation, for values of parameters p ...
std::vector< double > Hessian(const std::vector< double > &) const override
Return Value of the i-th j-th element of the Hessian matrix estimated previously using the FumiliFCNB...
virtual const std::vector< double > & Gradient() const
Return cached Value of function Gradient estimated previously using the FumiliFCNBase::EvaluateAll me...
bool G2(const MinimumParameters &, MnAlgebraicVector &) const override
compute second derivatives (diagonal of Hessian)
MnAlgebraicSymMatrix fHessian
FumiliGradientCalculator(const FumiliFCNBase &fcn, const MnUserTransformation &trafo, int n)
FunctionGradient operator()(const MinimumParameters &) const override
bool Hessian(const MinimumParameters &, MnAlgebraicSymMatrix &) const override
compute Hessian matrix
const FumiliFCNBase & fFcn
const MnAlgebraicVector & Vec() const
const MnAlgebraicVector & G2() const
Class describing a symmetric matrix of size n.
unsigned int Nrow() const
unsigned int size() const
const MnAlgebraicVector & Vec() const
void Debug(const Ts &... args)
static int SetGlobalLevel(int level)
API class for defining four levels of strategies: low (0), medium (1), high (2), very high (>=3); act...
Wrapper used by Minuit of FCN interface containing a reference to the transformation object.
class performing the numerical gradient calculation
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.