]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Minor code cleanups.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 17 Jan 2013 16:22:38 +0000 (16:22 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 17 Jan 2013 16:22:38 +0000 (16:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@28103 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/lac/trilinos_sparse_matrix.cc

index f9ee921ec88acc41d0f8feb8856127db48879e4e..f869eaa15a203e6b8645778e93c6fd674ad57a64 100644 (file)
@@ -574,7 +574,7 @@ namespace TrilinosWrappers
         return;
       }
 
-    unsigned int n_rows = dealii_sparse_matrix.m();
+    const unsigned int n_rows = dealii_sparse_matrix.m();
 
     Assert (input_row_map.NumGlobalElements() == (int)n_rows,
             ExcDimensionMismatch (input_row_map.NumGlobalElements(),
@@ -587,17 +587,15 @@ namespace TrilinosWrappers
       (use_this_sparsity!=0)? *use_this_sparsity :
       dealii_sparse_matrix.get_sparsity_pattern();
 
-    if (matrix.get() != 0 && m() == n_rows &&
-        n_nonzero_elements() == sparsity_pattern.n_nonzero_elements())
-      goto set_matrix_values;
-
+    if (matrix.get() == 0 ||
+       m() != n_rows ||
+        n_nonzero_elements() != sparsity_pattern.n_nonzero_elements())
     {
       SparsityPattern trilinos_sparsity;
       trilinos_sparsity.reinit (input_row_map, input_col_map, sparsity_pattern);
       reinit (trilinos_sparsity);
     }
 
-set_matrix_values:
     // fill the values. the same as above: go through all rows of the matrix,
     // and then all columns. since the sparsity patterns of the input matrix
     // and the specified sparsity pattern might be different, need to go

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.