diff --git a/src/root_solver.cpp b/src/root_solver.cpp index 918817d3e..d5d288ebc 100644 --- a/src/root_solver.cpp +++ b/src/root_solver.cpp @@ -89,16 +89,11 @@ void RGFlow::solve() if (models.empty() || max_iterations == 0) return; - // try the following algorithms - ERootFinder_t algorithms[] = { Hybrid// , HybridS - }; - int status = GSL_CONTINUE; - initial_guess(); - - for (unsigned i = 0; i < sizeof(algorithms)/sizeof(*algorithms) - && status != GSL_SUCCESS; i++) { + for (unsigned i = 0; i < NUMBER_OF_ROOT_FINDERS && status != GSL_SUCCESS; + i++) { + initial_guess(); status = find_root(static_cast(i)); } diff --git a/src/root_solver.hpp b/src/root_solver.hpp index c0809b834..29afb2b4a 100644 --- a/src/root_solver.hpp +++ b/src/root_solver.hpp @@ -56,10 +56,8 @@ template<> class RGFlow { public: - /// Note: The Newton and Broyden algorithms will not work if some - /// model parameters are identically zero, as this will lead to a - /// non-invertible Jakobian matrix. - enum ERootFinder_t { Hybrid, HybridS, Broyden, Newton }; + enum ERootFinder_t { Hybrid, HybridS, Broyden, Newton, + NUMBER_OF_ROOT_FINDERS }; RGFlow(); ~RGFlow();