Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
 All Classes Functions Variables
diracDistribution.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 diracDistribution_H
17 #define diracDistribution_H
18 
19 #include "discreteDistribution.h"
20 
26 class diracDistribution : public virtual discreteDistribution {
27 
28 public:
34  diracDistribution( double val ); // creation from a value
35 
36 private:
37  // specific variables
38  double _value;
40 public:
41  // accessors to specific variables
47  double value(int) { return _value; };
48 
49 public:
50  // probabilistic member functions
54  double mean();
58  double rate();
62  double moment( int order );
67  double variance();
71  double laplace( double s ); // Laplace transform at real points
75  double dLaplace( double s ); // derivative of the Laplace transform
79  double cdf( double x );
83  bool hasMoment( int order );
84 
88  diracDistribution *rescale( double factor );
93 
97  double sample();
104  void iidSample( int n, double* s );
105 
106  public:
110  std::string toString();
114  void write( FILE *out, int mode );
115 
116 };
117 
118 #endif // diracDistribution_H