]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add access to the individual blocks.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 5 May 2000 16:00:27 +0000 (16:00 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 5 May 2000 16:00:27 +0000 (16:00 +0000)
git-svn-id: https://svn.dealii.org/trunk@2808 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_sparse_matrix.h

index 9f4339b713d67b2f133be9a4c22ea1259536381a..fad7bd4c61517550481f34222509c74c41a8501e 100644 (file)
@@ -107,6 +107,25 @@ class BlockSparseMatrix : public Subscriptor
                                      */
     virtual void reinit (const BlockSparsityPattern<rows,columns> &sparsity);
 
+    
+                                    /**
+                                     * Access the block with the
+                                     * given coordinates.
+                                     */
+    SparseMatrix<number> &
+    block (const unsigned int row,
+          const unsigned int column);
+    
+    
+                                    /**
+                                     * Access the block with the
+                                     * given coordinates. Version for
+                                     * constant objects.
+                                     */
+    const SparseMatrix<number> &
+    block (const unsigned int row,
+          const unsigned int column) const;    
+
                                     /**
                                      * Release all memory and return
                                      * to a state just like after
@@ -316,6 +335,29 @@ BlockSparseMatrix<number,rows,columns>::reinit (const BlockSparsityPattern<rows,
 
 
 
+
+template <int rows, int columns>
+inline
+SparseMatrix<number>
+BlockSparseMatrix<number,rows,columns>::block (const unsigned int row,
+                                              const unsigned int column)
+{
+  return sub_objects[row][column];
+};
+
+
+
+template <int rows, int columns>
+inline
+const SparseMatrix<number> &
+BlockSparseMatrix<number,rows,columns>::block (const unsigned int row,
+                                              const unsigned int column) const
+{
+  return sub_objects[row][column];
+};
+
+
+
 template <typename number, int  rows, int columns>
 void
 BlockSparseMatrix<number,rows,columns>::clear () 

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.