* You will in general not want to use this class, but one of the
* derived classes.
*
+ * @todo Handle opitmization of diagonal elements of the underlying
+ * SparsityPattern correctly.
+ *
* @see @ref GlossBlockLA "Block (linear algebra)"
* @author Wolfgang Bangerth, 2000, 2001
*/
* two BlockIndices for the block
* structures of matrix rows and
* columns as well as a row
- * length vector in the format
- * produced by DoFTools.
+ * length vector.
+ *
+ * The row length vector should
+ * be in the format produced by
+ * DoFTools. Alternatively, there
+ * is a simplified version,
+ * where each of the inner
+ * vectors has length one. Then,
+ * the corresponding entry is
+ * used as the maximal row length.
+ *
+ * For the diagonal blocks, the
+ * inner SparsityPattern is
+ * initialized with optimized
+ * diagonals, while this is not
+ * done for the off-diagonal blocks.
*/
void reinit (const BlockIndices& row_indices,
const BlockIndices& col_indices,
const unsigned int start = rows.local_to_global(i, 0);
const unsigned int length = rows.block_size(i);
- VectorSlice<const std::vector<unsigned int> >
- block_rows(row_lengths[j], start, length);
- block(i,j).reinit(rows.block_size(i),
- cols.block_size(j),
- block_rows);
+ if (row_lengths[j].size()==1)
+ block(i,j).reinit(rows.block_size(i),
+ cols.block_size(j), row_lengths[j][0], i==j);
+ else
+ {
+ VectorSlice<const std::vector<unsigned int> >
+ block_rows(row_lengths[j], start, length);
+ block(i,j).reinit(rows.block_size(i),
+ cols.block_size(j),
+ block_rows);
+ }
}
this->collect_sizes();
Assert (this->row_indices == rows, ExcInternalError());