]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make code the same in debug and optimized mode. Otherwise this is a
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 4 Sep 2012 13:47:56 +0000 (13:47 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 4 Sep 2012 13:47:56 +0000 (13:47 +0000)
prescription for subtle bugs.

git-svn-id: https://svn.dealii.org/trunk@26234 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/constraint_matrix.templates.h

index db31f44eb4cfd826c38fe3fce1ea67f057db8790..970ee190aa8a440f6865023736fdda9b2a86d8e4 100644 (file)
@@ -1455,7 +1455,7 @@ namespace internals
                                      // check whether the
                                      // constraints are really empty.
     const unsigned int length = size();
-#ifdef DEBUG
+
                                      // make sure that we are in the
                                      // range of the vector
     AssertIndexRange (length, total_row_indices.size()+1);
@@ -1463,7 +1463,6 @@ namespace internals
       Assert (total_row_indices[i].constraint_position ==
               numbers::invalid_unsigned_int,
               ExcInternalError());
-#endif
 
     step = length/2;
     while (step > 0)
@@ -1757,25 +1756,20 @@ namespace internals
 
     AssertIndexRange (column_end-1, global_rows.size());
     const SparsityPattern & sparsity = sparse_matrix->get_sparsity_pattern();
-#ifndef DEBUG
+
     if (sparsity.n_nonzero_elements() == 0)
       return;
-#endif
+
     const std::size_t * row_start = sparsity.get_rowstart_indices();
     const unsigned int * sparsity_struct = sparsity.get_column_numbers();
 
     const unsigned int row = global_rows.global_row(i);
     const unsigned int loc_row = global_rows.local_row(i);
 
-#ifdef DEBUG
     const unsigned int * col_ptr = sparsity.row_length(row) == 0 ? 0 :
                                    &sparsity_struct[row_start[row]];
     number * val_ptr = sparsity.row_length(row) == 0 ? 0 :
                        &sparse_matrix->global_entry (row_start[row]);
-#else
-    const unsigned int * col_ptr = &sparsity_struct[row_start[row]];
-    number * val_ptr = &sparse_matrix->global_entry (row_start[row]);
-#endif
     const bool optimize_diagonal = sparsity.optimize_diagonal();
     unsigned int counter = optimize_diagonal;
 

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.