Logo ROOT  
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:
38 
40  {
41  if (type == kBFGS)
42  fErrorUpdator = std::unique_ptr<MinimumErrorUpdator>(new BFGSErrorUpdator());
43  else
44  fErrorUpdator = std::unique_ptr<MinimumErrorUpdator>(new DavidonErrorUpdator());
45  }
46 
48 
49  virtual FunctionMinimum Minimum(const MnFcn &, const GradientCalculator &, const MinimumSeed &, const MnStrategy &,
50  unsigned int, double) const;
51 
52  FunctionMinimum Minimum(const MnFcn &, const GradientCalculator &, const MinimumSeed &, std::vector<MinimumState> &,
53  unsigned int, double) const;
54 
55  const VariableMetricEDMEstimator &Estimator() const { return fEstimator; }
56  const MinimumErrorUpdator &ErrorUpdator() const { return *fErrorUpdator; }
57 
58  void AddResult(std::vector<MinimumState> &result, const MinimumState &state) const;
59 
60 private:
62  std::shared_ptr<MinimumErrorUpdator> fErrorUpdator;
63 };
64 
65 } // namespace Minuit2
66 
67 } // namespace ROOT
68 
69 #endif // ROOT_Minuit2_VariableMetricBuilder
ROOT::Minuit2::MnFcn
Wrapper class to FCNBase interface used internally by Minuit.
Definition: MnFcn.h:30
ROOT::Minuit2::DavidonErrorUpdator
Update of the covariance matrix for the Variable Metric minimizer (MIGRAD)
Definition: DavidonErrorUpdator.h:22
ROOT::Minuit2::VariableMetricBuilder::kBFGS
@ kBFGS
Definition: VariableMetricBuilder.h:37
ROOT::Minuit2::VariableMetricBuilder::Estimator
const VariableMetricEDMEstimator & Estimator() const
Definition: VariableMetricBuilder.h:55
VariableMetricEDMEstimator.h
ROOT::Minuit2::MinimumState
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Definition: MinimumState.h:29
BFGSErrorUpdator.h
ROOT::Minuit2::VariableMetricEDMEstimator
Definition: VariableMetricEDMEstimator.h:20
ROOT::Minuit2::VariableMetricBuilder::ErrorUpdatorType
ErrorUpdatorType
Definition: VariableMetricBuilder.h:37
ROOT::Minuit2::VariableMetricBuilder::fErrorUpdator
std::shared_ptr< MinimumErrorUpdator > fErrorUpdator
Definition: VariableMetricBuilder.h:62
ROOT::Minuit2::VariableMetricBuilder
Build (find) function minimum using the Variable Metric method (MIGRAD) Two possible error updators c...
Definition: VariableMetricBuilder.h:34
ROOT::Minuit2::VariableMetricBuilder::Minimum
virtual FunctionMinimum Minimum(const MnFcn &, const GradientCalculator &, const MinimumSeed &, const MnStrategy &, unsigned int, double) const
Definition: VariableMetricBuilder.cxx:54
ROOT::Minuit2::BFGSErrorUpdator
Update of the covariance matrix for the Variable Metric minimizer (MIGRAD)
Definition: BFGSErrorUpdator.h:22
ROOT::Minuit2::VariableMetricBuilder::fEstimator
VariableMetricEDMEstimator fEstimator
Definition: VariableMetricBuilder.h:61
ROOT::Minuit2::MinimumErrorUpdator
Definition: MinimumErrorUpdator.h:22
ROOT::Minuit2::VariableMetricBuilder::~VariableMetricBuilder
~VariableMetricBuilder()
Definition: VariableMetricBuilder.h:47
ROOT::Minuit2::VariableMetricBuilder::VariableMetricBuilder
VariableMetricBuilder(ErrorUpdatorType type=kDavidon)
Definition: VariableMetricBuilder.h:39
ROOT::Minuit2::FunctionMinimum
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
Definition: FunctionMinimum.h:33
ROOT::Minuit2::VariableMetricBuilder::kDavidon
@ kDavidon
Definition: VariableMetricBuilder.h:37
ROOT::Minuit2::MnStrategy
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
Definition: MnStrategy.h:27
MinimumBuilder.h
ROOT::Minuit2::VariableMetricBuilder::ErrorUpdator
const MinimumErrorUpdator & ErrorUpdator() const
Definition: VariableMetricBuilder.h:56
type
int type
Definition: TGX11.cxx:121
DavidonErrorUpdator.h
ROOT::Minuit2::GradientCalculator
interface class for gradient calculators
Definition: GradientCalculator.h:23
ROOT::Minuit2::VariableMetricBuilder::AddResult
void AddResult(std::vector< MinimumState > &result, const MinimumState &state) const
Definition: VariableMetricBuilder.cxx:37
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4
ROOT::Minuit2::MinimumBuilder
Definition: MinimumBuilder.h:27
ROOT::Minuit2::MinimumSeed
MinimumSeed contains the starting values for the minimization produced by the SeedGenerator.
Definition: MinimumSeed.h:31
MnConfig.h