ROOT   Reference Guide
Searching...
No Matches
MinimumState.h
Go to the documentation of this file.
1// @(#)root/minuit2:$Id$
2// Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7 * *
8 **********************************************************************/
9
10#ifndef ROOT_Minuit2_MinimumState
11#define ROOT_Minuit2_MinimumState
12
14
15#include <memory>
16
17namespace ROOT {
18
19namespace Minuit2 {
20
21class MinimumParameters;
22class MinimumError;
24
25/** MinimumState keeps the information (position, Gradient, 2nd deriv, etc)
26 after one minimization step (usually in MinimumBuilder).
27 */
28
30
31public:
32 /** invalid state */
33 MinimumState(unsigned int n) : fData(std::make_shared<BasicMinimumState>(n, 0., 0., 0.)) {}
34 /** state without parameters and errors (only function value an, edm and nfcn) */
35 MinimumState(double fval, double edm, int nfcn) : fData(std::make_shared<BasicMinimumState>(0, fval, edm, nfcn)) {}
36 /** state with parameters only (from stepping methods like Simplex, Scan) */
37 MinimumState(const MinimumParameters &states, double edm, int nfcn)
38 : fData(std::make_shared<BasicMinimumState>(states, edm, nfcn))
39 {
40 }
41
44 MinimumState(const MinimumParameters &states, const MinimumError &err, const FunctionGradient &grad, double edm,
45 int nfcn)
46 : fData(std::make_shared<BasicMinimumState>(states, err, grad, edm, nfcn))
47 {
48 }
49
50 const MinimumParameters &Parameters() const { return fData->Parameters(); }
51 const MnAlgebraicVector &Vec() const { return fData->Vec(); }
52 int size() const { return fData->size(); }
53
54 const MinimumError &Error() const { return fData->Error(); }
56 double Fval() const { return fData->Fval(); }
57 double Edm() const { return fData->Edm(); }
58 int NFcn() const { return fData->NFcn(); }
59
60 bool IsValid() const { return fData->IsValid(); }
61
62 bool HasParameters() const { return fData->HasParameters(); }
63 bool HasCovariance() const { return fData->HasCovariance(); }
64
65private:
66 std::shared_ptr<BasicMinimumState> fData;
67};
68
69} // namespace Minuit2
70
71} // namespace ROOT
72
73#endif // ROOT_Minuit2_MinimumState
MinimumError keeps the inv.
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
std::shared_ptr< BasicMinimumState > fData
MinimumState(const MinimumParameters &states, const MinimumError &err, const FunctionGradient &grad, double edm, int nfcn)