]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Let clear_rows take an ArrayView argument
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 20 Feb 2024 14:29:16 +0000 (09:29 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 20 Feb 2024 14:43:03 +0000 (09:43 -0500)
include/deal.II/lac/petsc_matrix_base.h
include/deal.II/lac/trilinos_sparse_matrix.h
include/deal.II/lac/trilinos_tpetra_sparse_matrix.h
include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h
source/lac/petsc_matrix_base.cc
source/lac/trilinos_sparse_matrix.cc

index dd5a750ec12880a25b3f887337d04258ad5b9623..eaf5e17c15e0a1f352ff6d2ba336762a1a4a4fc5 100644 (file)
@@ -577,8 +577,8 @@ namespace PETScWrappers
      * the diagonal entries, you have to set them by hand.
      */
     void
-    clear_rows(const std::vector<size_type> &rows,
-               const PetscScalar             new_diag_value = 0);
+    clear_rows(const ArrayView<const size_type> &rows,
+               const PetscScalar                 new_diag_value = 0);
 
     /**
      * Same as clear_rows(), except that the function also zeros the columns.
index 8bcda46bb18c9b482aa83bc61a88168ea0a3c10f..487340f56e7765ad3b54086b23af352a9f1f7d1a 100644 (file)
@@ -1344,8 +1344,8 @@ namespace TrilinosWrappers
      * starting to clear rows.
      */
     void
-    clear_rows(const std::vector<size_type> &rows,
-               const TrilinosScalar          new_diag_value = 0);
+    clear_rows(const ArrayView<const size_type> &rows,
+               const TrilinosScalar              new_diag_value = 0);
 
     /**
      * Sets an internal flag so that all operations performed by the matrix,
index a32c520d51d716327feffc5b526d0b1d3a8a6b83..120e6bd350d9a6ae5a59d90f891ee545f11ef35e 100644 (file)
@@ -727,8 +727,8 @@ namespace LinearAlgebra
        * starting to clear rows.
        */
       void
-      clear_rows(const std::vector<size_type> &rows,
-                 const Number                  new_diag_value = 0);
+      clear_rows(const ArrayView<const size_type> &rows,
+                 const Number                      new_diag_value = 0);
 
       /**
        * Release all memory and return to a state just like after having called
index 2c3d9ab8270d3cc3ec47b788e29aeecc84f95cc1..fae4292018a634f949e6f249ec6dedd177438aba 100644 (file)
@@ -1010,7 +1010,7 @@ namespace LinearAlgebra
     SparseMatrix<Number, MemorySpace>::clear_row(const size_type row,
                                                  const Number    new_diag_value)
     {
-      clear_rows(std::vector<size_type>(1, row), new_diag_value);
+      clear_rows(ArrayView<const size_type>{&row, 1}, new_diag_value);
     }
 
 
@@ -1018,8 +1018,8 @@ namespace LinearAlgebra
     template <typename Number, typename MemorySpace>
     void
     SparseMatrix<Number, MemorySpace>::clear_rows(
-      const std::vector<size_type> &rows,
-      const Number                  new_diag_value)
+      const ArrayView<const size_type> &rows,
+      const Number                      new_diag_value)
     {
       // If the matrix is marked as compressed, we need to
       // call resumeFill() first.
index 2475988e230b306aa4eb604e473f96109c7f06d0..7df1d3ad0ca8520754542f48f7cdc1485f00f594 100644 (file)
@@ -154,8 +154,8 @@ namespace PETScWrappers
 
 
   void
-  MatrixBase::clear_rows(const std::vector<size_type> &rows,
-                         const PetscScalar             new_diag_value)
+  MatrixBase::clear_rows(const ArrayView<const size_type> &rows,
+                         const PetscScalar                 new_diag_value)
   {
     assert_is_compressed();
 
index ef9cedaa836cfe04d2753dd08d9971e91a3741f6..0084e185af54ed70f2181d172a453dc55b2a645b 100644 (file)
@@ -1152,8 +1152,8 @@ namespace TrilinosWrappers
 
 
   void
-  SparseMatrix::clear_rows(const std::vector<size_type> &rows,
-                           const TrilinosScalar          new_diag_value)
+  SparseMatrix::clear_rows(const ArrayView<const size_type> &rows,
+                           const TrilinosScalar              new_diag_value)
   {
     for (const auto row : rows)
       clear_row(row, new_diag_value);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.