1 #ifndef gaussianprobdenfunc_h 2 #define gaussianprobdenfunc_h 22 namespace Stats {
class NormalRandGen; }
27 {
return "Correlation coefficients should be in range <-1,1>.\n" 28 "Maximum correlation is 0.99999."; }
30 #define mDefGaussianProbDenFuncFns(nm) \ 32 nm##ProbDenFunc& operator =(const nm##ProbDenFunc&); \ 33 virtual nm##ProbDenFunc* clone() const \ 34 { return new nm##ProbDenFunc(*this); } \ 35 virtual void copyFrom(const ProbDenFunc&); \ 36 static const char* typeStr() { return #nm; } \ 37 virtual const char* getTypeStr() const { return typeStr(); } \ 38 virtual void fillPar(IOPar&) const; \ 39 virtual bool usePar(const IOPar&); \ 40 virtual bool isEq(const ProbDenFunc&) const; 51 : rgen_(0), exp_(exp), std_(stdev) {}
53 : rgen_(0) { *
this = oth; }
62 mutable
Stats::NormalRandGen* rgen_;
64 virtual
float gtAvgPos()
const {
return exp_; }
65 virtual float gtVal(
float)
const;
66 virtual void drwRandPos(
float&)
const;
78 : rgen0_(0), rgen1_(0)
80 , std0_(1), std1_(1), cc_(0) {}
82 : rgen0_(0), rgen1_(0) { *
this = oth; }
86 virtual
float averagePos(
int dim )
const 87 {
return dim ? exp1_ : exp0_; }
98 virtual float gtVal(
float,
float)
const;
99 virtual void drwRandPos(
float&,
float&)
const;
115 virtual
int nrDims()
const {
return vars_.size(); }
116 virtual const char* dimName(
int)
const;
117 virtual void setDimName(
int,
const char*);
118 virtual float averagePos(
int)
const;
120 void prepareRandDrawing()
const;
129 VarDef(
const char* nm,
float e=0,
float s=1 )
130 : name_(nm), exp_(e), std_(s) {}
132 {
return name_ == vd.
name_; }
142 Corr(
int i0=0,
int i1=0,
float cc=1 )
143 : idx0_(i0), idx1_(i1), cc_(cc) {}
145 {
return (idx0_ == oth.
idx0_ && idx1_ == oth.
idx1_)
146 || (idx0_ == oth.
idx1_ && idx1_ == oth.
idx0_); }
156 const char* firstUncorrelated()
const;
#define mExpClass(module)
Definition: commondefs.h:160
TypeSet< VarDef > vars_
Definition: gaussianprobdenfunc.h:153
Definition: statrand.h:77
Probability Density Function for one dimensional datasets.
Definition: probdenfunc.h:81
Gaussian1DProbDenFunc(float exp=0, float stdev=1)
Definition: gaussianprobdenfunc.h:50
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
Base class for Probability Density Functions.
Definition: probdenfunc.h:31
const char * sGaussianCCRangeErrMsg()
Definition: gaussianprobdenfunc.h:26
Two dimensional Gaussian PDF.
Definition: gaussianprobdenfunc.h:73
ObjectSet< Stats::NormalRandGen > rgens_
Definition: gaussianprobdenfunc.h:162
Matrix class based on Array2D. Initialized to 0.
Definition: array2dmatrix.h:32
float cc_
Definition: gaussianprobdenfunc.h:149
int idx1_
Definition: gaussianprobdenfunc.h:148
float std1_
Definition: gaussianprobdenfunc.h:90
Set of pointers to objects.
Definition: commontypes.h:32
int idx0_
Definition: gaussianprobdenfunc.h:148
#define mDefGaussianProbDenFuncFns(nm)
Definition: gaussianprobdenfunc.h:30
ObjectSet< TypeSet< int > > corrs4vars_
Definition: gaussianprobdenfunc.h:161
One dimensional Gaussian PDF.
Definition: gaussianprobdenfunc.h:46
float exp1_
Definition: gaussianprobdenfunc.h:89
Multi-dimensional pure Gaussian PDF.
Definition: gaussianprobdenfunc.h:106
Gaussian1DProbDenFunc(const Gaussian1DProbDenFunc &oth)
Definition: gaussianprobdenfunc.h:52
TypeSet< Corr > corrs_
Definition: gaussianprobdenfunc.h:154
Array2DMatrix< float > * cholesky_
Definition: gaussianprobdenfunc.h:163
Probability Density Function for two dimensional datasets.
Definition: probdenfunc.h:126
float std_
Definition: gaussianprobdenfunc.h:136
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
GaussianNDProbDenFunc(const GaussianNDProbDenFunc &oth)
Definition: gaussianprobdenfunc.h:111
Definition: gaussianprobdenfunc.h:125
VarDef(const char *nm, float e=0, float s=1)
Definition: gaussianprobdenfunc.h:129
float exp_
Definition: gaussianprobdenfunc.h:135
Statistics.
Definition: array2dinterpol.h:28
Definition: gaussianprobdenfunc.h:139
Stats::NormalRandGen * rgen1_
Definition: gaussianprobdenfunc.h:96
float cc_
Definition: gaussianprobdenfunc.h:91
Corr(int i0=0, int i1=0, float cc=1)
Definition: gaussianprobdenfunc.h:142
Gaussian2DProbDenFunc()
Definition: gaussianprobdenfunc.h:77
float cMaxGaussianCC()
Definition: gaussianprobdenfunc.h:25
BufferString name_
Definition: gaussianprobdenfunc.h:134
Gaussian2DProbDenFunc(const Gaussian2DProbDenFunc &oth)
Definition: gaussianprobdenfunc.h:81
Stats::NormalRandGen * rgen0_
Definition: gaussianprobdenfunc.h:95