00001 #ifndef ModMathH
00002 #define ModMathH
00003
00026 class clModelMath {
00027
00028 friend class clSimManager;
00029 friend class clTestModelMath;
00031 public:
00032
00033
00034
00035
00036
00044 static float CalcPointValue(float fX, float fSlope, float fIntercept=0.0);
00045
00059 static float GetRand();
00060
00067 static float CalculateBasalArea(float fDbh);
00068
00077 static float Round(float fNumber, int iNumDigits);
00078
00088 static int RandomRound(float fNumber);
00089
00099 static float CalculateWeibullFunction(float fDispersal, float fTheta, float fDistance);
00100
00101
00113 static float CalculateLognormalFunction(float fX0, float fXb, float fDistance);
00114
00124 static int PoissonRandomDraw(float fLambda);
00125
00143 static float LognormalRandomDraw(float fMean, float fStdDev);
00144
00157 static float NormalRandomDraw(float fStdDev);
00158
00167 static int NegBinomialRandomDraw(float fMean, float fClumping);
00168
00187 static float AddBarkToDBH(float fDIB, float fA, float fB, float fC);
00188
00206
00207
00227
00231
00235
00239
00240
00250 static float GammaLn(float fX);
00251
00252 private:
00253
00257 static long m_iRandomSeed;
00258
00263 static void SetRandomSeed(long iSeed) {
00264 m_iRandomSeed = iSeed;
00265 }
00266 };
00267 long clModelMath::m_iRandomSeed = -1;
00268
00269 #endif
00270