Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
 All Classes Functions Variables
uniformDistribution.h
1 /* Marmote is free software: you can redistribute it and/or modify
2 it under the terms of the GNU General Public License as published by
3 the Free Software Foundation, either version 3 of the License, or
4 (at your option) any later version.
5 
6 Marmote is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 GNU General Public License for more details.
10 
11 You should have received a copy of the GNU General Public License
12 along with Marmote. If not, see <http://www.gnu.org/licenses/>.
13 
14 Copyright 2015 Alain Jean-Marie, Jean-Michel Fourneau, Jean-Marc Vincent, Issam Rabhi */
15 
16 #ifndef uniformDistribution_H
17 #define uniformDistribution_H
18 
19 #include "Distribution.h"
20 
25 class uniformDistribution : public virtual Distribution {
26 
27  public:
31  uniformDistribution( double, double );
32 
33 private:
34  double _valInf;
35  double _valSup;
36  double _span;
37  bool _isConstant;
39 public:
40  // accessors to specific variables
46  double valInf();
52  double valSup();
53 
54  public: // probabilistic member functions
58  double mean();
62  double rate();
66  double moment( int order );
70  double variance();
74  double laplace( double s );
78  double dLaplace( double s ); // derivative of the Laplace transform
82  double cdf( double x );
86  double ccdf( double x );
90  bool hasMoment( int order);
91 
95  uniformDistribution *rescale( double factor );
103  double sample();
107  void iidSample( int n, double* s );
108 
109  public:
113  std::string toString();
117  void write( FILE *out, int mode );
118 
119 };
120 
121 #endif // uniformDistribution_H