explicit parenthesis for the assert in edoSamplerUniform
This commit is contained in:
parent
ea98e9b3f4
commit
c0ba29d4a3
1 changed files with 7 additions and 1 deletions
|
|
@ -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<EOT> >
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue