mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
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:
@@ -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.
|
||||
|
||||
@@ -181,6 +181,7 @@ LOCAL_SRC_FILES := $(CERES_SRC_PATH)/array_utils.cc \
|
||||
$(CERES_SRC_PATH)/schur_complement_solver.cc \
|
||||
$(CERES_SRC_PATH)/schur_eliminator.cc \
|
||||
$(CERES_SRC_PATH)/schur_jacobi_preconditioner.cc \
|
||||
$(CERES_SRC_PATH)/schur_templates.cc \
|
||||
$(CERES_SRC_PATH)/scratch_evaluate_preparer.cc \
|
||||
$(CERES_SRC_PATH)/solver.cc \
|
||||
$(CERES_SRC_PATH)/solver_utils.cc \
|
||||
|
||||
Reference in New Issue
Block a user