]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add missing BlockVector::swap functions.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 12 Nov 2008 03:54:44 +0000 (03:54 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 12 Nov 2008 03:54:44 +0000 (03:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@17556 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/trilinos_block_vector.h

index be98f073dade4b81daa2068eb1775e65f55cde8f..34534dbb59ef9ce7a509625252065a4645c27168 100644 (file)
@@ -404,6 +404,19 @@ namespace TrilinosWrappers
 
 
 
+    inline
+    void
+    BlockVector::swap (BlockVector &v)
+    {
+      Assert (n_blocks() == v.n_blocks(),
+             ExcDimensionMismatch(n_blocks(),v.n_blocks()));
+      
+      for (unsigned int row=0; row<n_blocks(); ++row)
+       block(row).swap (v.block(row));
+    }
+    
+
+
 /**
  * Global function which overloads the default implementation
  * of the C++ standard library which uses a temporary object. The
@@ -827,6 +840,16 @@ namespace TrilinosWrappers
   }
 
 
+  inline
+  void
+  BlockVector::swap (BlockVector &v)
+  {
+    Assert (n_blocks() == v.n_blocks(),
+           ExcDimensionMismatch(n_blocks(),v.n_blocks()));
+      
+    for (unsigned int row=0; row<n_blocks(); ++row)
+      block(row).swap (v.block(row));
+  }
 
 
 /**
@@ -838,12 +861,12 @@ namespace TrilinosWrappers
  * @relates TrilinosWrappers::BlockVector
  * @author Martin Kronbichler, 2008
  */
-    inline
-    void swap (BlockVector &u,
-               BlockVector &v)
-    {
-      u.swap (v);
-    }
+  inline
+  void swap (BlockVector &u,
+            BlockVector &v)
+  {
+    u.swap (v);
+  }
 
 }
 

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.