]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add BlockIndices::block_start
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 30 Oct 2007 16:30:43 +0000 (16:30 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 30 Oct 2007 16:30:43 +0000 (16:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@15393 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_indices.h

index ce7e6cdeb057c44c68fc8a25f81abae2c4b65e34..1c228b84faa5644d05dc8515cca9919356017094 100644 (file)
@@ -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)

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.