201 std::cout << std::string(80,
'-') << std::endl;
202 std::cout << std::setw(7) <<
"Search "
203 << std::setw(4) <<
"i "
204 << std::setw(15) <<
"f"
205 << std::setw(15) <<
"crit"
207 std::cout << std::string(80,
'-') << std::endl;
215 float previous_value;
221 std::cout << std::setw(7) <<
"N"
223 << std::setw(15) << std::setprecision(5) << current_value
224 << std::setw(15) << std::setprecision(5) <<
""
231 previous_x = current_x;
232 previous_value = current_value;
242 crit_value = std::abs( current_value - previous_value );
244 crit_value /= std::abs( previous_value );
249 std::cout << std::setw(7) <<
"N"
251 << std::setw(15) << std::setprecision(5) << current_value
252 << std::setw(15) << std::setprecision(5) << crit_value
253 << std::string( ok ?
" OK" :
" C" )
260 std::cout <<
"Maximum number of iterations reached." << std::endl;