WFMath  1.0.2
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., 675 Mass Ave, Cambridge, MA 02139, 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
Generic library namespace.
Definition: atlasconv.h:45
FloatT Gamma(FloatT z)
Euler&#39;s Gamma function.
FloatT Factorial(unsigned int n)
Gives n!
FloatT GaussianConditional(FloatT mean, FloatT stddev, FloatT val)
Gives the conditional probability of the Gaussian distribution at position val.
FloatT LogFactorial(unsigned int n)
Gives the natural log of n!
FloatT Poisson(FloatT mean, unsigned int step)
Gives the value of the Poisson distribution at position step.
FloatT Gaussian(FloatT mean, FloatT stddev, FloatT val)
Gives the value of the Gaussian distribution at position val.
FloatT PoissonConditional(FloatT mean, unsigned int step)
Gives the conditional probability of the Poisson distribution at position step.
FloatT LogGamma(FloatT z)
The natural log of Euler&#39;s Gamma function.