From: Wolfgang Bangerth Date: Tue, 20 Feb 2024 17:53:40 +0000 (-0700) Subject: Minor efficiency improvement. X-Git-Tag: relicensing~11^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c17b124ecd96777ba2319f0825fd60ccde079203;p=dealii.git Minor efficiency improvement. --- diff --git a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h index 55e7436ce9..50e7aab6ae 100644 --- a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h +++ b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h @@ -1050,7 +1050,7 @@ namespace LinearAlgebra SparseMatrix::clear_row(const size_type row, const Number new_diag_value) { - clear_rows(ArrayView{&row, 1}, new_diag_value); + clear_rows(ArrayView(row), new_diag_value); } diff --git a/source/lac/petsc_matrix_base.cc b/source/lac/petsc_matrix_base.cc index 9f27ee352c..a160e2c67a 100644 --- a/source/lac/petsc_matrix_base.cc +++ b/source/lac/petsc_matrix_base.cc @@ -147,8 +147,7 @@ namespace PETScWrappers void MatrixBase::clear_row(const size_type row, const PetscScalar new_diag_value) { - std::vector rows(1, row); - clear_rows(rows, new_diag_value); + clear_rows(ArrayView(row), new_diag_value); }