From: Wolfgang Bangerth Date: Tue, 2 Jan 2024 21:43:54 +0000 (-0700) Subject: Push a variable declaration down to its first use. X-Git-Tag: relicensing~205^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16409%2Fhead;p=dealii.git Push a variable declaration down to its first use. --- 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,