Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use size_type as return type of SparseMatrix::m(). #16670

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/deal.II/lac/trilinos_tpetra_sparse_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand Down Expand Up @@ -1110,7 +1110,7 @@ namespace LinearAlgebra


template <typename Number, typename MemorySpace>
inline dealii::types::signed_global_dof_index
inline typename SparseMatrix<Number, MemorySpace>::size_type
SparseMatrix<Number, MemorySpace>::m() const
{
return matrix->getRowMap()->getGlobalNumElements();
Expand All @@ -1119,7 +1119,7 @@ namespace LinearAlgebra


template <typename Number, typename MemorySpace>
inline dealii::types::signed_global_dof_index
inline typename SparseMatrix<Number, MemorySpace>::size_type
SparseMatrix<Number, MemorySpace>::n() const
{
// If the matrix structure has not been fixed (i.e., we did not have a
Expand Down
4 changes: 2 additions & 2 deletions include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -631,7 +631,7 @@ namespace LinearAlgebra
std::vector<size_type> row_indices(maximum_row_length);
std::vector<Number> 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)
{
Expand Down