From c5e90e7821dca703d82aeb2b2de4209195cf56b2 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 7 Jun 2004 20:35:28 +0000 Subject: [PATCH] Get rid of more duplicated data. git-svn-id: https://svn.dealii.org/trunk@9407 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/block_matrix_base.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/deal.II/lac/include/lac/block_matrix_base.h b/deal.II/lac/include/lac/block_matrix_base.h index 11b1ae175c..78965de50b 100644 --- a/deal.II/lac/include/lac/block_matrix_base.h +++ b/deal.II/lac/include/lac/block_matrix_base.h @@ -126,11 +126,6 @@ namespace internal */ unsigned int col_block; - /** - * First column of block. - */ - unsigned int col_start; - /** * Index in whole row. */ @@ -792,7 +787,6 @@ namespace internal base_iterator(matrix->block(0,0).begin()), row_block(0), col_block(0), - col_start(0), a_index(0) { Assert (i==0, ExcNotImplemented()); @@ -839,7 +833,14 @@ namespace internal unsigned int Accessor::column() const { - return col_start + base_iterator->column(); + // note: the block column should always + // be valid, in contrast to the block + // row, which may be past the end of + // the matrix. thus, unlike in the + // row() function, we do not have to + // if-else here + return (matrix->column_block_indices.local_to_global(col_block,0) + + base_iterator->column()); } @@ -912,16 +913,12 @@ namespace internal // row //TODO: what if this row in that block is empty? ++accessor.col_block; - accessor.col_start = - accessor.matrix->column_block_indices - .local_to_global(accessor.col_block, 0); } else { // Advance to first block // in next row accessor.col_block = 0; - accessor.col_start = 0; accessor.a_index = 0; ++local_row; if (local_row >= -- 2.39.5