mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
ClangTidy cleanups
1. NULL -> nullptr 2. foo.reset(new Bar) -> = foo = std::make_unique<Bar>() 3. Missing std library includes & prefixes Change-Id: I260b261b484554be681ee5a7398126fdb3b3a789
This commit is contained in:
@@ -235,7 +235,7 @@ void PartitionedMatrixView<kRowBlockSize, kEBlockSize, kFBlockSize>::
|
||||
// and return a BlockSparseMatrix with the this block structure. The
|
||||
// caller owns the result.
|
||||
template <int kRowBlockSize, int kEBlockSize, int kFBlockSize>
|
||||
BlockSparseMatrix*
|
||||
std::unique_ptr<BlockSparseMatrix>
|
||||
PartitionedMatrixView<kRowBlockSize, kEBlockSize, kFBlockSize>::
|
||||
CreateBlockDiagonalMatrixLayout(int start_col_block,
|
||||
int end_col_block) const {
|
||||
@@ -270,28 +270,27 @@ PartitionedMatrixView<kRowBlockSize, kEBlockSize, kFBlockSize>::
|
||||
|
||||
// Build a BlockSparseMatrix with the just computed block
|
||||
// structure.
|
||||
return new BlockSparseMatrix(block_diagonal_structure);
|
||||
return std::make_unique<BlockSparseMatrix>(block_diagonal_structure);
|
||||
}
|
||||
|
||||
template <int kRowBlockSize, int kEBlockSize, int kFBlockSize>
|
||||
BlockSparseMatrix* PartitionedMatrixView<kRowBlockSize,
|
||||
kEBlockSize,
|
||||
kFBlockSize>::CreateBlockDiagonalEtE()
|
||||
const {
|
||||
BlockSparseMatrix* block_diagonal =
|
||||
std::unique_ptr<BlockSparseMatrix>
|
||||
PartitionedMatrixView<kRowBlockSize, kEBlockSize, kFBlockSize>::
|
||||
CreateBlockDiagonalEtE() const {
|
||||
std::unique_ptr<BlockSparseMatrix> block_diagonal =
|
||||
CreateBlockDiagonalMatrixLayout(0, num_col_blocks_e_);
|
||||
UpdateBlockDiagonalEtE(block_diagonal);
|
||||
UpdateBlockDiagonalEtE(block_diagonal.get());
|
||||
return block_diagonal;
|
||||
}
|
||||
|
||||
template <int kRowBlockSize, int kEBlockSize, int kFBlockSize>
|
||||
BlockSparseMatrix* PartitionedMatrixView<kRowBlockSize,
|
||||
kEBlockSize,
|
||||
kFBlockSize>::CreateBlockDiagonalFtF()
|
||||
const {
|
||||
BlockSparseMatrix* block_diagonal = CreateBlockDiagonalMatrixLayout(
|
||||
num_col_blocks_e_, num_col_blocks_e_ + num_col_blocks_f_);
|
||||
UpdateBlockDiagonalFtF(block_diagonal);
|
||||
std::unique_ptr<BlockSparseMatrix>
|
||||
PartitionedMatrixView<kRowBlockSize, kEBlockSize, kFBlockSize>::
|
||||
CreateBlockDiagonalFtF() const {
|
||||
std::unique_ptr<BlockSparseMatrix> block_diagonal =
|
||||
CreateBlockDiagonalMatrixLayout(num_col_blocks_e_,
|
||||
num_col_blocks_e_ + num_col_blocks_f_);
|
||||
UpdateBlockDiagonalFtF(block_diagonal.get());
|
||||
return block_diagonal;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user