mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
Address comments from William Rucklidge
Change-Id: I0c4f686b89798435741c55a5ca45cf000af842dc
This commit is contained in:
@@ -116,7 +116,8 @@ class DynamicCostFunctionToFunctor {
|
||||
bool operator()(JetT const* const* inputs, JetT* output) const {
|
||||
const std::vector<int32>& parameter_block_sizes =
|
||||
cost_function_->parameter_block_sizes();
|
||||
const int num_parameter_blocks = static_cast<int>(parameter_block_sizes.size());
|
||||
const int num_parameter_blocks =
|
||||
static_cast<int>(parameter_block_sizes.size());
|
||||
const int num_residuals = cost_function_->num_residuals();
|
||||
const int num_parameters = std::accumulate(parameter_block_sizes.begin(),
|
||||
parameter_block_sizes.end(), 0);
|
||||
|
||||
@@ -359,11 +359,11 @@ LinearSolver::Summary SparseNormalCholeskySolver::SolveImplUsingSuiteSparse(
|
||||
summary.num_iterations = 1;
|
||||
summary.message = "Success.";
|
||||
|
||||
// Map outer_product_ to an lower triangular column major matrix.
|
||||
// Map outer_product_ to a lower triangular column major matrix.
|
||||
//
|
||||
// outer_product_ is a compressed row sparse matrix and in upper
|
||||
// triangular form, when mapped to a compressed column sparse
|
||||
// matrix, it becomes an lower triangular matrix.
|
||||
// matrix, it becomes a lower triangular matrix.
|
||||
const int num_cols = outer_product_->num_cols();
|
||||
cholmod_sparse lhs =
|
||||
ss_.CreateSparseMatrixTransposeView(outer_product_.get());
|
||||
|
||||
@@ -85,6 +85,8 @@ TripletSparseMatrix::TripletSparseMatrix(const int num_rows,
|
||||
// All the sizes should at least be zero
|
||||
CHECK_GE(num_rows, 0);
|
||||
CHECK_GE(num_cols, 0);
|
||||
CHECK_EQ(rows.size(), cols.size());
|
||||
CHECK_EQ(rows.size(), values.size());
|
||||
AllocateMemory();
|
||||
std::copy(rows.begin(), rows.end(), rows_.get());
|
||||
std::copy(cols.begin(), cols.end(), cols_.get());
|
||||
@@ -305,9 +307,6 @@ TripletSparseMatrix* TripletSparseMatrix::CreateRandomMatrix(
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!rows.empty()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return new TripletSparseMatrix(
|
||||
|
||||
@@ -342,7 +342,8 @@ void VisibilityBasedPreconditioner::InitEliminator(
|
||||
eliminator_options.row_block_size = options_.row_block_size;
|
||||
eliminator_.reset(SchurEliminatorBase::Create(eliminator_options));
|
||||
const bool kFullRankETE = true;
|
||||
eliminator_->Init(eliminator_options.elimination_groups[0], kFullRankETE, &bs);
|
||||
eliminator_->Init(
|
||||
eliminator_options.elimination_groups[0], kFullRankETE, &bs);
|
||||
}
|
||||
|
||||
// Update the values of the preconditioner matrix and factorize it.
|
||||
|
||||
Reference in New Issue
Block a user