1 #ifndef sampledprobdenfunc_h 2 #define sampledprobdenfunc_h 36 : cumbins_(0) { *
this = oth; }
38 ArrayNDProbDenFunc& operator =(
const ArrayNDProbDenFunc&);
41 {
return getArrND().info().getSize(dim); }
43 {
return getArrND().info().getTotalSz(); }
46 {
return getArrND(); }
52 {
return getSampling(dim); }
62 float getAveragePos(
int dim)
const;
63 static float findAveragePos(
const float*,
int,
float grandtotal);
69 virtual float getNormFac()
const;
70 virtual void doScale(
float);
75 void prepRndDrw()
const;
76 void fillCumBins()
const;
83 #define mDefArrayNDProbDenFuncFns(nm) \ 84 virtual nm##ProbDenFunc* clone() const \ 85 { return new nm##ProbDenFunc(*this); } \ 86 static const char* typeStr() { return #nm; } \ 87 virtual const char* getTypeStr() const { return typeStr(); } \ 88 virtual float normFac() const { return getNormFac();}\ 89 virtual bool canScale() const { return true; } \ 90 virtual void scale( float f ) { doScale(f); } \ 91 virtual void prepareRandDrawing() const { prepRndDrw(); } \ 92 virtual bool isEq( const ProbDenFunc& oth ) const \ 93 { return gtIsEq(oth); } 116 virtual
void writeBulk(
od_ostream&,
bool binary) const;
117 virtual
bool readBulk(
od_istream&,
bool binary);
129 virtual float gtAvgPos()
const;
130 virtual float gtVal(
float)
const;
131 virtual void drwRandPos(
float&)
const;
154 virtual
void writeBulk(
od_ostream&,
bool binary) const;
155 virtual
bool readBulk(
od_istream&,
bool binary);
159 {
return getAveragePos( dim ); }
169 {
return d ? sd1_ : sd0_; }
171 virtual float gtVal(
float,
float)
const;
172 virtual void drwRandPos(
float&,
float&)
const;
192 virtual void copyFrom(
const ProbDenFunc&);
195 virtual
int nrDims()
const {
return bins_.info().getNDim(); }
196 virtual const char* dimName(
int)
const;
198 { *dimnms_[dim] = nm; }
200 {
return getAveragePos( dim ); }
208 virtual void writeBulk(
od_ostream&,
bool binary)
const;
209 virtual bool readBulk(
od_istream&,
bool binary);
virtual const ArrayND< float > & getData() const
Definition: sampledprobdenfunc.h:45
virtual ArrayND< float > * getArrClone() const
Definition: sampledprobdenfunc.h:203
#define mExpClass(module)
Definition: commondefs.h:160
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:26
Probability Density Function for one dimensional datasets.
Definition: probdenfunc.h:81
virtual ~ArrayNDProbDenFunc()
Definition: sampledprobdenfunc.h:37
virtual void setDimName(int dim, const char *nm)
Definition: sampledprobdenfunc.h:197
virtual const SamplingData< float > & getSampling(int d) const
Definition: sampledprobdenfunc.h:219
float * cumbins_
Definition: sampledprobdenfunc.h:73
#define mDefArrayNDProbDenFuncFns(nm)
Definition: sampledprobdenfunc.h:83
Base class for Probability Density Functions.
Definition: probdenfunc.h:31
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
SamplingData< float > sd1_
Definition: sampledprobdenfunc.h:162
virtual SamplingData< float > & sampling(int dim)
Definition: sampledprobdenfunc.h:53
virtual const SamplingData< float > & getSampling(int) const
Definition: sampledprobdenfunc.h:127
Set of BufferString objects.
Definition: bufstringset.h:28
Array1DImpl< float > bins_
Definition: sampledprobdenfunc.h:122
virtual const ArrayND< float > & getArrND() const
Definition: sampledprobdenfunc.h:217
OD class for stream read.
Definition: od_istream.h:24
Two dimensional PDF based on binned data.
Definition: sampledprobdenfunc.h:140
SamplingData< float > sd_
Definition: sampledprobdenfunc.h:121
virtual const ArrayND< float > & getArrND() const
Definition: sampledprobdenfunc.h:167
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
ArrayNDImpl< float > bins_
Definition: sampledprobdenfunc.h:212
Multi-dimensional PDF based on binned data.
Definition: sampledprobdenfunc.h:183
SamplingData< float > sd0_
Definition: sampledprobdenfunc.h:161
od_uint64 totalSize() const
Definition: sampledprobdenfunc.h:42
virtual float averagePos(int dim) const
Definition: sampledprobdenfunc.h:158
One dimensional PDF based on binned data.
Definition: sampledprobdenfunc.h:100
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
Probability Density Function for two dimensional datasets.
Definition: probdenfunc.h:126
int size(int dim) const
Definition: sampledprobdenfunc.h:40
#define od_uint64
Definition: plftypes.h:37
virtual SamplingData< float > sampling(int dim) const
Definition: sampledprobdenfunc.h:51
BufferStringSet dimnms_
Definition: sampledprobdenfunc.h:213
ArrayNDProbDenFunc(const ArrayNDProbDenFunc &oth)
Definition: sampledprobdenfunc.h:35
TypeSet< SamplingData< float > > sds_
Definition: sampledprobdenfunc.h:211
virtual const SamplingData< float > & getSampling(int d) const
Definition: sampledprobdenfunc.h:168
virtual float averagePos(int dim) const
Definition: sampledprobdenfunc.h:199
Array2DImpl< float > bins_
Definition: sampledprobdenfunc.h:163
ArrayNDProbDenFunc()
Definition: sampledprobdenfunc.h:33
virtual const ArrayND< float > & getArrND() const
Definition: sampledprobdenfunc.h:126
virtual ArrayND< float > & getData()
Definition: sampledprobdenfunc.h:47
PDF based on ArrayND implementation.
Definition: sampledprobdenfunc.h:29