cvarhist.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __CVARHIST_H
00022 #define __CVARHIST_H
00023
00024 #include "chistogram.h"
00025
00026 NAMESPACE_BEGIN
00027
00028
00032 enum {
00033 HIST_TR_NO_TRANSFORM=1,
00034 HIST_TR_AUTO_EPC_DBL=0,
00035 HIST_TR_AUTO_EPC_INT=2
00036 };
00037
00075 class SIM_API cVarHistogram : public cHistogramBase
00076 {
00077 protected:
00078 int transform_type;
00079 int max_num_cells;
00080 double *bin_bounds;
00081
00082
00083
00084
00085
00086 private:
00087 void copy(const cVarHistogram& other);
00088
00089 protected:
00095 void createEquiprobableCells();
00096
00097 public:
00100
00104 cVarHistogram(const cVarHistogram& r) : cHistogramBase(r) {bin_bounds=NULL;copy(r);}
00105
00112 explicit cVarHistogram(const char *name=NULL,
00113 int numcells=11,
00114 int transformtype=HIST_TR_AUTO_EPC_DBL);
00115
00119 virtual ~cVarHistogram();
00120
00124 cVarHistogram& operator=(const cVarHistogram& res);
00126
00129
00134 virtual cVarHistogram *dup() const {return new cVarHistogram(*this);}
00135
00141 virtual void parsimPack(cCommBuffer *buffer);
00142
00148 virtual void parsimUnpack(cCommBuffer *buffer);
00150
00153
00157 virtual void clearResult();
00158
00163 virtual void transform();
00164
00169 virtual void collectTransformed(double val);
00170
00174 virtual double random() const;
00175
00179 virtual double getPDF(double x) const;
00180
00184 virtual double getCDF(double x) const;
00185
00189 virtual double getBasepoint(int k) const;
00190
00194 virtual double getCellValue(int k) const;
00195
00199 virtual void saveToFile(FILE *) const;
00200
00204 virtual void loadFromFile(FILE *);
00206
00209
00216 virtual void addBinBound(double x);
00218 };
00219
00220 NAMESPACE_END
00221
00222
00223 #endif
00224
00225