From: kanschat Date: Tue, 30 Oct 2007 16:30:43 +0000 (+0000) Subject: add BlockIndices::block_start X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e9ee975a978a6bf6a3e74a2e432919d29cafb61;p=dealii-svn.git add BlockIndices::block_start git-svn-id: https://svn.dealii.org/trunk@15393 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/block_indices.h b/deal.II/lac/include/lac/block_indices.h index ce7e6cdeb0..1c228b84fa 100644 --- a/deal.II/lac/include/lac/block_indices.h +++ b/deal.II/lac/include/lac/block_indices.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -30,7 +30,7 @@ DEAL_II_NAMESPACE_OPEN * translate global row and column indices to local ones. * * @ingroup data - * @author Wolfgang Bangerth, Guido Kanschat, 2000 + * @author Wolfgang Bangerth, Guido Kanschat, 2000, 2007 */ class BlockIndices { @@ -105,11 +105,15 @@ class BlockIndices inline unsigned int total_size () const; /** - * Return the size of the @p ith - * block. + * The size of the @p ith block. */ unsigned int block_size (const unsigned int i) const; - + + /** + * The start index of the ith block. + */ + unsigned int block_start (const unsigned int i) const; + /** * Copy operator. */ @@ -265,6 +269,16 @@ BlockIndices::block_size (const unsigned int block) const +inline +unsigned int +BlockIndices::block_start (const unsigned int block) const +{ + Assert (block < n_blocks, ExcIndexRange(block, 0, n_blocks)); + return start_indices[block]; +} + + + inline BlockIndices & BlockIndices::operator = (const BlockIndices &b)