23 std::vector<double>
result;
25 unsigned int fPositionsSize =
fPositions.size();
27 for (
unsigned int i = 0; i < fPositionsSize; i++) {
29 const std::vector<double> ¤tPosition =
fPositions[i];
63 std::vector<double> &grad =
Gradient();
65 int npar = par.size();
68 h.resize(
static_cast<unsigned int>(0.5 * npar * (npar + 1)));
70 grad.assign(npar, 0.0);
71 h.assign(
static_cast<unsigned int>(0.5 * npar * (npar + 1)), 0.0);
75 for (
int i = 0; i < nmeas; ++i) {
78 const std::vector<double> ¤tPosition =
fPositions[i];
81 double fval = modelFunc(par);
84 chi2 += element * element;
89 std::vector<double> mfg = modelFunc.
GetGradient(par);
92 for (
int j = 0; j < npar; ++j) {
93 double dfj = invError * mfg[j];
94 grad[j] += 2.0 * element * dfj;
98 for (
int k = j; k < npar; ++k) {
99 int idx = j + k * (k + 1) / 2;
100 h[idx] += 2.0 * dfj * invError * mfg[k];
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
const ParametricFunction * ModelFunction() const
Returns the model function used for the data.
std::vector< double > & Hessian()
virtual const std::vector< double > & Gradient() const
Return cached Value of function Gradient estimated previously using the FumiliFCNBase::EvaluateAll me...
void SetFCNValue(double value)
const std::vector< double > & GetMeasurement(int Index) const override
Accessor to the position of the measurement (x coordinate).
std::vector< double > fInvErrors
int GetNumberOfMeasurements() const override
Accessor to the number of measurements used for calculating the chi-square.
std::vector< std::vector< double > > fPositions
std::vector< double > fMeasurements
std::vector< double > Elements(const std::vector< double > &par) const override
Evaluates the model function for the different measurement points and the Parameter values supplied,...
void EvaluateAll(const std::vector< double > &par) override
Evaluate function Value, Gradient and Hessian using Fumili approximation, for values of parameters p ...
Function which has parameters.
virtual void SetParameters(const std::vector< double > ¶ms) const
Sets the parameters of the ParametricFunction.
virtual std::vector< double > GetGradient(const std::vector< double > &x) const
Member function returning the Gradient of the function with respect to its variables (but without inc...
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.