26#include <antares/logs/logs.h>
27#include <antares/study/study.h>
28#include "antares/solver/ts-generator/xcast/xcast.h"
57static float maximum(
float a,
float b,
float g,
float d,
int l)
71 return (b * (
float(pow(log(1. / NEGLI_WEIB),
double(1. / a))))) - g;
81 return ((
float)(log(1. / NEGLI_GAMM) * a * b)) - g;
96static float esperance(
float a,
float b,
float g,
float d,
int l)
102 return (a * (d - g)) / (a + b);
105 return (d - g) / 2.f;
124static float standard(
float a,
float b,
float g,
float d,
int l)
131 s = s * s * (s + 1.f);
139 return (d - g) / (3.464101615f );
152 <<
"TS Generator: error when computing the standard deviation (Weibul Shape A)";
159 return (
float)(sqrt(a) * b);
170static float diffusion(
float a,
float b,
float g,
float d,
int l,
float t,
float x)
176 return (
float)sqrt(2. * t * x * ((d - g) - x) / (a + b));
180 return (
float)sqrt(t * x * ((d - g) - x));
184 return b * (float)sqrt(2. * t);
191 assert(b != 0 &&
"division by zero");
192 const double v = pow(x / b, a);
193 const double w = exp(v);
195 double y = (w - 1.) *
double(d);
198 y *= x * b * 2. * t / a;
201 logs.info() <<
" square diff: " << y <<
" (Weibul Shape A)";
204 return (
float)sqrt(y);
208 return (
float)sqrt(2. * t * x * b);
251static bool verification(
float a,
float b,
float g,
float d,
int l,
float t)
257 return !(d < g || g < INFININ / 2.f || d > INFINIP / 2.f || t < 0.f || a < 0.f || b < 0.f);
261 return !(d < g || g < INFININ / 2.f || d > INFINIP / 2.f || t < 0.f);
265 return !(d < g || g < INFININ / 2.f || d > INFINIP / 2.f || a < INFININ / 2.f
266 || a > INFINIP / 2.f || t < 0.f || b < 0.f);
270 return !(g < INFININ / 2.f || a < 1.f || a > 50.f || t < 0.f || b <= 0.f);
274 return !(g < INFININ / 2.f || a < 1.f || a > 50.f || t < 0.f || b <= 0.f);
285static float maxiDiffusion(
float a,
float b,
float g,
float d,
int l,
float t)
291 return (
float)((d - g) * sqrt(t / (2. * (a + b))));
295 return (
float)((d - g) * sqrt(t) / 2.);
299 return (
float)(b * sqrt(2. * t));
313 float m = diffusion(a, b, g, d, l, t, x);
314 float y = diffusion(a, b, g, d, l, t, maximum(a, b, g, d, l));
322 x = (float)pow((
double)x, (
double)(1. / a));
324 y = diffusion(a, b, g, d, l, t, x);
334 return diffusion(a, b, g, d, l, t, maximum(a, b, g, d, l));
Distribution
All available probability distribution.
Definition xcast.h:61
@ dtGammaShapeA
The Gamma distribution, of shape A.
Definition xcast.h:73
@ dtNormal
The normal distribution.
Definition xcast.h:69
@ dtMax
The maximum number of distributions.
Definition xcast.h:75
@ dtWeibullShapeA
The Weibul distribution, of shape A.
Definition xcast.h:71
@ dtNone
None.
Definition xcast.h:63
@ dtBeta
The Beta distribution.
Definition xcast.h:67
@ dtUniform
The uniform distribution.
Definition xcast.h:65
static double GammaInc(double s, double z)
Calcul de la forme inférieure de la fonction gamma incomplete.
Definition gamma-inc.cpp:37
static double GammaEuler(double z)
Compute.
Definition gamma-euler.cpp:37