Modernize more

Apply clang-tidy Google and modernize fixes without trailing return type
using:

$ clang-tidy -p <build-dir> \
  -checks='-*,google-*,modernize-*,-modernize-use-trailing-return-type' {} -fix

Change-Id: I7450cc58ea9abf928f73a467e87876083217fa26
This commit is contained in:
Sergiu Deitsch
2022-02-20 02:22:17 +01:00
committed by Sameer Agarwal
parent 46b3495a4f
commit c8658c8992
172 changed files with 918 additions and 983 deletions
+4 -6
View File
@@ -210,8 +210,7 @@ LinearSolver::Summary DenseSchurComplementSolver::SolveReducedLinearSystem(
summary.termination_type = LINEAR_SOLVER_SUCCESS;
summary.message = "Success.";
BlockRandomAccessDenseMatrix* m =
down_cast<BlockRandomAccessDenseMatrix*>(mutable_lhs());
auto* m = down_cast<BlockRandomAccessDenseMatrix*>(mutable_lhs());
const int num_rows = m->num_rows();
// The case where there are no f blocks, and the system is block
@@ -294,8 +293,8 @@ void SparseSchurComplementSolver::InitStorage(
CHECK_GE(row.cells.front().block_id, num_eliminate_blocks);
for (int i = 0; i < row.cells.size(); ++i) {
int r_block1_id = row.cells[i].block_id - num_eliminate_blocks;
for (int j = 0; j < row.cells.size(); ++j) {
int r_block2_id = row.cells[j].block_id - num_eliminate_blocks;
for (const auto& cell : row.cells) {
int r_block2_id = cell.block_id - num_eliminate_blocks;
if (r_block1_id <= r_block2_id) {
block_pairs.insert(make_pair(r_block1_id, r_block2_id));
}
@@ -369,8 +368,7 @@ SparseSchurComplementSolver::SolveReducedLinearSystemUsingConjugateGradients(
std::make_unique<BlockRandomAccessDiagonalMatrix>(blocks_);
}
BlockRandomAccessSparseMatrix* sc =
down_cast<BlockRandomAccessSparseMatrix*>(mutable_lhs());
auto* sc = down_cast<BlockRandomAccessSparseMatrix*>(mutable_lhs());
// Extract block diagonal from the Schur complement to construct the
// schur_jacobi preconditioner.