40 virtual const char* getTypeStr()
const = 0;
41 virtual int nrDims()
const = 0;
42 virtual const char* dimName(
int dim)
const = 0;
43 virtual void setDimName(
int dim,
const char*) = 0;
44 virtual float averagePos(
int dim)
const = 0;
49 virtual float normFac()
const {
return 1; }
57 virtual bool isCompatibleWith(
const ProbDenFunc&)
const;
64 static const char* sKeyNrDim();
85 virtual void copyFrom(
const ProbDenFunc& pdf )
88 virtual int nrDims()
const {
return 1; }
89 virtual const char*
dimName(
int)
const {
return varName(); }
91 {
if ( !dim ) varnm_ = nm; }
93 virtual const char*
varName()
const {
return varnm_; }
95 virtual float averagePos(
int)
const {
return gtAvgPos(); }
96 inline float value(
float v )
const {
return gtVal( v ); }
98 {
return gtVal( v[0] ); }
103 { v.
setSize(1); drwRandPos( v[0] ); }
113 , varnm_(pdf.varnm_) {}
115 virtual float gtAvgPos()
const = 0;
116 virtual float gtVal(
float)
const = 0;
117 virtual void drwRandPos(
float&)
const = 0;
132 setName(pdf.
name()); }
135 virtual const char* dimName(
int)
const;
137 {
if ( dim < 2 ) (dim ? dim1nm_ : dim0nm_) = nm; }
139 float value(
float x1,
float x2 )
const 140 {
return gtVal( x1, x2 ); }
142 {
return gtVal( v[0], v[1] ); }
145 { drwRandPos( x1, x2 ); }
147 { v.
setSize(2); drwRandPos( v[0], v[1] ); }
155 const char* vnm1=
"Dim 1" )
156 : dim0nm_(vnm0), dim1nm_(vnm1) {}
159 , dim0nm_(pdf.dim0nm_)
160 , dim1nm_(pdf.dim1nm_) {}
163 virtual float gtVal(
float,
float)
const = 0;
164 virtual void drwRandPos(
float&,
float&)
const = 0;
void drawRandomPos(float &x1, float &x2) const
Definition: probdenfunc.h:144
#define mExpClass(module)
Definition: commondefs.h:160
virtual const char * dimName(int) const
Definition: probdenfunc.h:89
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 void drawRandomPos(TypeSet< float > &v) const
Definition: probdenfunc.h:102
virtual ~ProbDenFunc()
Definition: probdenfunc.h:36
virtual void setDimName(int dim, const char *nm)
Definition: probdenfunc.h:90
Base class for Probability Density Functions.
Definition: probdenfunc.h:31
virtual void prepareRandDrawing() const
Definition: probdenfunc.h:62
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
virtual void copyFrom(const ProbDenFunc &pdf)
Definition: probdenfunc.h:130
ProbDenFunc2D(const char *vnm0="Dim 0", const char *vnm1="Dim 1")
Definition: probdenfunc.h:154
virtual float value(const TypeSet< float > &v) const
Definition: probdenfunc.h:97
ProbDenFunc1D(const ProbDenFunc1D &pdf)
Definition: probdenfunc.h:111
ProbDenFunc1D(const char *vnm="")
Definition: probdenfunc.h:109
float value(float v) const
Definition: probdenfunc.h:96
virtual void drawRandomPos(TypeSet< float > &v) const
Definition: probdenfunc.h:146
OD class for stream read.
Definition: od_istream.h:24
virtual const char * dimName(int dim) const =0
void drawRandomPos(float &v) const
Definition: probdenfunc.h:100
virtual int nrDims() const
Definition: probdenfunc.h:88
BufferString dim0nm_
Definition: probdenfunc.h:149
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
virtual float value(const TypeSet< float > &v) const
Definition: probdenfunc.h:141
BufferString dim1nm_
Definition: probdenfunc.h:150
virtual bool readBulk(od_istream &, bool binary)
Definition: probdenfunc.h:55
virtual void setDimName(int dim, const char *nm)
Definition: probdenfunc.h:136
virtual float averagePos(int) const
Definition: probdenfunc.h:95
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
virtual float normFac() const
Definition: probdenfunc.h:49
virtual void copyFrom(const ProbDenFunc &pdf)
Definition: probdenfunc.h:85
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Object with a name.
Definition: namedobj.h:35
virtual bool setSize(size_type, T val=T())
Definition: typeset.h:258
virtual void scale(float)
Definition: probdenfunc.h:48
virtual const char * varName() const
Definition: probdenfunc.h:93
ProbDenFunc()
Definition: probdenfunc.h:68
ProbDenFunc2D(const ProbDenFunc2D &pdf)
Definition: probdenfunc.h:157
virtual const OD::String & name() const
Definition: namedobj.h:47
float value(float x1, float x2) const
Definition: probdenfunc.h:139
BufferString varnm_
Definition: probdenfunc.h:105
virtual bool canScale() const
Definition: probdenfunc.h:47
virtual void writeBulk(od_ostream &, bool binary) const
Definition: probdenfunc.h:54
virtual int nrDims() const
Definition: probdenfunc.h:134