* maximal number of iterations.
* </OL>
*/
- enum State {
+ enum State
+ {
iterate = 0, success, failure
};
* be checked and the number of
* the iteration step) shall be
* printed to #deallog# stream.
- * Default is: do not print.
+ * Default is: do not print. Similarly,
+ * #log_result#
+ * specifies the whether the final result is logged
+ * to #deallog#. Default is yes.
*/
SolverControl (const unsigned int n, const double tol,
- const bool log_history = false);
+ const bool log_history = false,
+ const bool log_result = true);
/**
* Virtual destructor is needed
* Log convergence history to #deallog#?
*/
const bool log_history;
+ /**
+ * Log iteration result to #deallog#?
+ * If true, after finishing the iteration, a
+ * statement about failure or success together with
+ * #lstep# and #lvalue# are logged.
+ */
+ const bool log_result;
};
SolverControl::SolverControl (const unsigned int maxiter,
const double tolerance,
- const bool log_history) :
+ const bool log_history,
+ const bool log_result) :
maxsteps(maxiter),
tol(tolerance),
lvalue(1.e300),
lstep(0),
- log_history(log_history)
+ log_history(log_history),
+ log_result(log_result)
{};
lvalue = check_value;
if (step>=maxsteps)
{
- deallog << "Failure step " << step
- << " value " << check_value << endl;
+ if (log_result)
+ deallog << "Failure step " << step
+ << " value " << check_value << endl;
return failure;
}
if (check_value <= tol)
{
- deallog << "Convergence step " << step
- << " value " << check_value << endl;
+ if (log_result)
+ deallog << "Convergence step " << step
+ << " value " << check_value << endl;
return success;
}
return iterate;