00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ACDCGenCell_H
00010 #define ACDCGenCell_H
00011
00012 #include "ACDCGenConfig.h"
00013 #include "ACDCTraits.h"
00014
00015 namespace ACDCGenerator {
00016
00017 struct ACDCGenCellInfo;
00018
00020 class ACDCGenCell {
00021
00022 public:
00023
00027 inline ACDCGenCell(double newG);
00028
00032 inline ACDCGenCell(double newG, double newV);
00033
00037 inline ~ACDCGenCell();
00038
00048 template <typename RndType>
00049 inline ACDCGenCell * generate(DVector & lo, DVector & up, RndType * rnd);
00050
00061 inline ACDCGenCell * generate(DVector & lo, DVector & up, DVector & rndv);
00062
00069 inline ACDCGenCell * getCell(DVector & lo, const DVector & x, DVector & up);
00070
00076 inline void smooth(double frac);
00077
00081 inline bool isSplit() const;
00082
00088 inline double doMaxInt(double rescale = 1.0);
00089
00094 inline double maxInt() const;
00095
00101 inline void splitme(double lo, double newDiv, double up, DimType newDim);
00102
00106 inline void g(double newG);
00107
00111 inline double g() const;
00112
00116 inline double v() const;
00117
00122 inline DimType dim() const;
00123
00128 inline double div() const;
00129
00133 inline ACDCGenCell * upper() const;
00134
00138 inline ACDCGenCell * lower() const;
00139
00144 inline int nBins() const;
00145
00149 inline int depth() const;
00150
00158 inline void extract(DVector & lo, DVector & up,
00159 vector<ACDCGenCellInfo> & v) const;
00160
00164 inline long getIndex(const ACDCGenCell * c) const;
00165
00170 inline long getIndex(const ACDCGenCell * c, long & indx) const;
00171
00175 inline ACDCGenCell * getCell(long i);
00176
00181 inline ACDCGenCell * getCell(long i, long & indx);
00182
00183 public:
00184
00190 double theG;
00191
00195 double theV;
00196
00200 ACDCGenCell * theUpper;
00201
00205 ACDCGenCell * theLower;
00206
00210 double theDivision;
00211
00215 DimType theSplitDimension;
00216
00217 private:
00218
00222 ACDCGenCell();
00223
00227 ACDCGenCell(const ACDCGenCell &);
00228
00232 ACDCGenCell & operator=(const ACDCGenCell &);
00233
00234 };
00235
00236
00242 struct ACDCGenCellInfo {
00243
00245 typedef vector<ACDCGenCellInfo>::size_type Index;
00246
00250 double g;
00251
00255 double v;
00256
00260 DVector up;
00264 DVector lo;
00265
00270 Index iup;
00271
00276 Index ilo;
00277
00278 };
00279
00280 }
00281
00282 #include "ACDCGenCell.icc"
00283
00284 #endif