Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
GSLSimAnMinimizer.h
Go to the documentation of this file.
1// @(#)root/mathmore:$Id$
2// Author: L. Moneta Wed Dec 20 17:16:32 2006
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *
7 * *
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU General Public License *
10 * as published by the Free Software Foundation; either version 2 *
11 * of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this library (see file COPYING); if not, write *
20 * to the Free Software Foundation, Inc., 59 Temple Place, Suite *
21 * 330, Boston, MA 02111-1307 USA, or contact the author. *
22 * *
23 **********************************************************************/
24
25// Header file for class GSLSimAnMinimizer
26
27#ifndef ROOT_Math_GSLSimAnMinimizer
28#define ROOT_Math_GSLSimAnMinimizer
29
30
31
32#include "Math/BasicMinimizer.h"
33
34
35#include "Math/IFunctionfwd.h"
36
38
39
40
42
43
44
45
46namespace ROOT {
47
48 namespace Math {
49
50
51
52//_____________________________________________________________________________________
53 /**
54 GSLSimAnMinimizer class for minimization using simulated annealing
55 using the algorithm from
56 <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Simulated-Annealing.html">
57 GSL</A>.
58 It implements the ROOT::Minimizer interface and
59 a plug-in (name "GSLSimAn") exists to instantiate this class via the plug-in manager
60 Configuration (Setting/getting) the options is done through the methods defined in the
61 ROOT::Math::Minimizer class.
62 The user needs to call the base class method ROOT::Math::Minimizer::SetOptions to set the
63 corresponding options.
64 Here is some code example for increasing n_tries from 200 (default) to 1000
65 ```
66 ROOT::Math::GenAlgoOptions simanOpt;
67 simanOpt.SetValue("n_tries", 1000);
68 ROOT::Math::MinimizerOptions opt;
69 opt.SetExtraOptions(simanOpt);
70 minimizer->SetOptions(opt);
71 ```
72
73 @ingroup MultiMin
74 */
76
77 public:
78 /**
79 Default constructor
80 */
81 GSLSimAnMinimizer(int type = 0);
82
83 /**
84 Destructor (no operations)
85 */
86 ~GSLSimAnMinimizer() override;
87
88 private:
89 // usually copying is non trivial, so we make this unaccessible
90
91 /**
92 Copy constructor
93 */
95
96 /**
97 Assignment operator
98 */
100 {
101 if (this == &rhs)
102 return *this; // time saving self-test
103 return *this;
104 }
105
106 public:
107 /// method to perform the minimization
108 bool Minimize() override;
109
110 /// number of calls
111 unsigned int NCalls() const override;
112
113 /// Get current minimizer option parameteres
115
116 /// set new minimizer option parameters using directly the GSLSimAnParams structure
117 void SetParameters(const GSLSimAnParams &params)
118 {
119 fSolver.SetParams(params);
120 DoSetMinimOptions(params); // store new parameters also in MinimizerOptions
121 }
122
123 protected:
124 /// set minimizer option parameters from stored ROOT::Math::MinimizerOptions (fOpt)
125 void DoSetSimAnParameters(const MinimizerOptions &opt);
126
127 /// Set the Minimizer options from the simulated annealing parameters
128 void DoSetMinimOptions(const GSLSimAnParams &params);
129
130 private:
132
133
134};
135
136 } // end namespace Math
137
138} // end namespace ROOT
139
140
141#endif /* ROOT_Math_GSLSimAnMinimizer */
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Base Minimizer class, which defines the basic functionality of various minimizer implementations (apa...
GSLSimAnMinimizer class for minimization using simulated annealing using the algorithm from GSL.
bool Minimize() override
method to perform the minimization
void SetParameters(const GSLSimAnParams &params)
set new minimizer option parameters using directly the GSLSimAnParams structure
void DoSetSimAnParameters(const MinimizerOptions &opt)
set minimizer option parameters from stored ROOT::Math::MinimizerOptions (fOpt)
unsigned int NCalls() const override
number of calls
const GSLSimAnParams & MinimizerParameters() const
Get current minimizer option parameteres.
ROOT::Math::GSLSimAnnealing fSolver
GSLSimAnMinimizer(const GSLSimAnMinimizer &)
Copy constructor.
~GSLSimAnMinimizer() override
Destructor (no operations)
GSLSimAnMinimizer & operator=(const GSLSimAnMinimizer &rhs)
Assignment operator.
void DoSetMinimOptions(const GSLSimAnParams &params)
Set the Minimizer options from the simulated annealing parameters.
GSLSimAnnealing class for performing a simulated annealing search of a multidimensional function.
void SetParams(const GSLSimAnParams &params)
Namespace for new Math classes and functions.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
structure holding the simulated annealing parameters