From 72f18eabae0fcdc9b2f152c129fa9f5386947351 Mon Sep 17 00:00:00 2001 From: timholy Date: Fri, 23 May 2014 13:28:55 -0500 Subject: [PATCH] nelder-mead: check that at least one starting point has finite value --- src/nelder_mead.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nelder_mead.jl b/src/nelder_mead.jl index f29afa619..4952d6295 100644 --- a/src/nelder_mead.jl +++ b/src/nelder_mead.jl @@ -69,6 +69,7 @@ function nelder_mead{T}(f::Function, for i in 1:n @inbounds y[i] = f(p[:, i]) end + any(isfinite(y)) || error("At least one of the starting points must have finite penalty") f_calls += n f_x_previous, f_x = NaN, nmobjective(y, m, n)