commit 66ce67f7e30b0f25b3ebc598af555bb8ab9b152b
parent 9b86463a105129d51d5d5a3b47d3020b3befa02d
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Wed, 19 May 2021 12:43:03 +0200
Fix asserts
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/ssp_ran.c b/src/ssp_ran.c
@@ -49,7 +49,7 @@ cosf2sinf(const float d)
double
ssp_ran_exp(struct ssp_rng* rng, const double mu)
{
- ASSERT(rng && mu >= 0);
+ ASSERT(rng && mu > 0);
rng_cxx rng_cxx(*rng);
RAN_NAMESPACE::exponential_distribution<double> distribution(mu);
return distribution(rng_cxx);
@@ -58,7 +58,7 @@ ssp_ran_exp(struct ssp_rng* rng, const double mu)
float
ssp_ran_exp_float(struct ssp_rng* rng, const float mu)
{
- ASSERT(rng && mu >= 0);
+ ASSERT(rng && mu > 0);
rng_cxx rng_cxx(*rng);
RAN_NAMESPACE::exponential_distribution<float> distribution(mu);
return distribution(rng_cxx);
@@ -67,14 +67,14 @@ ssp_ran_exp_float(struct ssp_rng* rng, const float mu)
double
ssp_ran_exp_pdf(const double x, const double mu)
{
- ASSERT(x >= 0 && mu >= 0);
+ ASSERT(x >= 0 && mu > 0);
return mu * exp(-x * mu);
}
float
ssp_ran_exp_float_pdf(const float x, const float mu)
{
- ASSERT(x >= 0 && mu >= 0);
+ ASSERT(x >= 0 && mu > 0);
return mu * expf(-x * mu);
}