English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Sampler: TConstrLHS.h Source File
Uranie / Sampler v4.9.0
/* @license-end */
TConstrLHS.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
45#ifndef TCONSTRLHS_H
46#define TCONSTRLHS_H
47
48#ifndef ROOT_TMatrixD
49#include "TMatrixD.h"
50#endif
51#ifndef ROOT_TVectorD
52#include "TVectorD.h"
53#endif
54#ifndef ROOT_TNtuple
55#include "TNtuple.h"
56#endif
57#ifndef ROOT_TString
58#include "TString.h"
59#endif
60#ifndef ROOT_TNtupleD
61#include "TNtupleD.h"
62#endif
63#ifndef ROOT_TNamed
64#include "TNamed.h"
65#endif
66
67// Uranie
68#include "TSamplerStochastic.h"
69#include "TSampling.h"
70#include "TAttribute.h"
71#include "TStochAttribut.h"
72#include "TDataServer.h"
73
74namespace URANIE
75{
76namespace Sampler
77{
79{
80
81public:
82
83 // Attributes
87
88 TMatrixD _currentLHS;
89 TMatrixD _currentPerm;
90
91 vector<TMatrixD> _currentConst;
92 vector<vector<int> > _rowSol;
93 vector<vector<int> > _colSol;
94 vector<vector<int> > _diag;
95 vector<map<int, vector<int> > > _modified;
96 vector<int> _paramValues;
97 vector<int> _nbdiag;
98
100
101 unsigned int _ns;
102 unsigned int _nx;
103 unsigned int _nParam;
104
105 unsigned int _nConstr;
106 unsigned int _iPerm;
107 void (*_fConstrain)(double *, double*);
108
110
111 // Operations
112 //---------------------------------------------
116
124 TConstrLHS(URANIE::DataServer::TDataServer *tds, int sampleSize);
125
127 virtual ~TConstrLHS();
129
130
131 //---------------------------------------------
135
140 void generateSample(Option_t *option = "");
141
143 void setSeed(Int_t ind = 0);
144
145 void addConstraint( void (*fConstrain)(double *, double*), int nConstr, int nbparam, int *param );
146
148
149private:
150
151 //---------------------------------------------
155
157
159 virtual void fillOtherAttributes();
160
163
165
166
167 //---------------------------------------------
171
173
180
182
187 void printMatrix(TMatrixD &dist);
188
190
194
196
199 void performPermutation(int Rcon, int Rrow, int Rcol, int Rvar);
200
202 bool bpm(TMatrixD &lhs, int u, int seen[], int matchR[]);
203
205 int maxBPM(TMatrixD &lhs);
206
207
208
210
211 //---------------------------------------------
215
219 virtual void printLog(Option_t *option = "");
221
222 ClassDef(URANIE::Sampler::TConstrLHS, ID_SAMPLER)
223 //Definition d'un plan d'exp�rience
224};
225
226} // Fin du namespace Sampler
227} // Fin du namespace URANIE
228#endif
229// fin du fichier $RCSfile$.
Creation of the abstract class TSamplerStochastic.
descritption.
Description of the class TConstrLHS.
Definition TConstrLHS.h:79
virtual ~TConstrLHS()
Default destructor.
unsigned int _nx
Local counter for number of samples and variables.
Definition TConstrLHS.h:102
unsigned int _nConstr
Number of constraints used in thie class.
Definition TConstrLHS.h:105
vector< vector< int > > _diag
vector of boolean for the diagonal element of the constraint (by constraint)
Definition TConstrLHS.h:94
TMatrixD _currentPerm
a matrix used to do the permutation of the constraint matrices
Definition TConstrLHS.h:89
void createTuple()
create the ntuple
virtual void printLog(Option_t *option="")
Prints the log.
TConstrLHS(URANIE::DataServer::TDataServer *tds, int sampleSize)
Creates a TConstrLHS object from a TDataServer, and the number of events requested.
vector< int > _paramValues
vector of parameter values used to compute the constraints and fill the constraint matrix
Definition TConstrLHS.h:96
unsigned int _ns
Local counter for number of samples and variables.
Definition TConstrLHS.h:101
void printMatrix(TMatrixD &dist)
Print the matrix (for debuging purpose mainly)
TSampling * _sampling
Pointer to a TSampling object if tds is empty;.
Definition TConstrLHS.h:99
vector< vector< int > > _colSol
vector of number of constraint respected by column (by constraint)
Definition TConstrLHS.h:93
void initElements()
initialise the elements of inner variables used to perform the permutation
TMatrixD _currentLHS
The lhs sample under modification.
Definition TConstrLHS.h:88
vector< vector< int > > _rowSol
vector of number of constraint respected by row (by constraint)
Definition TConstrLHS.h:92
void findNextPermutation()
find the permutation to be performed both for the lhs plan and all the inner variables used to
void(* _fConstrain)(double *, double *)
Parameter transformation function.
Definition TConstrLHS.h:107
void getConstMatrix()
Compute the distance matrix.
vector< TMatrixD > _currentConst
vector of constraints matrix
Definition TConstrLHS.h:91
vector< int > _nbdiag
vector of number of diagonal constrainted validated
Definition TConstrLHS.h:97
bool _bAlreadyFilled
If the tree is already filled.
Definition TConstrLHS.h:86
unsigned int _iPerm
Number of permutations performed so far.
Definition TConstrLHS.h:106
void performPermutation(int Rcon, int Rrow, int Rcol, int Rvar)
perform the permutation defined in findNextPermutation for the lhs plan and all the inner variables u...
bool bpm(TMatrixD &lhs, int u, int seen[], int matchR[])
A DFS based recursive function that returns true if a matching for vertex u is possible.
unsigned int _nParam
Local counter for number of parameters (inputs) used to compute the constraint.
Definition TConstrLHS.h:103
int maxBPM(TMatrixD &lhs)
Returns the maximum number of matching from _nS to _nS.
virtual void fillOtherAttributes()
Fills the TAttributeFormula and totally correlated attributes.
void setSeed(Int_t ind=0)
Set the random generator seed.
vector< map< int, vector< int > > > _modified
vector of modification by permutation (by constraint)
Definition TConstrLHS.h:95
void addConstraint(void(*fConstrain)(double *, double *), int nConstr, int nbparam, int *param)
void generateSample(Option_t *option="")
Generates the sample.
Definition TSamplerStochastic.h:44
Definition TSampling.h:66
Definition TAMHCopula.h:60