]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Get rid of a redundant field in the accessor classes. Also get rid of some
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 7 Jun 2004 20:30:03 +0000 (20:30 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 7 Jun 2004 20:30:03 +0000 (20:30 +0000)
operations that were previously necessary in each operator++ call, at the
expense of some more work when calling accessor::row().

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

deal.II/lac/include/lac/block_matrix_base.h

index aa2b77c8a69d63ed8ae27ba46b36ec25720b328c..11b1ae175c835c9b632fc03ed572c10b104a96c7 100644 (file)
@@ -120,12 +120,6 @@ namespace internal
                                          */
        unsigned int row_block;
        
-                                        /**
-                                         * The global number of the first row
-                                         * of the block we are presently in.
-                                         */
-       unsigned int row_start; 
-       
                                         /**
                                          * Number of block column where
                                          * column lies in.
@@ -797,7 +791,6 @@ namespace internal
                     matrix(matrix),
                     base_iterator(matrix->block(0,0).begin()),
                     row_block(0),
-                    row_start(0),
                     col_block(0),
                     col_start(0),
                     a_index(0)
@@ -810,7 +803,6 @@ namespace internal
             = matrix->row_block_indices.global_to_local(r);
           row_block = indices.first;
           base_iterator = matrix->block(indices.first, 0).begin(indices.second);
-          row_start = matrix->row_block_indices.local_to_global(row_block, 0);
         }
       else
         {
@@ -825,7 +817,11 @@ namespace internal
     unsigned int
     Accessor<BlockMatrix>::row() const
     {
-      return row_start + base_iterator->row();
+      if (row_block < matrix->n_block_rows())
+        return (matrix->row_block_indices.local_to_global(row_block, 0) +
+                base_iterator->row());
+      else
+        return 0;
     }
 
 
@@ -936,12 +932,6 @@ namespace internal
                                                    // block row
                   local_row = 0;
                   ++accessor.row_block;
-                  if (accessor.row_block < accessor.matrix->n_block_rows())
-                    accessor.row_start =
-                      accessor.matrix->row_block_indices
-                      .local_to_global(accessor.row_block, 0);
-                  else
-                    accessor.row_start = 0;
                 }
             }
                                            // Finally, set base_iterator

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.