diff options
Diffstat (limited to 'extern/ceres/internal/ceres/compressed_col_sparse_matrix_utils.cc')
-rw-r--r-- | extern/ceres/internal/ceres/compressed_col_sparse_matrix_utils.cc | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/extern/ceres/internal/ceres/compressed_col_sparse_matrix_utils.cc b/extern/ceres/internal/ceres/compressed_col_sparse_matrix_utils.cc index 3f6672f858c..e1f6bb8ff9d 100644 --- a/extern/ceres/internal/ceres/compressed_col_sparse_matrix_utils.cc +++ b/extern/ceres/internal/ceres/compressed_col_sparse_matrix_utils.cc @@ -30,8 +30,9 @@ #include "ceres/compressed_col_sparse_matrix_utils.h" -#include <vector> #include <algorithm> +#include <vector> + #include "ceres/internal/port.h" #include "glog/logging.h" @@ -40,13 +41,12 @@ namespace internal { using std::vector; -void CompressedColumnScalarMatrixToBlockMatrix( - const int* scalar_rows, - const int* scalar_cols, - const vector<int>& row_blocks, - const vector<int>& col_blocks, - vector<int>* block_rows, - vector<int>* block_cols) { +void CompressedColumnScalarMatrixToBlockMatrix(const int* scalar_rows, + const int* scalar_cols, + const vector<int>& row_blocks, + const vector<int>& col_blocks, + vector<int>* block_rows, + vector<int>* block_cols) { CHECK(block_rows != nullptr); CHECK(block_cols != nullptr); block_rows->clear(); @@ -71,10 +71,8 @@ void CompressedColumnScalarMatrixToBlockMatrix( for (int col_block = 0; col_block < num_col_blocks; ++col_block) { int column_size = 0; for (int idx = scalar_cols[c]; idx < scalar_cols[c + 1]; ++idx) { - vector<int>::const_iterator it = - std::lower_bound(row_block_starts.begin(), - row_block_starts.end(), - scalar_rows[idx]); + vector<int>::const_iterator it = std::lower_bound( + row_block_starts.begin(), row_block_starts.end(), scalar_rows[idx]); // Since we are using lower_bound, it will return the row id // where the row block starts. For everything but the first row // of the block, where these values will be the same, we can @@ -104,7 +102,7 @@ void BlockOrderingToScalarOrdering(const vector<int>& blocks, // block_starts = [0, block1, block1 + block2 ..] vector<int> block_starts(num_blocks); - for (int i = 0, cursor = 0; i < num_blocks ; ++i) { + for (int i = 0, cursor = 0; i < num_blocks; ++i) { block_starts[i] = cursor; cursor += blocks[i]; } |