ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 )
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
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
#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