Improve Summary::FullReport when line search is used.

Disable reporting of preconditioner when direct factorization
is being used.

Change-Id: Id264d2292c5cab608724a6a8fab5d588db950468
This commit is contained in:
Sameer Agarwal
2013-07-01 08:01:01 -07:00
parent 09244015e3
commit 4f010b2db0
3 changed files with 40 additions and 18 deletions
+33 -18
View File
@@ -152,6 +152,7 @@ string Solver::Summary::BriefReport() const {
};
using internal::StringAppendF;
using internal::StringPrintf;
string Solver::Summary::FullReport() const {
string report =
@@ -224,9 +225,6 @@ string Solver::Summary::FullReport() const {
StringAppendF(&report, "Preconditioner %25s%25s\n",
PreconditionerTypeToString(preconditioner_type),
PreconditionerTypeToString(preconditioner_type));
} else {
StringAppendF(&report, "Preconditioner %25s%25s\n",
"N/A", "N/A");
}
StringAppendF(&report, "Threads % 25d% 25d\n",
@@ -266,18 +264,29 @@ string Solver::Summary::FullReport() const {
} else {
// LINE_SEARCH HEADER
StringAppendF(&report, "\nMinimizer %19s\n", "LINE_SEARCH");
if (line_search_direction_type == LBFGS) {
StringAppendF(&report, "Line search direction %19s(%d)\n",
LineSearchDirectionTypeToString(line_search_direction_type),
max_lbfgs_rank);
} else {
StringAppendF(&report, "Line search direction %19s\n",
LineSearchDirectionTypeToString(
line_search_direction_type));
}
StringAppendF(&report, "Line search type %19s\n",
LineSearchTypeToString(line_search_type));
string line_search_direction_string;
if (line_search_direction_type == LBFGS) {
line_search_direction_string = StringPrintf("LBFGS (%d)", max_lbfgs_rank);
} else if (line_search_direction_type == NONLINEAR_CONJUGATE_GRADIENT) {
line_search_direction_string =
NonlinearConjugateGradientTypeToString(
nonlinear_conjugate_gradient_type);
} else {
line_search_direction_string =
LineSearchDirectionTypeToString(line_search_direction_type);
}
StringAppendF(&report, "Line search direction %19s\n",
line_search_direction_string.c_str());
const string line_search_type_string =
StringPrintf("%s %s",
LineSearchInterpolationTypeToString(line_search_interpolation_type),
LineSearchTypeToString(line_search_type));
StringAppendF(&report, "Line search type %19s\n",
line_search_type_string.c_str());
StringAppendF(&report, "\n");
StringAppendF(&report, "%45s %21s\n", "Given", "Used");
@@ -307,10 +316,16 @@ string Solver::Summary::FullReport() const {
StringAppendF(&report, "\nMinimizer iterations % 16d\n",
num_successful_steps + num_unsuccessful_steps);
StringAppendF(&report, "Successful steps % 14d\n",
num_successful_steps);
StringAppendF(&report, "Unsuccessful steps % 14d\n",
num_unsuccessful_steps);
// Successful/Unsuccessful steps only matter in the case of the
// trust region solver. Line search terminates when it encounters
// the first unsuccessful step.
if (minimizer_type == TRUST_REGION) {
StringAppendF(&report, "Successful steps % 14d\n",
num_successful_steps);
StringAppendF(&report, "Unsuccessful steps % 14d\n",
num_unsuccessful_steps);
}
if (inner_iterations_used) {
StringAppendF(&report, "Steps with inner iterations % 14d\n",
num_inner_iteration_steps);