30 for (
unsigned int i = 0; i < par.
Vec().
size(); i++) {
34 v(i) = dd * grad[ext];
40 MnPrint print(
"AnalyticalGradientCalculator");
41 print.
Debug(
"User given gradient in Minuit2",
v);
49 if (!this->
G2(par, g2)) {
50 print.
Error(
"Error computing G2");
76 assert(hmat.
size() ==
n *(
n+1)/2);
79 if (extHessian.empty()) {
80 MnPrint print(
"AnalyticalGradientCalculator::Hessian");
81 print.
Info(
"FCN cannot compute Hessian matrix");
84 unsigned int next = sqrt(extHessian.size());
86 for (
unsigned int i = 0; i <
n; i++) {
92 for (
unsigned int j = i; j <
n; j++) {
98 hmat(i, j) = dxdi * extHessian[i*next+ j] * dxdj;
107 assert(g2.
size() ==
n );
110 MnPrint print(
"AnalyticalGradientCalculator::G2");
111 print.
Info(
"FCN cannot compute the 2nd derivatives vector (G2)");
116 for (
unsigned int i = 0; i <
n; i++) {
120 g2(i) = dxdi * dxdi * extG2[iext];
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
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
virtual bool HasHessian() const
virtual std::vector< double > G2(std::vector< double > const &) const
return second derivatives (diagonal of the Hessian matrix)
virtual std::vector< double > Hessian(std::vector< double > const &) const
return Hessian
virtual std::vector< double > Gradient(std::vector< double > const &) const
virtual bool HasG2() const
Class describing a symmetric matrix of size n.
unsigned int size() const
unsigned int size() const
const MnAlgebraicVector & Vec() const
void Debug(const Ts &... args)
void Error(const Ts &... args)
void Info(const Ts &... args)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...