Two bug fixes.

1. Add schur_templates.cc to Android.mk
2. When detecting the Schur structure of the Jacobian,
   the check for whether linear solver being used is indeed
   of Schur type or not, should use the LinearSolver::Options
   struct created and populated by the preprocessor rather than
   depending on the value in the input Solver::Options. The reason
   is that the preprocessor may change the linear solver type
   depending on the lack of a Schur structure in the problem.

Change-Id: I6f018f6817c05d704409181c7b1e25155528ab84
This commit is contained in:
Sameer Agarwal
2017-02-27 14:58:47 -08:00
parent 784260d0b8
commit 1ebaff8a10
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -382,7 +382,7 @@ void PostSolveSummarize(const internal::PreprocessedProblem& pp,
&(summary->inner_iteration_ordering_used));
summary->inner_iterations_used = pp.inner_iteration_minimizer.get() != NULL; // NOLINT
summary->linear_solver_type_used = pp.options.linear_solver_type;
summary->linear_solver_type_used = pp.linear_solver_options.type;
summary->num_linear_solver_threads_used = pp.options.num_linear_solver_threads; // NOLINT
summary->num_threads_used = pp.options.num_threads;
summary->preconditioner_type_used = pp.options.preconditioner_type; // NOLINT
@@ -540,7 +540,11 @@ void Solver::Solve(const Solver::Options& options,
const bool status = preprocessor->Preprocess(modified_options, problem_impl, &pp);
if (IsSchurType(pp.options.linear_solver_type)) {
// We check the linear_solver_options.type rather than
// modified_options.linear_solver_type because, depending on the
// lack of a Schur structure, the preprocessor may change the linear
// solver type.
if (IsSchurType(pp.linear_solver_options.type)) {
// TODO(sameeragarwal): We can likely eliminate the duplicate call
// to DetectStructure here and inside the linear solver, by
// calling this in the preprocessor.