English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Sampler: URANIE::Sampler::TConstrLHS Class Reference
Uranie / Sampler v4.9.0
/* @license-end */
URANIE::Sampler::TConstrLHS Class Reference

Description of the class TConstrLHS. More...

#include <TConstrLHS.h>

Inheritance diagram for URANIE::Sampler::TConstrLHS:
Collaboration diagram for URANIE::Sampler::TConstrLHS:

Public Member Functions

Constructor and Destructor
 TConstrLHS (URANIE::DataServer::TDataServer *tds, int sampleSize)
 Creates a TConstrLHS object from a TDataServer, and the number of events requested.
 
virtual ~TConstrLHS ()
 Default destructor.
 
Generate the sample
void generateSample (Option_t *option="")
 Generates the sample.
 
void setSeed (Int_t ind=0)
 Set the random generator seed.
 
void addConstraint (void(*fConstrain)(double *, double *), int nConstr, int nbparam, int *param)
 
- Public Member Functions inherited from URANIE::Sampler::TSamplerStochastic
 TSamplerStochastic (URANIE::DataServer::TDataServer *tds, Option_t *option, Int_t nCalcul)
 Constructor with a dataserver.
 
virtual ~TSamplerStochastic ()
 Default destructor.
 
void setSeed (Int_t ind=0)
 Init the seed.
 
Int_t getSeed ()
 Returns the seed value.
 
- Public Member Functions inherited from URANIE::Sampler::TSampler
 TSampler (URANIE::DataServer::TDataServer *tds, Option_t *option, Int_t nCalcul)
 Constructor with a TDataServer, the options and the size of the sample.
 
virtual ~TSampler ()
 Default destructor.
 
Int_t GetID ()
 Returns the ID of the class.
 
void setMethodName (TString str)
 Sets the method name in a global variable.
 
TString getMethodName ()
 Gets the method name.
 
virtual URANIE::DataServer::TDataServer * getTDS ()
 Return the TDS filling by the sampling algorithm.
 
void parseOption (Option_t *option)
 Parse the option.
 
virtual void createListOfAttributes ()
 Creates the List of attributes to simulate.
 
URANIE::DataServer::TDSNtupleD * getTuple ()
 Returns the TDSNtupleD of data.
 
void setLog ()
 
void unsetLog ()
 
void changeLog ()
 
Bool_t getLog ()
 

Public Attributes

internal variables
bool _bAlreadyFilled
 If the tree is already filled.
 
TMatrixD _currentLHS
 The lhs sample under modification.
 
TMatrixD _currentPerm
 a matrix used to do the permutation of the constraint matrices
 
vector< TMatrixD > _currentConst
 vector of constraints matrix
 
vector< vector< int > > _rowSol
 vector of number of constraint respected by row (by constraint)
 
vector< vector< int > > _colSol
 vector of number of constraint respected by column (by constraint)
 
vector< vector< int > > _diag
 vector of boolean for the diagonal element of the constraint (by constraint)
 
vector< map< int, vector< int > > > _modified
 vector of modification by permutation (by constraint)
 
vector< int > _paramValues
 vector of parameter values used to compute the constraints and fill the constraint matrix
 
vector< int > _nbdiag
 vector of number of diagonal constrainted validated
 
TSampling_sampling
 Pointer to a TSampling object if tds is empty;.
 
unsigned int _ns
 Local counter for number of samples and variables.
 
unsigned int _nx
 Local counter for number of samples and variables.
 
unsigned int _nParam
 Local counter for number of parameters (inputs) used to compute the constraint.
 
unsigned int _nConstr
 Number of constraints used in thie class.
 
unsigned int _iPerm
 Number of permutations performed so far.
 
void(* _fConstrain )(double *, double *)
 Parameter transformation function.
 
- Public Attributes inherited from URANIE::Sampler::TSampler
Int_t _nS
 The size of the sample.
 
Int_t _nX
 The size of attributes to sample.
 
URANIE::DataServer::TDSNtupleD * _ntsample
 the tntuple of data
 
TString _sMethod
 The title of the sampler method.
 
Bool_t _blog
 Log Printing.
 
Bool_t _bupdateFile
 Update the back up file when generating the attributeformula if there is some.
 
URANIE::DataServer::TDataServer * _tds
 Pointer to a TDS.
 
