Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
 All Classes Functions Variables
exponentialDistribution.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 EXPONENTIALDISTRIBUTION_H
17 #define EXPONENTIALDISTRIBUTION_H
18 
19 #include "discreteDistribution.h"
20 
25 class exponentialDistribution : public virtual Distribution {
26 
27 public:
28  // constructors
35  exponentialDistribution( double val ); // creation from a value
36 
37 private:
38  // specific variables
39  double _rate;
41 public:
42  // accessors
48  double rate() { return _rate; }
49 
50 public:
51  // probabilistic member functions
57  double mean() { return _mean; };
58 
62  double moment( int order );
66  double laplace( double s ); // Laplace transform at real points
70  double dLaplace( double s ); // derivative of the Laplace transform
74  double cdf( double x );
81  bool hasMoment( int order );
82 
86  exponentialDistribution *rescale( double factor );
91 
97  double sample();
98 
99  public:
105  std::string toString();
112  void write( FILE *out, int mode );
113 
114 };
115 
116 #endif // EXPONENTIALDISTRIBUTION_H