31 for (
unsigned int i = 0; i < par.
Vec().
size(); i++) {
34 v(i) = dd * grad[
ext];
37 MnPrint print(
"AnalyticalGradientCalculator");
38 print.
Debug(
"User given gradient in Minuit2",
v);
46 if (!this->
G2(par,
g2)) {
47 print.
Error(
"Error computing G2");
72 unsigned int n = par.
Vec().size();
77 MnPrint print(
"AnalyticalGradientCalculator::Hessian");
78 print.
Info(
"FCN cannot compute Hessian matrix");
83 for (
unsigned int i = 0; i <
n; i++) {
86 for (
unsigned int j = i;
j <
n;
j++) {
98 const unsigned int n = par.
Vec().size();
101 MnPrint print(
"AnalyticalGradientCalculator::G2");
107 print.
Info(
"FCN cannot compute the 2nd derivatives vector (G2)");
111 for (
unsigned int i = 0; i <
n; i++) {
121 print.
Info(
"FCN cannot compute the 2nd derivatives vector (G2) or the Hessian");
127 print.
Info(
"FCN cannot compute Hessian matrix (needed to derive G2)");
132 const unsigned int nExt =
static_cast<unsigned int>(std::lround(std::sqrt(
static_cast<double>(
extHessian.size()))));
134 print.
Error(
"Unexpected Hessian size; cannot derive G2 from Hessian diagonal");
140 for (
unsigned int i = 0; i <
n; i++) {
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
virtual bool CanComputeG2() const
bool G2(const MinimumParameters &, MnAlgebraicVector &) const override
compute second derivatives (diagonal of Hessian)
virtual bool CanComputeHessian() const
const MnUserTransformation & fTransformation
const FCNBase & fGradFunc
FunctionGradient operator()(const MinimumParameters &) const override
bool Hessian(const MinimumParameters &, MnAlgebraicSymMatrix &) const override
compute Hessian matrix
Class describing a symmetric matrix of size n.
const MnAlgebraicVector & Vec() const
void Debug(const Ts &... args)
void Error(const Ts &... args)
void Info(const Ts &... args)