8 #include "../marmoteConstants.h"
11 #define INFINITE_DURATION HUGE_VAL
12 #define INFINITE_RATE HUGE_VAL
15 #define NO_PRINT_MODE 0
16 #define DEFAULT_PRINT_MODE 1
17 #define NORMAL_PRINT_MODE 1
18 #define QNAP_PRINT_MODE 2
19 #define PROSIT_PRINT_MODE 3
20 #define MMPP_PRINT_MODE 4
21 #define PNED_PRINT_MODE 5
22 #define MAPLE_PRINT_MODE 6
60 virtual double mean() = 0;
66 virtual double rate() = 0;
73 virtual double moment(
int order ) = 0;
89 virtual double laplace(
double s ) = 0;
96 virtual double dLaplace(
double s ) = 0;
104 virtual double cdf(
double x ) = 0;
114 double ccdf(
double x ) {
return 1.0 -
cdf(x); };
146 virtual double sample() = 0;
191 static double u_0_1(
void);
215 virtual void write( FILE *out,
int mode ) = 0;
228 #endif // DISTRIBUTION_H
virtual bool hasMoment(int order)=0
test for the existence of moments of any order
virtual double moment(int order)=0
Computing the moments of the distribution.
virtual double rate()=0
computing the "rate", defined as the inverse of the mean
void iidSample(int n, double *s)
drawing an i.i.d. sample from the distribution. The result is returned in an array (that must have be...
Definition: Distribution.cpp:31
std::string name()
Read accessor to the type name of the distribution.
Definition: Distribution.h:51
A class for representing probability distributions.
Definition: Distribution.h:44
double ccdf(double x)
computing the complementary cumulative distributon function (or tail) at some real point x...
Definition: Distribution.h:114
virtual std::string toString()=0
an utility to convert the distribution into a string.
virtual void write(FILE *out, int mode)=0
an utility to write the distribution to some file, according to some format.
double variance()
Computing the variance of the random variable: the second moment minus the square of the first moment...
Definition: Distribution.cpp:25
virtual Distribution * copy()=0
copying a distribution. Typically implemented as rescale(1.0).
std::string _name
Definition: Distribution.h:47
virtual double distanceL1(Distribution *d)
Computing generally the L1 distance between distributions.
Definition: Distribution.cpp:51
virtual ~Distribution()
Standard destructor.
Definition: Distribution.h:42
virtual double laplace(double s)=0
computing the Laplace transform of the distribution at real point
virtual bool hasProperty(std::string pro)
Property test function. Current properties are:
Definition: Distribution.cpp:100
virtual double mean()=0
computing the mathematical expectation or mean
static double exponential(double mean)
Definition: Distribution.cpp:45
virtual double cdf(double x)=0
computing the cumulative distribution function at some real point x. This is the probability that the...
virtual Distribution * rescale(double factor)=0
rescaling a distribution by some real factor. Not all distributions allow this for any real factor...
virtual double dLaplace(double s)=0
computing the derivative of the Laplace transform at real points
static double u_0_1(void)
Definition: Distribution.cpp:39
virtual double sample()=0
drawing a (pseudo)random value according to the distribution.
double _mean
Definition: Distribution.h:239
void fprint()
write on stdout with NORMAL_PRINT_MODE
Definition: Distribution.h:221