From: Wolfgang Bangerth Date: Mon, 19 Feb 2024 16:01:52 +0000 (-0700) Subject: Use size_type as return type of SparseMatrix::m(). X-Git-Tag: relicensing~16^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=037d7daf1bd84c1fce42d7fd896d3d739d62f1c0;p=dealii.git Use size_type as return type of SparseMatrix::m(). --- diff --git a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h index ad91ed457a..3a15cc6796 100644 --- a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h @@ -406,13 +406,13 @@ namespace LinearAlgebra /** * Return the number of rows in this matrix. */ - dealii::types::signed_global_dof_index + size_type m() const; /** * Return the number of columns in this matrix. */ - dealii::types::signed_global_dof_index + size_type n() const; @@ -1110,7 +1110,7 @@ namespace LinearAlgebra template - inline dealii::types::signed_global_dof_index + inline typename SparseMatrix::size_type SparseMatrix::m() const { return matrix->getRowMap()->getGlobalNumElements(); @@ -1119,7 +1119,7 @@ namespace LinearAlgebra template - inline dealii::types::signed_global_dof_index + inline typename SparseMatrix::size_type SparseMatrix::n() const { // If the matrix structure has not been fixed (i.e., we did not have a 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 48b836e320..f8ef13c04a 100644 --- a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h +++ b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h @@ -594,7 +594,7 @@ namespace LinearAlgebra const bool copy_values, const dealii::SparsityPattern *use_this_sparsity) { - dealii::types::signed_global_dof_index n_rows = dealii_sparse_matrix.m(); + const size_type n_rows = dealii_sparse_matrix.m(); AssertDimension(row_parallel_partitioning.size(), n_rows); AssertDimension(col_parallel_partitioning.size(), dealii_sparse_matrix.n()); @@ -631,7 +631,7 @@ namespace LinearAlgebra std::vector row_indices(maximum_row_length); std::vector values(maximum_row_length); - for (dealii::types::signed_global_dof_index row = 0; row < n_rows; ++row) + for (size_type row = 0; row < n_rows; ++row) // see if the row is locally stored on this processor if (row_parallel_partitioning.is_element(row) == true) {