English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / ReOptimizer: TNloptGradient.h Source File
Uranie / ReOptimizer v4.9.0
/* @license-end */
TNloptGradient.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 by
6// 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 1.5 $
22// $State$
24
32#ifndef __NLOPTGRADIENT__
33#define __NLOPTGRADIENT__
34
35#include <vector>
36#include <map>
37
38//ROOT
39#include "Rtypes.h"
40
41//Uranie
42#include "Reoptimizer.h"
43#include "TNloptShare.h"
44
45#include "DataServer.h"
46#include "TEval.h"
47#include "TOptimFit.h"
48#include "TFitGetter.h"
49
50
51namespace URANIE
52{
53namespace Reoptimizer
54{
55
57{
58protected:
59 //std::map<int, struct grad_work> _job;
60 //int _coef;
61 //std::vector<std::vector<URANIE::DataServer::UEntry *>> _codi, _codo, _codg;
62
63 // solver
64 void gradFromCode(double *code, double *solv);
65 // abstract from TNloptShare
66 void buildSolver(int siz, struct nlopt_work *);
67 void cleanSolver(struct nlopt_work *);
68 void put(struct nlopt_work *, Bool_t, const double *);
69 virtual int get(long &);
70
71public:
73 {
74 };
75
76 TNloptGradient(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run,
77 TNloptSolver *algo);
78 TNloptGradient(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TEval *fun,
79 TNloptSolver *algo);
80 virtual ~TNloptGradient();
81
82 // initialisation
83 virtual void addObjective(URANIE::DataServer::TAttribute *,
84 TOptimFit *f = NULL);
85 void addObjective(URANIE::DataServer::TAttribute *,
86 URANIE::DataServer::TAttribute *, TOptimFit *f = NULL);
87 virtual void addConstraint(URANIE::DataServer::TAttribute *,
88 TOptimFit *f = NULL);
89 void addConstraint(URANIE::DataServer::TAttribute *,
90 URANIE::DataServer::TAttribute *, TOptimFit *f = NULL);
91 void addEquality(URANIE::DataServer::TAttribute *,
92 URANIE::DataServer::TAttribute *, TOptimFit *f = NULL);
93 // callback methode
94 int critere(struct nlopt_work*, const double *ini, double *out,
95 double *grad);
96 int inequality(struct nlopt_work*, const double *in, double *out,
97 double *grad);
98 int equality(struct nlopt_work*, const double *in, double *out,
99 double *grad);
100 void run(struct nlopt_work *);
101
102 ClassDef(URANIE::Reoptimizer::TNloptGradient, ID_REOPTIMIZER)
103};
104
105
106}
107} //namespace
108#endif
109
recuperation de sortie transformées
objectifs et contraintes standards
Definition TNloptGradient.h:57
int critere(struct nlopt_work *, const double *ini, double *out, double *grad)
Definition TNloptGradient.cxx:128
void gradFromCode(double *code, double *solv)
Definition TNloptGradient.cxx:115
void buildSolver(int siz, struct nlopt_work *)
Definition TNloptGradient.cxx:215
int equality(struct nlopt_work *, const double *in, double *out, double *grad)
Definition TNloptGradient.cxx:171
void addEquality(URANIE::DataServer::TAttribute *, URANIE::DataServer::TAttribute *, TOptimFit *f=NULL)
Definition TNloptGradient.cxx:107
void put(struct nlopt_work *, Bool_t, const double *)
Definition TNloptGradient.cxx:200
int inequality(struct nlopt_work *, const double *in, double *out, double *grad)
Definition TNloptGradient.cxx:145
virtual ~TNloptGradient()
Definition TNloptGradient.cxx:70
virtual void addObjective(URANIE::DataServer::TAttribute *, TOptimFit *f=NULL)
Definition TNloptGradient.cxx:75
void cleanSolver(struct nlopt_work *)
Definition TNloptGradient.cxx:233
virtual int get(long &)
Definition TNloptGradient.cxx:209
void run(struct nlopt_work *)
virtual void addConstraint(URANIE::DataServer::TAttribute *, TOptimFit *f=NULL)
Definition TNloptGradient.cxx:92
Definition TNloptShare.h:71
Definition TNloptShare.h:62
Definition TOptimFit.h:48
Definition TCMAES.h:70