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:
Sameer Agarwal
2022-02-02 13:17:29 -08:00
parent a35bd1bf90
commit ae65219e04
171 changed files with 1191 additions and 1148 deletions
@@ -75,21 +75,21 @@ LinearSolver::Summary SparseNormalCholeskySolver::SolveImpl(
A->LeftMultiply(b, rhs_.data());
event_logger.AddEvent("Compute RHS");
if (per_solve_options.D != NULL) {
if (per_solve_options.D != nullptr) {
// Temporarily append a diagonal block to the A matrix, but undo
// it before returning the matrix to the user.
std::unique_ptr<BlockSparseMatrix> regularizer;
regularizer.reset(BlockSparseMatrix::CreateDiagonalMatrix(
per_solve_options.D, A->block_structure()->cols));
std::unique_ptr<BlockSparseMatrix> regularizer =
BlockSparseMatrix::CreateDiagonalMatrix(per_solve_options.D,
A->block_structure()->cols);
event_logger.AddEvent("Diagonal");
A->AppendRows(*regularizer);
event_logger.AddEvent("Append");
}
event_logger.AddEvent("Append Rows");
if (inner_product_computer_.get() == NULL) {
inner_product_computer_.reset(
InnerProductComputer::Create(*A, sparse_cholesky_->StorageType()));
if (inner_product_computer_.get() == nullptr) {
inner_product_computer_ =
InnerProductComputer::Create(*A, sparse_cholesky_->StorageType());
event_logger.AddEvent("InnerProductComputer::Create");
}
@@ -97,7 +97,7 @@ LinearSolver::Summary SparseNormalCholeskySolver::SolveImpl(
inner_product_computer_->Compute();
event_logger.AddEvent("InnerProductComputer::Compute");
if (per_solve_options.D != NULL) {
if (per_solve_options.D != nullptr) {
A->DeleteRowBlocks(A->block_structure()->cols.size());
}