English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Optimizer: TOptimizerOpt.h Source File
Uranie / Optimizer v4.9.0
/* @license-end */
TOptimizerOpt.h
Go to the documentation of this file.
1
2// Copyright (C) 2013-2024 CEA/DES
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Lesser General Public License as published
6// by the Free Software Foundation, either version 3 of the License, or any
7// later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Lesser General Public License for more details.
13//
14// You should have received a copy of the GNU Lesser General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
18// $Id$
19// $Author$
20// $Date$
21// $Revision$
22// $State$
24
41#ifndef TOPTIMIZEROPT_H
42#define TOPTIMIZEROPT_H
43
44#include <iostream>
45
46//ROOT
47#include "Rtypes.h"
48#include "TMethodCall.h"
49
50// Uranie
51#include "Optimizer.h"
52#include "TDataServer.h"
53// Newmat
54
55#include "newmat.h"
56#include "opt++.h"
57//using namespace OPTPP;
58#ifdef HAVE_NAMESPACES
59using namespace NEWMAT;
60#endif
61
62// Opt++
63//extern typedef void(* OPTPP::USERFCN2)(int, int, const NEWMAT::ColumnVector &, real &, NEWMAT::ColumnVector &, NEWMAT::SymmetricMatrix &, int &);
64
65namespace URANIE
66{
67namespace Optimizer
68{
69class TOptimizerOpt: public TNamed
70{
71public:
76private:
77 Bool_t _blog;
78 URANIE::DataServer::TDataServer *_tds;
79
80//fga 2015/01/12 void * _function; //! rem : Do not process by rootcint
81//fga 2015/01/12 OPTPP::USERFCN2 _MyOptFunction; //! rem : Do not process by rootcint
82//fga 2015/01/12 OPTPP::OPTPPINITFCN _MyOptInitFunction; //! rem : Do not process by rootcint
83
84 TString _sLibrary;
87
88 Int_t _niter;
89
90 // OPTPP::USERFCN0 *_theFunction ;
92 TMethodCall *_fMethodCall;
93 void (*_fMethod)(Double_t *gin, Double_t *f);
94// void (*_fMethodOpt)(int mode, int n, const NEWMAT::ColumnVector& x, double& fx, NEWMAT::ColumnVector& g, NEWMAT::SymmetricMatrix& H, int &result);
95 void (*_fMethodOpt)(int n, const ColumnVector& x, double& fx, int& result);
96
97 TString _sname;
98public:
99 //---------------------------------------------
103
106// TOptimizerOpt (URANIE::DataServer::TDataServer *tds, void *function = NULL);
107 TOptimizerOpt(URANIE::DataServer::TDataServer *tds, const char *functionname);
108 TOptimizerOpt(URANIE::DataServer::TDataServer *tds, TString slibrary,
109 TString sfunction, TString sinit = "");
111 virtual ~TOptimizerOpt();
113
114 //---------------------------------------------
118
119 virtual void init(Option_t *option = "");
121 // virtual void optimize(void *fj, Option_t *option ="");
122 virtual void optimize(Option_t *option = "");
124 virtual void terminate(Option_t *option = "");
126 virtual void clean(Option_t *option = "");
127
128 void run(Option_t *option = "");
129// void run();
130
131 TMethodCall *getMethodCall() const
132 {
133 return _fMethodCall;
134 }
136 {
137 _niter++;
138 }
140 {
141 return _niter;
142 }
144
145 //---------------------------------------------
149 void setLog()
150 {
151 _blog = kTRUE;
152 }
153 void unsetLog()
154 {
155 _blog = kFALSE;
156 }
158 {
159 _blog = _blog ? kFALSE : kTRUE;
160 }
161 Bool_t getLog()
162 {
163 return _blog;
164 }
165 virtual void printLog(Option_t *option = "");
167
168 ClassDef(URANIE::Optimizer::TOptimizerOpt, ID_OPTIMIZER)
169 //Classe de
170};
171
172} // Fin du namespace Optimizer
173} // Fin du namespace URANIE
174
176#endif
NEWMAT::ColumnVector & x
Definition TOptimizerOpt.cxx:70
fx
Definition TOptimizerOpt.cxx:131
result
Definition TOptimizerOpt.cxx:132
R__EXTERN URANIE::Optimizer::TOptimizerOpt * gOptOptimizer
Definition TOptimizerOpt.h:175
Description of the class TOptimizerOpt.
Definition TOptimizerOpt.h:70
virtual ~TOptimizerOpt()
Default destructor.
Definition TOptimizerOpt.cxx:369
virtual void optimize(Option_t *option="")
Runs phase of the code.
Definition TOptimizerOpt.cxx:383
TMethodCall * getMethodCall() const
Definition TOptimizerOpt.h:131
virtual void clean(Option_t *option="")
Cleans the working directory of the code.
Definition TOptimizerOpt.cxx:451
TMethodCall * _fMethodCall
OPTPP::USERFCN0 *_theOptFunction ; ///< The function.
Definition TOptimizerOpt.h:92
virtual void terminate(Option_t *option="")
Terminate phase of the code.
Definition TOptimizerOpt.cxx:446
TString _sFunctionName
Definition TOptimizerOpt.h:85
TOptimizerOpt()
Default constructor.
Definition TOptimizerOpt.cxx:251
Bool_t getLog()
Definition TOptimizerOpt.h:161
void(* _fMethod)(Double_t *gin, Double_t *f)
Definition TOptimizerOpt.h:93
Bool_t _blog
Boolean to edit the log.
Definition TOptimizerOpt.h:77
void incrementIteration()
Definition TOptimizerOpt.h:135
Int_t _niter
Definition TOptimizerOpt.h:88
EOptimType
Definition TOptimizerOpt.h:73
@ kFunction
Definition TOptimizerOpt.h:74
@ kSumOfSquare
Definition TOptimizerOpt.h:74
virtual void init(Option_t *option="")
Init phase of the code.
Definition TOptimizerOpt.cxx:378
void run(Option_t *option="")
Definition TOptimizerOpt.cxx:457
void setLog()
Definition TOptimizerOpt.h:149
void(* _fMethodOpt)(int n, const ColumnVector &x, double &fx, int &result)
Definition TOptimizerOpt.h:95
TString _sname
Definition TOptimizerOpt.h:97
virtual void printLog(Option_t *option="")
Definition TOptimizerOpt.cxx:637
TString _sLibrary
Pointer vers un TDS.
Definition TOptimizerOpt.h:84
URANIE::DataServer::TDataServer * _tds
Definition TOptimizerOpt.h:78
Int_t getIteration()
Definition TOptimizerOpt.h:139
TString _sInitFunctionName
Definition TOptimizerOpt.h:86
void changeLog()
Definition TOptimizerOpt.h:157
void unsetLog()
Definition TOptimizerOpt.h:153
Rosenbrock's function (n=2) with first and second order derivatives.
Definition TBestEstimate.h:58