ROOT  6.06/09
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 <vector>
16 
17 #include "Math/Minimizer.h"
18 
19 #include "TMVA/IFitterTarget.h"
20 #include "TMVA/Interval.h"
21 
22 namespace ROOT {
23  namespace Math {
24 
25 
26 //_______________________________________________________________________________
27 /*
28  structure containing the parameters of the genetic minimizer
29  */
31 
40 
41 
42  // constructor with default value
44 };
45 
46 
47 
48 //_______________________________________________________________________________
49 /**
50  GeneticMinimizer
51 
52  Minimizer class based on the Gentic algorithm implemented in TMVA
53 
54  @ingroup MultiMin
55 */
57 
58 public:
59 
60  //GeneticMinimizer (int = 0);
61  GeneticMinimizer (int i = 0);
62  virtual ~GeneticMinimizer ();
63 
64  virtual void Clear();
66  virtual void SetFunction(const ROOT::Math::IMultiGenFunction & func);
67 
68  virtual bool SetLimitedVariable(unsigned int , const std::string& , double , double , double, double);
69  virtual bool SetVariable(unsigned int ivar, const std::string & name, double val, double step);
70  virtual bool SetFixedVariable(unsigned int ivar , const std::string & name , double val);
71 
72  virtual bool Minimize();
73  virtual double MinValue() const;
74  virtual double Edm() const;
75  virtual const double * X() const;
76  virtual const double * MinGradient() const;
77  virtual unsigned int NCalls() const;
78 
79  virtual unsigned int NDim() const;
80  virtual unsigned int NFree() const;
81 
82  virtual bool ProvidesError() const;
83  virtual const double * Errors() const;
84 
85  virtual double CovMatrix(unsigned int i, unsigned int j) const;
86 
87  void SetParameters(const GeneticMinimizerParameters & params );
88 
89  void SetRandomSeed(int seed) { fParameters.fSeed = seed; }
90 
92 
93  virtual ROOT::Math::MinimizerOptions Options() const;
94 
95  virtual void SetOptions(const ROOT::Math::MinimizerOptions & opt);
96 
97 protected:
98 
100 
101  std::vector<TMVA::Interval*> fRanges;
103  double fMinValue;
104  std::vector<double> fResult;
105 
107 
108 };
109 
110 
111  } // end namespace Math
112 } // end namespace ROOT
113 
114 #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 )
virtual ROOT::Math::MinimizerOptions Options() const
retrieve the minimizer options (implement derived class if needed)
virtual bool Minimize()
method to perform the minimization
GeneticMinimizerParameters fParameters
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
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)
void GetGeneticOptions(ROOT::Math::MinimizerOptions &opt) const
int Int_t
Definition: RtypesCore.h:41
virtual void Clear()
reset for consecutive minimizations - implement if needed
virtual double Edm() const
return expected distance reached from the minimum (re-implement if minimizer provides it ...
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 ...
Abstract Minimizer class, defining the interface for the various minimizer (like Minuit2, Minuit, GSL, etc..) Plug-in'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:86
std::vector< double > fResult
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)=0
set the function to minimize
virtual unsigned int NDim() const
this is <= Function().NDim() which is the total number of variables (free+ constrained ones) ...
TMVA::IFitterTarget * fFitness
void SetParameters(const GeneticMinimizerParameters &params)
virtual bool ProvidesError() const
minimizer provides error and error matrix
std::vector< TMVA::Interval * > fRanges
virtual const double * X() const
return pointer to X values at the minimum
double Double_t
Definition: RtypesCore.h:55
double func(double *x, double *p)
Definition: stressTF1.cxx:213
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)
set the function to minimize
virtual const double * Errors() const
return errors at the minimum
Namespace for new Math classes and functions.
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual double MinValue() const
return minimum function value
virtual unsigned int NCalls() const
number of function calls to reach the minimum
virtual unsigned int NFree() const
number of free variables (real dimension of the problem) this is <= Function().NDim() which is the to...
Documentation for the abstract class IBaseFunctionMultiDim.
Definition: IFunction.h:63
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...
const GeneticMinimizerParameters & MinimizerParameters() const
virtual const double * MinGradient() const
return pointer to gradient values at the minimum