wfmath  1.0.3
A math library for the Worldforge system.
probability.h
1 // probability.h (probability and statistics functions)
2 //
3 // The WorldForge Project
4 // Copyright (C) 2002 The WorldForge Project
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 //
20 // For information about WorldForge and its authors, please contact
21 // the Worldforge Web Site at http://www.worldforge.org.
22 
23 // Author: Ron Steinke
24 // Created: 2002-1-23
25 
26 // These functions will use double instead of CoordType, for accuracy
27 
28 #ifndef WFMATH_PROBABILTIY_H
29 #define WFMATH_PROBABILTIY_H
30 
31 namespace WFMath {
32 
34 
40 template<typename FloatT>
41 FloatT GaussianConditional(FloatT mean, FloatT stddev, FloatT val);
43 template<typename FloatT>
44 FloatT Gaussian(FloatT mean, FloatT stddev, FloatT val);
45 
47 
51 template<typename FloatT>
52 FloatT PoissonConditional(FloatT mean, unsigned int step);
54 template<typename FloatT>
55 FloatT Poisson(FloatT mean, unsigned int step);
56 
58 template<typename FloatT>
59 FloatT LogFactorial(unsigned int n);
61 template<typename FloatT>
62 FloatT Factorial(unsigned int n);
63 
65 template<typename FloatT>
66 FloatT LogGamma(FloatT z);
68 template<typename FloatT>
69 FloatT Gamma(FloatT z);
70 
71 } // namespace WFMath
72 
73 #endif // WFMATH_PROBABILITY_H
WFMath::LogFactorial
FloatT LogFactorial(unsigned int n)
Gives the natural log of n!
Definition: probability.cpp:157
WFMath::Poisson
FloatT Poisson(FloatT mean, unsigned int step)
Gives the value of the Poisson distribution at position step.
Definition: probability.cpp:109
WFMath::Gaussian
FloatT Gaussian(FloatT mean, FloatT stddev, FloatT val)
Gives the value of the Gaussian distribution at position val.
Definition: probability.cpp:78
WFMath::PoissonConditional
FloatT PoissonConditional(FloatT mean, unsigned int step)
Gives the conditional probability of the Poisson distribution at position step.
Definition: probability.cpp:90
WFMath::LogGamma
FloatT LogGamma(FloatT z)
The natural log of Euler's Gamma function.
Definition: probability.cpp:184
WFMath
Generic library namespace.
Definition: shape.h:41
WFMath::Gamma
FloatT Gamma(FloatT z)
Euler's Gamma function.
Definition: probability.cpp:173
WFMath::Factorial
FloatT Factorial(unsigned int n)
Gives n!
Definition: probability.cpp:141
WFMath::GaussianConditional
FloatT GaussianConditional(FloatT mean, FloatT stddev, FloatT val)
Gives the conditional probability of the Gaussian distribution at position val.
Definition: probability.cpp:51