comparison DEPENDENCIES/generic/include/boost/math/tools/roots.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
107 // Error checking: 107 // Error checking:
108 // 108 //
109 static const char* function = "boost::math::tools::bisect<%1%>"; 109 static const char* function = "boost::math::tools::bisect<%1%>";
110 if(min >= max) 110 if(min >= max)
111 { 111 {
112 policies::raise_evaluation_error(function, 112 return boost::math::detail::pair_from_single(policies::raise_evaluation_error(function,
113 "Arguments in wrong order in boost::math::tools::bisect (first arg=%1%)", min, pol); 113 "Arguments in wrong order in boost::math::tools::bisect (first arg=%1%)", min, pol));
114 } 114 }
115 if(fmin * fmax >= 0) 115 if(fmin * fmax >= 0)
116 { 116 {
117 policies::raise_evaluation_error(function, 117 return boost::math::detail::pair_from_single(policies::raise_evaluation_error(function,
118 "No change of sign in boost::math::tools::bisect, either there is no root to find, or there are multiple roots in the interval (f(min) = %1%).", fmin, pol); 118 "No change of sign in boost::math::tools::bisect, either there is no root to find, or there are multiple roots in the interval (f(min) = %1%).", fmin, pol));
119 } 119 }
120 120
121 // 121 //
122 // Three function invocations so far: 122 // Three function invocations so far:
123 // 123 //
300 BOOST_MATH_INSTRUMENT_VARIABLE(f1); 300 BOOST_MATH_INSTRUMENT_VARIABLE(f1);
301 BOOST_MATH_INSTRUMENT_VARIABLE(f2); 301 BOOST_MATH_INSTRUMENT_VARIABLE(f2);
302 302
303 if(0 == f0) 303 if(0 == f0)
304 break; 304 break;
305 if((f1 == 0) && (f2 == 0)) 305 if(f1 == 0)
306 { 306 {
307 // Oops zero derivative!!! 307 // Oops zero derivative!!!
308 #ifdef BOOST_MATH_INSTRUMENT 308 #ifdef BOOST_MATH_INSTRUMENT
309 std::cout << "Halley iteration, zero derivative found" << std::endl; 309 std::cout << "Halley iteration, zero derivative found" << std::endl;
310 #endif 310 #endif