diff options
Diffstat (limited to 'internal/ceres/dense_qr_solver.cc')
-rw-r--r-- | internal/ceres/dense_qr_solver.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/internal/ceres/dense_qr_solver.cc b/internal/ceres/dense_qr_solver.cc index d76d58b..4388357 100644 --- a/internal/ceres/dense_qr_solver.cc +++ b/internal/ceres/dense_qr_solver.cc @@ -60,6 +60,7 @@ LinearSolver::Summary DenseQRSolver::SolveImpl( return SolveUsingLAPACK(A, b, per_solve_options, x); } } + LinearSolver::Summary DenseQRSolver::SolveUsingLAPACK( DenseSparseMatrix* A, const double* b, @@ -100,21 +101,18 @@ LinearSolver::Summary DenseQRSolver::SolveUsingLAPACK( work_.resize(work_size); } - const int info = LAPACK::SolveUsingQR(lhs_.rows(), - lhs_.cols(), - lhs_.data(), - work_.rows(), - work_.data(), - rhs_.data()); - event_logger.AddEvent("Solve"); - LinearSolver::Summary summary; summary.num_iterations = 1; - if (info == 0) { + summary.termination_type = LAPACK::SolveInPlaceUsingQR(lhs_.rows(), + lhs_.cols(), + lhs_.data(), + work_.rows(), + work_.data(), + rhs_.data(), + &summary.message); + event_logger.AddEvent("Solve"); + if (summary.termination_type == LINEAR_SOLVER_SUCCESS) { VectorRef(x, num_cols) = rhs_.head(num_cols); - summary.termination_type = TOLERANCE; - } else { - summary.termination_type = FAILURE; } event_logger.AddEvent("TearDown"); @@ -161,7 +159,8 @@ LinearSolver::Summary DenseQRSolver::SolveUsingEigen( // is good enough or not. LinearSolver::Summary summary; summary.num_iterations = 1; - summary.termination_type = TOLERANCE; + summary.termination_type = LINEAR_SOLVER_SUCCESS; + summary.message = "Success."; event_logger.AddEvent("TearDown"); return summary; |