Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
22namespace TMVA {
23 class IFitterTarget;
24 class Interval;
25}
26
27namespace 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
63public:
64
65 //GeneticMinimizer (int = 0);
66 GeneticMinimizer (int i = 0);
67 ~GeneticMinimizer () override;
68
69 void Clear() override;
71 void SetFunction(const ROOT::Math::IMultiGenFunction & func) override;
72
73 bool SetLimitedVariable(unsigned int , const std::string& , double , double , double, double) override;
74 bool SetVariable(unsigned int ivar, const std::string & name, double val, double step) override;
75 bool SetFixedVariable(unsigned int ivar , const std::string & name , double val) override;
76
77 bool Minimize() override;
78 double MinValue() const override;
79 double Edm() const override;
80 const double * X() const override;
81 const double * MinGradient() const override;
82 unsigned int NCalls() const override;
83
84 unsigned int NDim() const override;
85 unsigned int NFree() const override;
86
87 bool ProvidesError() const override;
88 const double * Errors() const override;
89
90 double CovMatrix(unsigned int i, unsigned int j) const override;
91
92 void SetParameters(const GeneticMinimizerParameters & params );
93
94 void SetRandomSeed(int seed) { fParameters.fSeed = seed; }
95
97
99
100 virtual void SetOptions(const ROOT::Math::MinimizerOptions & opt);
101
102protected:
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 */
char name[80]
Definition TGX11.cxx:110
const double * X() const override
return pointer to X values at the minimum
const GeneticMinimizerParameters & MinimizerParameters() const
unsigned int NDim() const override
this is <= Function().NDim() which is the total number of variables (free+ constrained ones)
double CovMatrix(unsigned int i, unsigned int j) const override
return covariance matrices element for variables ivar,jvar if the variable is fixed the return value ...
unsigned int NFree() const override
number of free variables (real dimension of the problem) this is <= Function().NDim() which is the to...
bool SetLimitedVariable(unsigned int, const std::string &, double, double, double, double) override
set a new upper/lower limited variable (override if minimizer supports them ) otherwise as default se...
virtual void SetOptions(const ROOT::Math::MinimizerOptions &opt)
double MinValue() const override
return minimum function value
const double * Errors() const override
return errors at the minimum
unsigned int NCalls() const override
number of function calls to reach the minimum
bool Minimize() override
method to perform the minimization
void GetGeneticOptions(ROOT::Math::MinimizerOptions &opt) const
bool ProvidesError() const override
minimizer provides error and error matrix
bool SetVariable(unsigned int ivar, const std::string &name, double val, double step) override
set a new free variable
std::vector< double > fResult
TMVA::IFitterTarget * fFitness
std::vector< TMVA::Interval * > fRanges
void SetParameters(const GeneticMinimizerParameters &params)
const double * MinGradient() const override
return pointer to gradient values at the minimum
double Edm() const override
return expected distance reached from the minimum (re-implement if minimizer provides it
void Clear() override
reset for consecutive minimization - implement if needed
ROOT::Math::MinimizerOptions Options() const override
retrieve the minimizer options (implement derived class if needed)
GeneticMinimizerParameters fParameters
void SetFunction(const ROOT::Math::IMultiGenFunction &func) override
set the function to minimize
bool SetFixedVariable(unsigned int ivar, const std::string &name, double val) override
set a new fixed variable (override if minimizer supports them )
Documentation for the abstract class IBaseFunctionMultiDim.
Definition IFunction.h:61
Abstract Minimizer class, defining the interface for the various minimizer (like Minuit2,...
Definition Minimizer.h:117
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)=0
set the function to minimize
Interface for a fitter 'target'.
The TMVA::Interval Class.
Definition Interval.h:61
Namespace for new Math classes and functions.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
create variable transformations