Logo ROOT   master
Reference Guide
GeneticMinimizer.h
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id
2 
3 /**********************************************************************
4  * *
5  * Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *
6  * *
7  * *
8  **********************************************************************/
9 
10 // Header file for class GeneticMinimizer
11 
12 #ifndef ROOT_Math_GeneticMinimizer
13 #define ROOT_Math_GeneticMinimizer
14 
15 #include "Math/Minimizer.h"
16 
17 #include "RtypesCore.h"
18 
19 #include <vector>
20 
21 namespace TMVA {
22  class IFitterTarget;
23  class Interval;
24 }
25 
26 namespace ROOT {
27  namespace Math {
28 
29 
30 //_______________________________________________________________________________
31 /*
32  structure containing the parameters of the genetic minimizer
33  */
35 
44 
45 
46  // constructor with default value
48 };
49 
50 
51 
52 //_______________________________________________________________________________
53 /**
54  GeneticMinimizer
55 
56  Minimizer class based on the Gentic algorithm implemented in TMVA
57 
58  @ingroup MultiMin
59 */
61 
62 public:
63 
64  //GeneticMinimizer (int = 0);
65  GeneticMinimizer (int i = 0);
66  virtual ~GeneticMinimizer ();
67 
68  virtual void Clear();
70  virtual void SetFunction(const ROOT::Math::IMultiGenFunction & func);
71 
72  virtual bool SetLimitedVariable(unsigned int , const std::string& , double , double , double, double);
73  virtual bool SetVariable(unsigned int ivar, const std::string & name, double val, double step);
74  virtual bool SetFixedVariable(unsigned int ivar , const std::string & name , double val);
75 
76  virtual bool Minimize();
77  virtual double MinValue() const;
78  virtual double Edm() const;
79  virtual const double * X() const;
80  virtual const double * MinGradient() const;
81  virtual unsigned int NCalls() const;
82 
83  virtual unsigned int NDim() const;
84  virtual unsigned int NFree() const;
85 
86  virtual bool ProvidesError() const;
87  virtual const double * Errors() const;
88 
89  virtual double CovMatrix(unsigned int i, unsigned int j) const;
90 
91  void SetParameters(const GeneticMinimizerParameters & params );
92 
93  void SetRandomSeed(int seed) { fParameters.fSeed = seed; }
94 
96 
97  virtual ROOT::Math::MinimizerOptions Options() const;
98 
99  virtual void SetOptions(const ROOT::Math::MinimizerOptions & opt);
100 
101 protected:
102 
104 
105  std::vector<TMVA::Interval*> fRanges;
107  double fMinValue;
108  std::vector<double> fResult;
109 
111 
112 };
113 
114 
115  } // end namespace Math
116 } // end namespace ROOT
117 
118 #endif /* ROOT_Math_GeneticMinimizer */
virtual bool SetFixedVariable(unsigned int ivar, const std::string &name, double val)
set a new fixed variable (override if minimizer supports them )
void GetGeneticOptions(ROOT::Math::MinimizerOptions &opt) const
virtual unsigned int NFree() const
number of free variables (real dimension of the problem) this is <= Function().NDim() which is the to...
virtual bool Minimize()
method to perform the minimization
GeneticMinimizerParameters fParameters
Returns the available number of logical cores.
Definition: RNumpyDS.hxx:30
virtual bool SetVariable(unsigned int ivar, const std::string &name, double val, double step)
set a new free variable
virtual void SetOptions(const ROOT::Math::MinimizerOptions &opt)
virtual double MinValue() const
return minimum function value
virtual bool ProvidesError() const
minimizer provides error and error matrix
virtual double Edm() const
return expected distance reached from the minimum (re-implement if minimizer provides it ...
virtual unsigned int NDim() const
this is <= Function().NDim() which is the total number of variables (free+ constrained ones) ...
virtual void Clear()
reset for consecutive minimizations - implement if needed
Abstract Minimizer class, defining the interface for the various minimizer (like Minuit2, Minuit, GSL, etc..) Plug-in&#39;s exist in ROOT to be able to instantiate the derived classes like ROOT::Math::GSLMinimizer or ROOT::Math::Minuit2Minimizer via the plug-in manager.
Definition: Minimizer.h:78
std::vector< double > fResult
Documentation for the abstract class IBaseFunctionMultiDim.
Definition: IFunction.h:62
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)=0
set the function to minimize
virtual double CovMatrix(unsigned int i, unsigned int j) const
return covariance matrices element for variables ivar,jvar if the variable is fixed the return value ...
The TMVA::Interval Class.
Definition: Interval.h:61
TMVA::IFitterTarget * fFitness
void SetParameters(const GeneticMinimizerParameters &params)
std::vector< TMVA::Interval * > fRanges
const GeneticMinimizerParameters & MinimizerParameters() const
virtual const double * X() const
return pointer to X values at the minimum
double Double_t
Definition: RtypesCore.h:57
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)
set the function to minimize
virtual ROOT::Math::MinimizerOptions Options() const
retrieve the minimizer options (implement derived class if needed)
Namespace for new Math classes and functions.
create variable transformations
virtual const double * Errors() const
return errors at the minimum
virtual const double * MinGradient() const
return pointer to gradient values at the minimum
Interface for a fitter &#39;target&#39;.
Definition: IFitterTarget.h:44
virtual unsigned int NCalls() const
number of function calls to reach the minimum
char name[80]
Definition: TGX11.cxx:109
virtual bool SetLimitedVariable(unsigned int, const std::string &, double, double, double, double)
set a new upper/lower limited variable (override if minimizer supports them ) otherwise as default se...