Open PaperOpt
OpenPaperOpt/DistributionComponents.h
Go to the documentation of this file.
00001 
00005 #ifndef DISTRIBUTIONCOMPONENTS_H
00006 #define DISTRIBUTIONCOMPONENTS_H
00007 
00008 
00009 #include <string>
00010 #include <map>
00011 
00012 namespace Distributions
00013 {
00014 
00015         class DistributionComponents
00016         {
00017                 
00018 public:
00019         struct dist; //Forward decl.
00020 // LIFECYCLE
00021 
00022                 
00033                 DistributionComponents(dist* distr, int nrComp, double maxDepth, double totalDepth);
00034 
00038                 ~DistributionComponents(void);
00039 
00040 // OPERATIONS
00041                 
00047                 int GetComponent(double depth);
00056                 int GetComponent(double Depth, double ContactReduction, int Component);
00061                 int GetLastComponent();
00066                 int GetTopComponent();
00070                 int GetBottomComponent();
00071 
00072                 //TODO JavaDoc describe data format here
00073                 struct dist
00074                 {
00075                         int Type;
00076                         std::map<double, double> Probs;
00077                         double TopProb;
00078                         double BottomProb;
00079                 };
00086 private:
00087                 
00088                 dist* mpDistributions;
00089                 int mNumberOfComponents;
00090                 double mTotalDepth;
00091                 double mMaxDepth;
00092         }; // DistributionComponents
00093 
00094 } //Distributions
00095 
00096 #endif // DISTRIBUTIONCOMPONENTS_H