]> https://gitweb.dealii.org/ - dealii.git/commitdiff
BlockSparsityPattern::row_length.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 25 Apr 2006 21:31:24 +0000 (21:31 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 25 Apr 2006 21:31:24 +0000 (21:31 +0000)
git-svn-id: https://svn.dealii.org/trunk@12896 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.html
deal.II/lac/include/lac/block_sparsity_pattern.h

index dd02cde18d0e7cb536c78bbc4ead20889e1d030f..3ae3abe42c09a4043275da7fd4dac07b93db210f 100644 (file)
@@ -442,6 +442,15 @@ inconvenience this causes.
 
 <ol>
   
+  <li> <p> New: The function <code
+       class="member">BlockSparsityPattern::row_length</code> adds up
+       the row lengths of the individual blocks of a block matrix for
+       a given row.
+       <br> 
+       (WB 2006/04/25)
+       </p>
+
+  
   <li> <p> New: There is a new class <code
        class="class">IdentityMatrix</code> that represents an
        efficient version of the matrix with ones on the diagonal and
index 1a4613068e35ee095524a6e958a2fdc96c7f6348..a537e9ebe53d0d3bf03ceb9081a3112f62dc67ac 100644 (file)
@@ -294,6 +294,14 @@ class BlockSparsityPatternBase : public Subscriptor
                                      * position may be non-zero.
                                      */
     bool exists (const unsigned int i, const unsigned int j) const;
+
+                                    /**
+                                     * Number of entries in a
+                                     * specific row, added up over
+                                     * all the blocks that form this
+                                     * row.
+                                     */
+    unsigned int row_length (const unsigned int row) const;
     
                                     /**
                                      * Return the number of nonzero
@@ -615,6 +623,25 @@ BlockSparsityPatternBase<SparsityPatternBase>::exists (const unsigned int i,
 
 
 
+template <class SparsityPatternBase>
+inline
+unsigned int
+BlockSparsityPatternBase<SparsityPatternBase>::
+row_length (const unsigned int row) const
+{
+  const std::pair<unsigned int,unsigned int>
+    row_index = row_indices.global_to_local (row);
+
+  unsigned int c = 0;
+  
+  for (unsigned int b=0; b<rows; ++b)
+    c += sub_objects[row_index.first][b]->row_length (row_index.second);
+
+  return c;
+}
+
+
+
 template <class SparsityPatternBase>
 inline
 unsigned int

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.