Logo ROOT  
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 #include <string>
21 
22 namespace TMVA {
23  class IFitterTarget;
24  class Interval;
25 }
26 
27 namespace ROOT {
28  namespace Math {
29 
30 
31 //_______________________________________________________________________________
32 /*
33  structure containing the parameters of the genetic minimizer
34  */
36 
45 
46 
47  // constructor with default value
49 };
50 
51 
52 
53 //_______________________________________________________________________________
54 /**
55  GeneticMinimizer
56 
57  Minimizer class based on the Gentic algorithm implemented in TMVA
58 
59  @ingroup MultiMin
60 */
62 
63 public:
64 
65  //GeneticMinimizer (int = 0);
66  GeneticMinimizer (int i = 0);
67  virtual ~GeneticMinimizer ();
68 
69  virtual void Clear();
71  virtual void SetFunction(const ROOT::Math::IMultiGenFunction & func);
72 
73  virtual bool SetLimitedVariable(unsigned int , const std::string& , double , double , double, double);
74  virtual bool SetVariable(unsigned int ivar, const std::string & name, double val, double step);
75  virtual bool SetFixedVariable(unsigned int ivar , const std::string & name , double val);
76 
77  virtual bool Minimize();
78  virtual double MinValue() const;
79  virtual double Edm() const;
80  virtual const double * X() const;
81  virtual const double * MinGradient() const;
82  virtual unsigned int NCalls() const;
83 
84  virtual unsigned int NDim() const;
85  virtual unsigned int NFree() const;
86 
87  virtual bool ProvidesError() const;
88  virtual const double * Errors() const;
89 
90  virtual double CovMatrix(unsigned int i, unsigned int j) const;
91 
92  void SetParameters(const GeneticMinimizerParameters & params );
93 
94  void SetRandomSeed(int seed) { fParameters.fSeed = seed; }
95 
97 
98  virtual ROOT::Math::MinimizerOptions Options() const;
99 
100  virtual void SetOptions(const ROOT::Math::MinimizerOptions & opt);
101 
102 protected:
103 
105 
106  std::vector<TMVA::Interval*> fRanges;
108  double fMinValue;
109  std::vector<double> fResult;
110 
112 
113 };
114 
115 
116  } // end namespace Math
117 } // end namespace ROOT
118 
119 #endif /* ROOT_Math_GeneticMinimizer */
ROOT::Math::GeneticMinimizer::SetFunction
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)
set the function to minimize
Definition: GeneticMinimizer.cxx:138
ROOT::Math::GeneticMinimizer::fMinValue
double fMinValue
Definition: GeneticMinimizer.h:108
Minimizer.h
ROOT::Math::GeneticMinimizer::GeneticMinimizer
GeneticMinimizer(int i=0)
Definition: GeneticMinimizer.cxx:99
ROOT::Math::GeneticMinimizer::GetGeneticOptions
void GetGeneticOptions(ROOT::Math::MinimizerOptions &opt) const
Definition: GeneticMinimizer.cxx:192
ROOT::Math::GeneticMinimizer::SetParameters
void SetParameters(const GeneticMinimizerParameters &params)
Definition: GeneticMinimizer.cxx:178
ROOT::Math::GeneticMinimizer::SetRandomSeed
void SetRandomSeed(int seed)
Definition: GeneticMinimizer.h:94
ROOT::Math::GeneticMinimizer::NDim
virtual unsigned int NDim() const
this is <= Function().NDim() which is the total number of variables (free+ constrained ones)
Definition: GeneticMinimizer.cxx:349
ROOT::Math::GeneticMinimizerParameters
Definition: GeneticMinimizer.h:35
ROOT::Math::GeneticMinimizer::fParameters
GeneticMinimizerParameters fParameters
Definition: GeneticMinimizer.h:111
ROOT::Math::GeneticMinimizerParameters::fSeed
Int_t fSeed
Definition: GeneticMinimizer.h:44
ROOT::Math::GeneticMinimizerParameters::GeneticMinimizerParameters
GeneticMinimizerParameters()
Definition: GeneticMinimizer.cxx:82
ROOT::Math::GeneticMinimizer::Errors
virtual const double * Errors() const
return errors at the minimum
Definition: GeneticMinimizer.cxx:367
ROOT::Math::GeneticMinimizer::Minimize
virtual bool Minimize()
method to perform the minimization
Definition: GeneticMinimizer.cxx:253
ROOT::Math::GeneticMinimizer::X
virtual const double * X() const
return pointer to X values at the minimum
Definition: GeneticMinimizer.cxx:337
ROOT::Math::GeneticMinimizer::SetOptions
virtual void SetOptions(const ROOT::Math::MinimizerOptions &opt)
Definition: GeneticMinimizer.cxx:218
ROOT::Math::GeneticMinimizerParameters::fPopSize
Int_t fPopSize
Definition: GeneticMinimizer.h:37
ROOT::Math::GeneticMinimizer::fFitness
TMVA::IFitterTarget * fFitness
Definition: GeneticMinimizer.h:107
ROOT::Math::GeneticMinimizer::CovMatrix
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 ...
Definition: GeneticMinimizer.cxx:369
ROOT::Math::GeneticMinimizer::ProvidesError
virtual bool ProvidesError() const
minimizer provides error and error matrix
Definition: GeneticMinimizer.cxx:366
ROOT::Math::GeneticMinimizerParameters::fConvCrit
Double_t fConvCrit
Definition: GeneticMinimizer.h:43
ROOT::Math::GeneticMinimizer::SetVariable
virtual bool SetVariable(unsigned int ivar, const std::string &name, double val, double step)
set a new free variable
Definition: GeneticMinimizer.cxx:154
ROOT::Math::Minimizer::SetFunction
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)=0
set the function to minimize
ROOT::Math::MinimizerOptions
Minimizer options.
Definition: MinimizerOptions.h:32
ROOT::Math::GeneticMinimizer::MinimizerParameters
const GeneticMinimizerParameters & MinimizerParameters() const
Definition: GeneticMinimizer.h:96
ROOT::Math::GeneticMinimizer::fResult
std::vector< double > fResult
Definition: GeneticMinimizer.h:109
ROOT::Math::GeneticMinimizer
GeneticMinimizer.
Definition: GeneticMinimizer.h:61
ROOT::Math::GeneticMinimizerParameters::fSC_steps
Int_t fSC_steps
Definition: GeneticMinimizer.h:40
ROOT::Math::GeneticMinimizerParameters::fSC_factor
Double_t fSC_factor
Definition: GeneticMinimizer.h:42
ROOT::Math::GeneticMinimizer::Clear
virtual void Clear()
reset for consecutive minimizations - implement if needed
Definition: GeneticMinimizer.cxx:127
ROOT::Math::GeneticMinimizerParameters::fSC_rate
Int_t fSC_rate
Definition: GeneticMinimizer.h:41
Double_t
double Double_t
Definition: RtypesCore.h:59
ROOT::Math::GeneticMinimizerParameters::fNsteps
Int_t fNsteps
Definition: GeneticMinimizer.h:38
RtypesCore.h
ROOT::Math::GeneticMinimizer::Edm
virtual double Edm() const
return expected distance reached from the minimum (re-implement if minimizer provides it
Definition: GeneticMinimizer.cxx:368
ROOT::Math::Minimizer
Abstract Minimizer class, defining the interface for the various minimizer (like Minuit2,...
Definition: Minimizer.h:75
ROOT::Math::GeneticMinimizer::SetLimitedVariable
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...
Definition: GeneticMinimizer.cxx:147
ROOT::Math::GeneticMinimizer::MinGradient
virtual const double * MinGradient() const
return pointer to gradient values at the minimum
Definition: GeneticMinimizer.cxx:365
ROOT::Math::GeneticMinimizer::NFree
virtual unsigned int NFree() const
number of free variables (real dimension of the problem) this is <= Function().NDim() which is the to...
Definition: GeneticMinimizer.cxx:356
ROOT::Math::GeneticMinimizer::fRanges
std::vector< TMVA::Interval * > fRanges
Definition: GeneticMinimizer.h:106
name
char name[80]
Definition: TGX11.cxx:110
ROOT::Math::GeneticMinimizer::~GeneticMinimizer
virtual ~GeneticMinimizer()
Definition: GeneticMinimizer.cxx:118
ROOT::Math::GeneticMinimizerParameters::fCycles
Int_t fCycles
Definition: GeneticMinimizer.h:39
TMVA::IFitterTarget
Interface for a fitter 'target'.
Definition: IFitterTarget.h:44
ROOT::Math::GeneticMinimizer::Options
virtual ROOT::Math::MinimizerOptions Options() const
retrieve the minimizer options (implement derived class if needed)
Definition: GeneticMinimizer.cxx:186
ROOT::Math::GeneticMinimizer::MinValue
virtual double MinValue() const
return minimum function value
Definition: GeneticMinimizer.cxx:332
ROOT::Math::IBaseFunctionMultiDimTempl
Documentation for the abstract class IBaseFunctionMultiDim.
Definition: IFunction.h:62
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Math::GeneticMinimizer::SetFixedVariable
virtual bool SetFixedVariable(unsigned int ivar, const std::string &name, double val)
set a new fixed variable (override if minimizer supports them )
Definition: GeneticMinimizer.cxx:166
Math
Namespace for new Math classes and functions.
ROOT::Math::GeneticMinimizer::NCalls
virtual unsigned int NCalls() const
number of function calls to reach the minimum
Definition: GeneticMinimizer.cxx:341
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22
int
TMVA::Interval
The TMVA::Interval Class.
Definition: Interval.h:61