Commit 3cf6a515 authored by Sebastian Heimann's avatar Sebastian Heimann

fix problem with normal distributions with zero standard deviation

parent 5a541d39
......@@ -1253,8 +1253,12 @@ def solve(problem,
for i in xrange(npar):
ntry = 0
while True:
v = num.random.normal(
xb[i], math.sqrt(factor)*sbx[i])
if sbx[i] > 0.:
v = num.random.normal(
xb[i], math.sqrt(factor)*sbx[i])
else:
v = xb[i]
if xbounds[i, 0] <= v and v <= xbounds[i, 1]:
break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment