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
@@ -1,5 +1,5 @@
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2017 Google Inc. All rights reserved.
// Copyright 2022 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
@@ -542,9 +542,9 @@ CompressedRowSparseMatrix::CreateBlockDiagonalMatrix(
const double* diagonal, const vector<int>& blocks) {
int num_rows = 0;
int num_nonzeros = 0;
for (int i = 0; i < blocks.size(); ++i) {
num_rows += blocks[i];
num_nonzeros += blocks[i] * blocks[i];
for (int block_size : blocks) {
num_rows += block_size;
num_nonzeros += block_size * block_size;
}
std::unique_ptr<CompressedRowSparseMatrix> matrix =
@@ -558,8 +558,7 @@ CompressedRowSparseMatrix::CreateBlockDiagonalMatrix(
int idx_cursor = 0;
int col_cursor = 0;
for (int i = 0; i < blocks.size(); ++i) {
const int block_size = blocks[i];
for (int block_size : blocks) {
for (int r = 0; r < block_size; ++r) {
*(rows++) = idx_cursor;
values[idx_cursor + r] = diagonal[col_cursor + r];