Logo ROOT   6.14/05
Reference Guide
VariableMetricBuilder.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_VariableMetricBuilder
11 #define ROOT_Minuit2_VariableMetricBuilder
12 
13 #include "Minuit2/MnConfig.h"
14 #include "Minuit2/MinimumBuilder.h"
18 
19 #include <vector>
20 #include <memory>
21 
22 namespace ROOT {
23 
24  namespace Minuit2 {
25 
26 /**
27  Build (find) function minimum using the Variable Metric method (MIGRAD)
28  Two possible error updators can be choosen
29  - Davidon : this is the standard formula used in Migrad
30  - BFGS this is the new formula based on BFGS algorithm
31  (see Broyden–Fletcher–Goldfarb–Shanno algorithm
32  https://en.wikipedia.org/wiki/Broyden–Fletcher–Goldfarb–Shanno_algorithm )
33  */
35 
36 public:
37 
39 
42  {
43  if (type == kBFGS) fErrorUpdator = std::unique_ptr<MinimumErrorUpdator>(new BFGSErrorUpdator());
44  else fErrorUpdator = std::unique_ptr<MinimumErrorUpdator>(new DavidonErrorUpdator());
45  }
46 
48 
49  virtual FunctionMinimum Minimum(const MnFcn&, const GradientCalculator&, const MinimumSeed&, const MnStrategy&, unsigned int, double) const;
50 
51  FunctionMinimum Minimum(const MnFcn&, const GradientCalculator&, const MinimumSeed&, std::vector<MinimumState> &, unsigned int, double) const;
52 
55 
56  void AddResult(std::vector<MinimumState>& result, const MinimumState & state) const;
57 
58 private:
59 
61  std::shared_ptr<MinimumErrorUpdator> fErrorUpdator;
62 };
63 
64  } // namespace Minuit2
65 
66 } // namespace ROOT
67 
68 #endif // ROOT_Minuit2_VariableMetricBuilder
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
MinimumSeed contains the starting values for the minimization produced by the SeedGenerator.
Definition: MinimumSeed.h:31
Build (find) function minimum using the Variable Metric method (MIGRAD) Two possible error updators c...
Update of the covariance matrix for the Variable Metric minimizer (MIGRAD)
virtual FunctionMinimum Minimum(const MnFcn &, const GradientCalculator &, const MinimumSeed &, const MnStrategy &, unsigned int, double) const
std::shared_ptr< MinimumErrorUpdator > fErrorUpdator
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
Wrapper class to FCNBase interface used internally by Minuit.
Definition: MnFcn.h:33
Update of the covariance matrix for the Variable Metric minimizer (MIGRAD)
const MinimumErrorUpdator & ErrorUpdator() const
void AddResult(std::vector< MinimumState > &result, const MinimumState &state) const
VariableMetricBuilder(ErrorUpdatorType type=kDavidon)
int type
Definition: TGX11.cxx:120
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Definition: MinimumState.h:29
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
Definition: MnStrategy.h:27
const VariableMetricEDMEstimator & Estimator() const
interface class for gradient calculators