From 23bcf7d19981fc4324fdad090e51f841bf6f72fb Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 2 Jan 2024 14:43:54 -0700 Subject: [PATCH] Push a variable declaration down to its first use. --- source/lac/trilinos_sparsity_pattern.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/lac/trilinos_sparsity_pattern.cc b/source/lac/trilinos_sparsity_pattern.cc index ccf17e785f..b2b83a6acc 100644 --- a/source/lac/trilinos_sparsity_pattern.cc +++ b/source/lac/trilinos_sparsity_pattern.cc @@ -895,8 +895,7 @@ namespace TrilinosWrappers SparsityPattern::size_type SparsityPattern::bandwidth() const { - size_type local_b = 0; - TrilinosWrappers::types::int_type global_b = 0; + size_type local_b = 0; for (int i = 0; i < static_cast(local_size()); ++i) { int *indices; @@ -909,6 +908,8 @@ namespace TrilinosWrappers local_b = std::abs(i - indices[j]); } } + + TrilinosWrappers::types::int_type global_b = 0; graph->Comm().MaxAll(reinterpret_cast( &local_b), &global_b, -- 2.39.5