English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Sensitivity: TSobol.h Source File
Uranie / Sensitivity  v4.10.0
/* @license-end */
TSobol.h
Go to the documentation of this file.
1 // 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 TSobol_H
42 #define TSobol_H
43 #include "TString.h"
44 #ifndef ROOT_TMethodCall
45 #include "TMethodCall.h"
46 #endif
47 #ifndef ROOT_TNtupleD
48 #include "TNtupleD.h"
49 #endif
50 
51 // Uranie
52 #include "TStochAttribut.h"
53 #include "TSensitivity.h"
54 #include "TSampling.h"
55 #include "TQMC.h"
56 
57 using std::cout;
58 using std::endl;
59 
60 namespace URANIE {
61 namespace Sensitivity {
62 class TSobol: public TSensitivity {
63 
65 public:
67  {
69  };
71  {
73  };
75  {
77  };
79  {
87  };
88 
89  // Operations
90 private:
91 
92 protected:
93  //---------------------------------------------
97  void initSample(Int_t ns, Option_t * option = "");
99 
100  void prepareSizePerIndex(Option_t * option= "");
101  //---------------------------------------------
105 
114  virtual void parseOption(Option_t *option = "");
116 
117  //---------------------------------------------
121  void preTreatment();
124 
125 public:
126  //---------------------------------------------
130  TSobol();
133  /*
134  \param tds (URANIE::DataServer::TDataServer *) the dataserver
135  \param fcn (void *) The function to analyze
136  \param ns (Int_t) The size (total) of the sampling
137  \param varexpinput(const char*)[""] The list of input attributes to pass to the function separated by the caracter ":"
138  \param varexpoutput (const char *)[""] The list of output attributes separated by the caracter ":"
139  \param
140  */
141 #ifdef ROOT5
142  TSobol(URANIE::DataServer::TDataServer *tds, void *fcn, Int_t ns,
143  const char *varexpinput = "", const char *varexpoutput = "",
144  Option_t * option = "");
145 #else
146  TSobol(URANIE::DataServer::TDataServer *tds, void (*fcn)(Double_t*,Double_t*),
147  const char *varexpinput, const char *varexpoutput,
148  Int_t ns, Option_t * option = "");
149 #endif
150  /*
152  \param tds (URANIE::DataServer::TDataServer *) the dataserver
153  \param fcn (const char*) The function to analyze
154  \param ns (Int_t) The size (total) of the sampling
155  \param varexpinput(const char*)[""] The list of input attributes to pass to the function separated by the caracter ":"
156  \param varexpoutput (const char *)[""] The list of output attributes separated by the caracter ":"
157  \param
158  */
159  TSobol(URANIE::DataServer::TDataServer *tds, const char *fcn,
160  Int_t ns, const char *varexpinput, const char *varexpoutput,
161  Option_t* option="");
163  TSobol(URANIE::DataServer::TDataServer *tds, const char *varexpinput,
164  const char *varexpoutput, Option_t * option = "");
165 
167  TSobol(URANIE::DataServer::TDataServer *tds, URANIE::Launcher::TCode *fcode,
168  Int_t ns, Option_t * option = "");
170  TSobol(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run,
171  Int_t ns, Option_t * option = "");
173  virtual ~TSobol();
175 
176  //---------------------------------------------
180  void initForRun(Option_t *option);
182 
183 
184  //---------------------------------------------
188  void createTuple(Option_t *option = "");
190 
191  //---------------------------------------------
195  /*
197  \li from a TDS empty of data . Run the method \ref initSample
198  \li from a TDS with data. First Half of the data is M and the other is N
199 
200  After mix the data to create the \f$ M_{i}\f$ and \f$ N_{i}\f$ matrix
201  */
202  virtual void generateSample(Option_t * option = "");
203 
204  void loadOtherSobolFile(const char *filename);
206 
207  //---------------------------------------------
209  /*
211  The TDS must contain an attribute Name + "n__iter__sobol" with values
212  \li -1 : for the M matrix
213  \li 0 : for the N matrix
214  \li ix+1 : for the matrix Mi
215  \li 100*_nX+ ix+1 : for the matrix Ni
216  */
217  void evaluateIndexes(Option_t * option = "");
219 
220  //---------------------------------------------
224  virtual void printLog();
226 
227  ClassDef(URANIE::Sensitivity::TSobol, ID_SENSITIVITY)
228 
229  //---------------------------------------------
234  Bool_t _bSM;
235  Bool_t _bWithSample;
236  Bool_t _bWithData;
237  Bool_t _bCVM;
238 
241 
244 
245  //---------------------------------------------
252  TMatrixD _matM;
253  TMatrixD _matN;
254 
255  TEventList *_telm, *_teln;
256  TMatrixD _valN, _valM;
257  TMatrixD _valSi, _valSti;
260  URANIE::DataServer::TDSNtupleD *_withdatantp;
261  URANIE::DataServer::TDSNtupleD *_preloadedntp;
262  int *_useless;
264 
265 };
266 
267 } // End Of namespace Sensitivity
268 } // End Of namespace URANIE
269 #endif
ROOT.
Definition: TCMN.h:45
Bool_t _bWithSample
true if data are provided and used as full sample of 2 times ns samples
Definition: TSobol.h:235
void createTuple(Option_t *option="")
URANIE::DataServer::TDSNtupleD * _withdatantp
Definition: TSobol.h:260
URANIE::DataServer::TDSNtupleD * _preloadedntp
Definition: TSobol.h:261
TEventList * _teln
m and n lit of event in the ntuple
Definition: TSobol.h:255
Int_t _nSimPerIndex
The size of the two matrix M et N.
Definition: TSobol.h:250
Bool_t _bCVM
Definition: TSobol.h:237
EMatrixMiNi
Definition: TSobol.h:70
vector< double > _valMeanYM
Definition: TSobol.h:259
Int_t _nMethodComputed
number of method used
Definition: TSobol.h:251
vector< double > _valMeanYN
Definition: TSobol.h:259
TSobol()
Default constructor.
void evaluateIndexes(Option_t *option="")
Evaluates the index from a Specific TDataServer.
TMatrixD _matM
The matrix M.
Definition: TSobol.h:252
void loadOtherSobolFile(const char *filename)
EMatrixMiNi _nMatrixMiNi
The method to generate the Min and/or Ni matrix (Sobol, Saltelli)
Definition: TSobol.h:240
virtual ~TSobol()
Default destructor.
ESiAlgorithm _nSiAlgorithm
The algorithm to use to compute the first order algorithm.
Definition: TSobol.h:242
Definition: TSobol.h:68
virtual void parseOption(Option_t *option="")
Read option specific to TSobol.
void initForRun(Option_t *option)
TMatrixD _valSigmaMN
complexe matrices to store the mean and variance of used M/N/Mi/Ni matrices
Definition: TSobol.h:258
EStiAlgorithm _nStiAlgorithm
The algorithm to use to compute the total order algorithm.
Definition: TSobol.h:243
TMatrixD _valMeanMN
Definition: TSobol.h:258
Description of the class TSensitivity.
Definition: TSensitivity.h:111
ESamplerMethod
list Of Enum
Definition: TSobol.h:66
TMatrixD _matN
The matrix M.
Definition: TSobol.h:253
Bool_t _bWithData
true if data are provided and used as full sample of 2 times ns samples
Definition: TSobol.h:236
virtual void generateSample(Option_t *option="")
Generates all the matrix of sample.
Description of the class TSobol.
Definition: TSobol.h:62
EStiAlgorithm
Definition: TSobol.h:78
TMatrixD _valM
values of output for M and N matrix
Definition: TSobol.h:256
ESiAlgorithm
Definition: TSobol.h:74
int * _useless
Definition: TSobol.h:262
TMatrixD _valSti
values of the first and total sobol indexes
Definition: TSobol.h:257
TMatrixD _valN
Definition: TSobol.h:256
Definition: TSobol.h:68
TMatrixD _valSi
Definition: TSobol.h:257
vector< double > _valVarYN
Definition: TSobol.h:259
vector< double > _valVarYM
Definition: TSobol.h:259
void preTreatment()
Resize matrices and fill many vector/matrice to avroid recompute stat too oftently.
void initSample(Int_t ns, Option_t *option="")
TEventList * _telm
Definition: TSobol.h:255
void prepareSizePerIndex(Option_t *option="")
Interface of class URANIE::Sensitivity::TSensitivity.
ESamplerMethod _nSamplerMethod
The sampler method to generate the M and N matrix.
Definition: TSobol.h:239