TList * _lstOfAttributesToSample
 The list of Stochastic Attributes to sample.
 

Private Member Functions

Specific methods to initialise and fill the doe
void initElements ()
 initialise the elements of inner variables used to perform the permutation
 
virtual void fillOtherAttributes ()
 Fills the TAttributeFormula and totally correlated attributes.
 
void createTuple ()
 create the ntuple
 
Compute the constraint matrix
void getConstMatrix ()
 Compute the distance matrix.
 
void printMatrix (TMatrixD &dist)
 Print the matrix (for debuging purpose mainly)
 
void findNextPermutation ()
 find the permutation to be performed both for the lhs plan and all the inner variables used to

 
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 used to

 
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.
 
int maxBPM (TMatrixD &lhs)
 Returns the maximum number of matching from _nS to _nS.
 
Printing Log
virtual void printLog (Option_t *option="")
 Prints the log.
 

Additional Inherited Members

- Protected Member Functions inherited from URANIE::Sampler::TSamplerStochastic
virtual void init ()
 The preprocessing step.
 
virtual void terminate ()
 The post-processing step.
 
- Protected Attributes inherited from URANIE::Sampler::TSamplerStochastic
Int_t _nSeed
 

Detailed Description

Description of the class TConstrLHS.

This class is used to produce a constr lhs doe. It starts either with an empy tds or an already filled one, with the hypothesis that it has been filled with an LHS doe

An simulated annealing algorithm is implemented here to deal with the permutation. This implementation has be done by Guillaume Damblin.

Constructor & Destructor Documentation

◆ TConstrLHS()

URANIE::Sampler::TConstrLHS::TConstrLHS ( URANIE::DataServer::TDataServer *  tds,
int  sampleSize 
)

Creates a TConstrLHS object from a TDataServer, and the number of events requested.

Parameters
tds(TDataServer *) pointer to the TDataServer.
sampleSize(Int_t) number of values to generate for each random variable.
Exceptions
UErrorExceptionsif sampleSize <= 0

Referenced by ClassImp().

◆ ~TConstrLHS()

virtual URANIE::Sampler::TConstrLHS::~TConstrLHS ( )
virtual

Default destructor.

Referenced by ClassImp().

Member Function Documentation

◆ addConstraint()

void URANIE::Sampler::TConstrLHS::addConstraint ( void(*)(double *, double *)  fConstrain,
int  nConstr,
int  nbparam,
int *  param 
)

Referenced by ClassImp().

◆ bpm()

bool URANIE::Sampler::TConstrLHS::bpm ( TMatrixD &  lhs,
int  u,
int  seen[],
int  matchR[] 
)
private

A DFS based recursive function that returns true if a matching for vertex u is possible.

Referenced by ClassImp().

◆ createTuple()

void URANIE::Sampler::TConstrLHS::createTuple ( )
privatevirtual

create the ntuple

Reimplemented from URANIE::Sampler::TSampler.

Referenced by ClassImp().

◆ fillOtherAttributes()

virtual void URANIE::Sampler::TConstrLHS::fillOtherAttributes ( )
privatevirtual

Fills the TAttributeFormula and totally correlated attributes.

Reimplemented from URANIE::Sampler::TSampler.

Referenced by ClassImp().

◆ findNextPermutation()

void URANIE::Sampler::TConstrLHS::findNextPermutation ( )
private

find the permutation to be performed both for the lhs plan and all the inner variables used to

The permutation is factorised in performPermutation below

Referenced by ClassImp().

◆ generateSample()

void URANIE::Sampler::TConstrLHS::generateSample ( Option_t *  option = "")
virtual

Generates the sample.

Generates the random data and fills the TDataServer with it.

Parameters
option(Option_t *) option string (Default = "")

Implements URANIE::Sampler::TSampler.

Referenced by ClassImp().

◆ getConstMatrix()

void URANIE::Sampler::TConstrLHS::getConstMatrix ( )
private

Compute the distance matrix.

Compute the distance matrix

Parameters
Const(TMatrixD) the distance matrix of the lhs plan under study
lhs(TMatrixD) the lhs plan under study

Referenced by ClassImp().

◆ initElements()

void URANIE::Sampler::TConstrLHS::initElements ( )
private

initialise the elements of inner variables used to perform the permutation

Referenced by ClassImp().

