English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / DataServer: TCustomDistribution.h Source File
Uranie / DataServer  v4.10.0
/* @license-end */
TCustomDistribution.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 
49 #ifndef TCUSTOMDISTRIBUTION_H
50 #define TCUSTOMDISTRIBUTION_H
51 
52 //Uranie
53 #include "TDiscreteAttribute.h"
54 
55 namespace URANIE
56 {
57 namespace DataServer
58 {
60 {
61 private:
62 protected:
63  Int_t iNbValues;
64  Double_t _dSumFreq;
65  Double_t* pValues;
66  Double_t* pFrequencies;
67 public:
68  //---------------------------------------------
74 
76 
80  TCustomDistribution(TString name);
81 
83 
98  TCustomDistribution(TString name, Int_t nbValues, Double_t* values,
99  Double_t* frequencies = NULL);
100 
102  virtual ~TCustomDistribution();
104  //---------------------------------------------
109  virtual Int_t getNbValues()
111  {
112  return iNbValues;
113  }
114 
116  virtual Double_t* getAllValues()
117  {
118  return pValues;
119  }
120 
122 
126  virtual Double_t getValue(Int_t i);
127 
129  virtual Double_t* getAllFrequencies()
130  {
131  return pFrequencies;
132  }
133 
135 
139  virtual Double_t getFrequency(Int_t i);
140 
142 
146  virtual Double_t getProba(Int_t i);
147 
150 
164  virtual void setDistribution(Int_t nbValues, Double_t* values,
165  Double_t* frequencies = NULL);
166 
168 
171  virtual void setAllValues(Double_t* values);
172 
174 
179  virtual void setValue(Int_t i, Double_t value);
180 
182 
186  virtual void setAllFrequencies(Double_t* frequencies);
187 
189 
195  virtual void setFrequency(Int_t i, Double_t frequency);
197 
202 
206  virtual void computeTheoreticalInformation();
207 
209 
213  virtual Double_t getCDF(Double_t x);
214 
216 
226  virtual Double_t getPDF(Double_t x, Double_t precision);
227 
229 
238  virtual Double_t getPDF(Double_t x)
239  {
240  return getPDF(x, 1e-9);
241  }
242 
244 
250  virtual Double_t getInvCDF(Double_t p);
252 
253  //---------------------------------------------
257  virtual void printLog(Option_t *option = "");
259 
260  ClassDef(URANIE::DataServer::TCustomDistribution, ID_DATASERVER)
261 };
262 } // Fin du namespace DataServer
263 } // Fin du namespace URANIE
264 #endif
ROOT.
Definition: TAttribute.h:104
Int_t iNbValues
Definition: TCustomDistribution.h:63
virtual void setValue(Int_t i, Double_t value)
Set a value by index.
Double_t * pValues
Definition: TCustomDistribution.h:65
virtual ~TCustomDistribution()
Default destructor.
virtual void setDistribution(Int_t nbValues, Double_t *values, Double_t *frequencies=NULL)
virtual Double_t * getAllValues()
Get the values as a Double_t array.
Definition: TCustomDistribution.h:116
Class of attributes following a density of probability.
Definition: TDiscreteAttribute.h:68
Double_t * pFrequencies
Definition: TCustomDistribution.h:66
virtual void printLog()
Display information specific to this class.
virtual Double_t getFrequency(Int_t i)
Get a frequency by index.
virtual Double_t getProba(Int_t i)
Return the probability corresponding to the given index.
virtual Int_t getNbValues()
Get the number of values.
Definition: TCustomDistribution.h:110
virtual Double_t getInvCDF(Double_t p)
Returns a value from the distribution.
virtual Double_t getValue(Int_t i)
Get a value by index.
TCustomDistribution()
Default constructor.
virtual void setFrequency(Int_t i, Double_t frequency)
Set a single frequency by index.
virtual Double_t getPDF(Double_t x, Double_t precision)
Returns the probability of a value.
Description of the class TCustomDistribution.
Definition: TCustomDistribution.h:59
virtual Double_t getCDF(Double_t x)
CDF is meaningless for non ordered discrete values.
virtual void setAllValues(Double_t *values)
Set the values as a Double_t array.
virtual void computeTheoreticalInformation()
Mean and Variance are meaningless for non ordered discrete values.
virtual Double_t * getAllFrequencies()
Get the frequencies as a Double_t array.
Definition: TCustomDistribution.h:129
virtual Double_t getPDF(Double_t x)
Returns the probability of a value x, with a precision on x fixed at 1e-9.
Definition: TCustomDistribution.h:238
virtual void setAllFrequencies(Double_t *frequencies)
Set the frequencies as a Double_t array.
Double_t _dSumFreq
Definition: TCustomDistribution.h:64