English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Optimizer: TObjective.h Source File
Uranie / Optimizer v4.9.0
/* @license-end */
TObjective.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
42#ifndef TOBJECTIVE_H
43#define TOBJECTIVE_H
44
45#include <iostream>
46
47//ROOT
48#include "Rtypes.h"
49#include "TNamed.h"
50#include "TMatrixT.h"
51
52// Uranie
53#include "Optimizer.h"
54#include "TDataServer.h"
55#include "TOutputFile.h"
56
57namespace URANIE
58{
59namespace Optimizer
60{
61class TObjective: public TNamed
62{
63public:
68public:
69 Double_t _dweight;
70 Double_t _dweightold;
71 Double_t _dvalue;
72 Bool_t _blog;
73 TString _syhat;
74 TString _systar;
75 int _nshare;
76 URANIE::DataServer::TDataServer *_tds;
77 URANIE::Launcher::TOutputFile *_outfile;
78public:
79 //---------------------------------------------
83
88 TObjective(TString name);
90 virtual ~TObjective();
92 //---------------------------------------------
96 // Return the value of the objective time the weight
97 Double_t getObjective() const
98 {
99 return _dweight * _dvalue;
100 }
101 // Return only the value of the objective without time the weight
103 {
104 return _dvalue;
105 }
106 // Compute the value of the objective, and return the value time the weight
107 virtual Double_t getObjective(Double_t *dvalues, Int_t nrow);
108 Bool_t isActive()
109 {
110 if (TMath::Abs(_dweight) < 0.001)
111 return kFALSE;
112 else
113 return kTRUE;
114 }
115 void unActive()
116 {
117 _dweight = 0.0;
118 }
119 void active()
120 {
122 }
123
124 void delShare()
125 {
126 _nshare--;
127 }
128 void addShare()
129 {
130 _nshare++;
131 }
133 {
134 return _nshare;
135 }
136
137 void setWeight(Double_t val)
138 {
139 _dweight = val;
140 _dweightold = val;
141 }
142 Double_t getWeight()
143 {
144 return _dweight;
145 }
146
147 void setYStar(URANIE::DataServer::TDataServer *tds, TString ystar)
148 {
149 _tds = tds;
150 _systar = ystar;
151 }
152 void setYHat(URANIE::Launcher::TOutputFile *outfile, TString yhat)
153 {
154 _outfile = outfile;
155 _syhat = yhat;
156 }
157
159
160 //---------------------------------------------
164 void setLog()
165 {
166 _blog = kTRUE;
167 }
168 void unsetLog()
169 {
170 _blog = kFALSE;
171 }
173 {
174 _blog = _blog ? kFALSE : kTRUE;
175 }
176 Bool_t getLog()
177 {
178 return _blog;
179 }
180 virtual void printLog(Option_t *option = "");
182
183 ClassDef(URANIE::Optimizer::TObjective, ID_OPTIMIZER)
184 //Classe de
185};
186
187} // Fin du namespace Optimizer
188} // Fin du namespace URANIE
189#endif
Description of the class TObjective. This class computes the ojective (from L2 point of view).
Definition TObjective.h:62
void changeLog()
Definition TObjective.h:172
Double_t _dweightold
The old Weight of the Objective function to save.
Definition TObjective.h:70
virtual ~TObjective()
Default destructor.
void addShare()
Definition TObjective.h:128
void setWeight(Double_t val)
Definition TObjective.h:137
int getShare()
Definition TObjective.h:132
void unActive()
Definition TObjective.h:115
virtual void printLog(Option_t *option="")
Double_t getObjectiveWithoutWeight() const
Definition TObjective.h:102
Bool_t getLog()
Definition TObjective.h:176
Double_t getWeight()
Definition TObjective.h:142
virtual Double_t getObjective(Double_t *dvalues, Int_t nrow)
void setLog()
Definition TObjective.h:164
URANIE::Launcher::TOutputFile * _outfile
Pointer of Output file of TCode into YHAT.
Definition TObjective.h:77
Double_t _dvalue
Value of the Objective function.
Definition TObjective.h:71
TString _systar
Name of ystar.
Definition TObjective.h:74
Double_t _dweight
Weight of the Objective function.
Definition TObjective.h:69
Bool_t _blog
Boolean to edit the log.
Definition TObjective.h:72
TString _syhat
Name of yhat.
Definition TObjective.h:73
TObjective(TString name)
Constructor by name only.
Bool_t isActive()
Definition TObjective.h:108
void setYHat(URANIE::Launcher::TOutputFile *outfile, TString yhat)
Definition TObjective.h:152
int _nshare
number of object accessing it
Definition TObjective.h:75
void setYStar(URANIE::DataServer::TDataServer *tds, TString ystar)
Definition TObjective.h:147
EOptimType
Definition TObjective.h:65
@ kSumOfSquare
Definition TObjective.h:66
@ kFunction
Definition TObjective.h:66
void unsetLog()
Definition TObjective.h:168
void active()
Definition TObjective.h:119
Double_t getObjective() const
Definition TObjective.h:97
URANIE::DataServer::TDataServer * _tds
Pointer of a TDS into YHat.
Definition TObjective.h:76
void delShare()
Definition TObjective.h:124
Rosenbrock's function (n=2) with first and second order derivatives.
Definition TBestEstimate.h:58