use std::make_unique where applicable

This commit is contained in:
Arne Morten Kvarving
2020-09-02 15:35:39 +02:00
parent 4b45623333
commit 7305f84351
9 changed files with 14 additions and 14 deletions

View File

@@ -122,7 +122,7 @@ scaleMatrixDRS(const Operator& op, std::size_t pressureEqnIndex, const Vector& w
using Matrix = typename Operator::matrix_type;
using Block = typename Matrix::block_type;
using BlockVector = typename Vector::block_type;
std::unique_ptr<Matrix> matrix(new Matrix(op.getmat()));
auto matrix = std::make_unique<Matrix>(op.getmat());
if (param.cpr_use_drs_) {
const auto endi = matrix->end();
for (auto i = matrix->begin(); i != endi; ++i) {

View File

@@ -517,7 +517,7 @@ DenseMatrix transposeDenseMatrix(const DenseMatrix& M)
const MILU_VARIANT ilu_milu = parameters_.ilu_milu_;
const bool ilu_redblack = parameters_.ilu_redblack_;
const bool ilu_reorder_spheres = parameters_.ilu_reorder_sphere_;
std::unique_ptr<SeqPreconditioner> precond(new SeqPreconditioner(opA.getmat(), ilu_fillin, relax, ilu_milu, ilu_redblack, ilu_reorder_spheres));
auto precond = std::make_unique<SeqPreconditioner>(opA.getmat(), ilu_fillin, relax, ilu_milu, ilu_redblack, ilu_reorder_spheres);
return precond;
}