◆ maxBPM()

int URANIE::Sampler::TConstrLHS::maxBPM ( TMatrixD &  lhs)
private

Returns the maximum number of matching from _nS to _nS.

Referenced by ClassImp().

◆ performPermutation()

void URANIE::Sampler::TConstrLHS::performPermutation ( int  Rcon,
int  Rrow,
int  Rcol,
int  Rvar 
)
private

perform the permutation defined in findNextPermutation for the lhs plan and all the inner variables used to

The permutation is performed

Referenced by ClassImp().

◆ printLog()

virtual void URANIE::Sampler::TConstrLHS::printLog ( Option_t *  option = "")
privatevirtual

Prints the log.

Parameters
option(Option_t *) option string (Default = "")

Reimplemented from URANIE::Sampler::TSamplerStochastic.

Referenced by ClassImp().

◆ printMatrix()

void URANIE::Sampler::TConstrLHS::printMatrix ( TMatrixD &  dist)
private

Print the matrix (for debuging purpose mainly)

Dump a constraint matrix. The specific formatting is done for matrices filled with 0 or 1

Parameters
dist(TMatrixD) the constraint matrix to dump

Referenced by ClassImp().

◆ setSeed()

void URANIE::Sampler::TConstrLHS::setSeed ( Int_t  ind = 0)

Set the random generator seed.

Referenced by ClassImp().

Member Data Documentation

◆ _bAlreadyFilled

bool URANIE::Sampler::TConstrLHS::_bAlreadyFilled

If the tree is already filled.

Referenced by ClassImp().

◆ _colSol

vector<vector<int> > URANIE::Sampler::TConstrLHS::_colSol

vector of number of constraint respected by column (by constraint)

Referenced by ClassImp().

◆ _currentConst

vector<TMatrixD> URANIE::Sampler::TConstrLHS::_currentConst

vector of constraints matrix

Referenced by ClassImp().

◆ _currentLHS

TMatrixD URANIE::Sampler::TConstrLHS::_currentLHS

The lhs sample under modification.

Referenced by ClassImp().

◆ _currentPerm

TMatrixD URANIE::Sampler::TConstrLHS::_currentPerm

a matrix used to do the permutation of the constraint matrices

Referenced by ClassImp().

◆ _diag

vector<vector<int> > URANIE::Sampler::TConstrLHS::_diag

vector of boolean for the diagonal element of the constraint (by constraint)

Referenced by ClassImp().

◆ _fConstrain

void(* URANIE::Sampler::TConstrLHS::_fConstrain) (double *, double *)

Parameter transformation function.

Referenced by ClassImp().

◆ _iPerm

unsigned int URANIE::Sampler::TConstrLHS::_iPerm

Number of permutations performed so far.

Referenced by ClassImp().

◆ _modified

vector<map<int, vector<int> > > URANIE::Sampler::TConstrLHS::_modified

vector of modification by permutation (by constraint)

Referenced by ClassImp().

◆ _nbdiag

vector<int> URANIE::Sampler::TConstrLHS::_nbdiag

vector of number of diagonal constrainted validated

Referenced by ClassImp().

◆ _nConstr

unsigned int URANIE::Sampler::TConstrLHS::_nConstr

Number of constraints used in thie class.

Referenced by ClassImp().

◆ _nParam

unsigned int URANIE::Sampler::TConstrLHS::_nParam

Local counter for number of parameters (inputs) used to compute the constraint.

Referenced by ClassImp().

◆ _ns

unsigned int URANIE::Sampler::TConstrLHS::_ns

Local counter for number of samples and variables.

Referenced by ClassImp().

◆ _nx

unsigned int URANIE::Sampler::TConstrLHS::_nx

Local counter for number of samples and variables.

Referenced by ClassImp().

◆ _paramValues

vector<int> URANIE::Sampler::TConstrLHS::_paramValues

vector of parameter values used to compute the constraints and fill the constraint matrix

Referenced by ClassImp().

◆ _rowSol

vector<vector<int> > URANIE::Sampler::TConstrLHS::_rowSol

vector of number of constraint respected by row (by constraint)

Referenced by ClassImp().

◆ _sampling

TSampling* URANIE::Sampler::TConstrLHS::_sampling

Pointer to a TSampling object if tds is empty;.

Referenced by ClassImp().