From c0ba29d4a3d52060e7a785b5f0a0ebfa60a19c1e Mon Sep 17 00:00:00 2001 From: nojhan Date: Wed, 19 Oct 2011 11:32:20 +0200 Subject: [PATCH] explicit parenthesis for the assert in edoSamplerUniform --- edo/src/edoSamplerUniform.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/edo/src/edoSamplerUniform.h b/edo/src/edoSamplerUniform.h index 6821e8fa..4edf4323 100644 --- a/edo/src/edoSamplerUniform.h +++ b/edo/src/edoSamplerUniform.h @@ -37,6 +37,12 @@ Authors: * edoSamplerUniform * This class uses the Uniform distribution parameters (bounds) to return * a random position used for population sampling. + * + * Returns a random number in [min,max[ for each variable defined by the given + * distribution. + * + * Note: if the distribution given at call defines a min==max for one of the + * variable, the result will be the same number. */ template < typename EOT, class D = edoUniform > class edoSamplerUniform : public edoSampler< D > @@ -63,7 +69,7 @@ public: double max = distrib.max()[i]; double random = rng.uniform(min, max); - assert( min == random && random == max || min <= random && random < max); // random in [ min, max [ + assert( ( min == random && random == max ) || ( min <= random && random < max) ); // random in [ min, max [ solution.push_back(random); }