From c17b124ecd96777ba2319f0825fd60ccde079203 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 20 Feb 2024 10:53:40 -0700 Subject: [PATCH] Minor efficiency improvement. --- include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h | 2 +- source/lac/petsc_matrix_base.cc | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) 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); } -- 2.39.5