Open PaperOpt
OpenPaperOpt/DistributionThreeDimension.h
Go to the documentation of this file.
00001 #ifndef DISTRIBUTIONTHREEDIMENSION_H
00002 #define DISTRIBUTIONTHREEDIMENSION_H
00003 
00004 #include "utilities.h"
00005 #include "Distribution.h"
00006 #include "DistributionThreeDimensionBSP.h"
00016 namespace Distributions
00017 {
00018         class DistributionThreeDimension:public Distribution {
00019         public:
00020                 DistributionThreeDimension();
00021                 ~DistributionThreeDimension();
00022                 
00036                 DistributionThreeDimension(double minx,double maxx,double miny,double maxy,
00037                                                                                 double maxsidex,double maxsidey,int minpoints,double maxSkew,
00038                                                                                 int minPntsZ,double* data,int numData,int dataDist); 
00039 
00040                 int  GetNum3dPatches(int FillBorders) {return mNumLief*(FillBorders?5:1);}
00041                 void Buid3dPatchSet(int FillBorders,double* x,double* y,double* z,int count);
00042                 
00043                 //int GetDataSize();
00044 
00045                 double  GenerateRandomNumber(double len ,double *rnd);
00046 
00047                 
00048         
00049         protected:
00050                 void   BuildScalerTree();
00051                 double GetScaler(double y);
00052 
00053         private:
00054 
00060                 double InvF(double X,double y,double* z=0); 
00061                 double rec_InvF(double minx,double maxx,double miny,double maxy,double Xleft,
00062                                                 double y,DistributionThreeDimensionBSP* tree,double* value,ZDist* bestzd,ZDist** zd);
00063 
00064                 double rec_GetScaler(double miny,double maxy,double targety,void** tre);
00065 
00066                 void rec_BuildScalerTree(DistributionThreeDimensionBSP* src,TreeNode* tre,double minx,double maxx,int* splitCnt);
00067                 void rec_IntScalerTree(TreeNode* tre,double sum,void*** ary_tre,double** ary_dta);
00068 
00069                 DistributionThreeDimensionBSP* RecBuild2D(double minx,double maxx,double miny,double maxy,
00070                                                                                                         fsamplesiter begin,fsamplesiter end,double maxsidex,
00071                                                                                                   double maxsidey,int minpoints,double maxSkew,int* liefCntr,int minPntsZ);
00072 
00073                 double    mMinX,mMaxX;
00074                 double    mMinY,mMaxY;
00075                 int      mNumLief; //Number of lief nodes in hierarchy
00080                 DistributionThreeDimensionBSP* mTree;    
00081                 
00082                 //Storage of 1/weights(y)
00083                 AutoDelete<void*>  mYWTree; //Tree-structure, lobit set->ptr to mYWData
00084                 AutoDelete<double> mYWData; //Data
00085                 int                mYWSize; //Total datasize allocated for structure
00086         };
00087 }
00088 #endif