]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove move operators and constructors from PETSc variants 897/head
authorMatthias Maier <tamiko@43-1.org>
Mon, 4 May 2015 12:39:04 +0000 (14:39 +0200)
committerMatthias Maier <tamiko@43-1.org>
Mon, 4 May 2015 12:39:04 +0000 (14:39 +0200)
include/deal.II/lac/petsc_parallel_block_vector.h
include/deal.II/lac/petsc_parallel_vector.h
source/lac/petsc_parallel_vector.cc

index 24b435a98441755cc9c6d7213cc0b129596ccf91..92524109a519e0382f251884415e6483d1f6b5f5 100644 (file)
@@ -105,17 +105,6 @@ namespace PETScWrappers
        */
       BlockVector (const BlockVector  &V);
 
-#ifdef DEAL_II_WITH_CXX11
-      /**
-       * Move constructor. Creates a new vector by stealing the internal data
-       * of the vector @p v.
-       *
-       * @note This operator is only available if deal.II is configured with
-       * C++11 support.
-       */
-      BlockVector (BlockVector &&v);
-#endif
-
       /**
        * Constructor. Set the number of blocks to <tt>block_sizes.size()</tt>
        * and initialize each block with <tt>block_sizes[i]</tt> zero elements.
@@ -160,17 +149,6 @@ namespace PETScWrappers
       BlockVector &
       operator= (const BlockVector &V);
 
-#ifdef DEAL_II_WITH_CXX11
-      /**
-       * Move the given vector. This operator replaces the present vector with
-       * @p v by efficiently swapping the internal data structures.
-       *
-       * @note This operator is only available if deal.II is configured with
-       * C++11 support.
-       */
-      BlockVector &operator= (BlockVector &&v);
-#endif
-
       /**
        * Copy the given sequential (non-distributed) block vector into the
        * present parallel block vector. It is assumed that they have the same
@@ -358,14 +336,6 @@ namespace PETScWrappers
         this->components[i] = v.components[i];
     }
 
-#ifdef DEAL_II_WITH_CXX11
-    inline
-    BlockVector::BlockVector (BlockVector &&v)
-    {
-      swap(v);
-    }
-#endif
-
     inline
     BlockVector::BlockVector (const std::vector<IndexSet> &parallel_partitioning,
                               const MPI_Comm              &communicator)
@@ -409,16 +379,6 @@ namespace PETScWrappers
       return *this;
     }
 
-#ifdef DEAL_II_WITH_CXX11
-    inline
-    BlockVector &
-    BlockVector::operator= (BlockVector &&v)
-    {
-      swap(v);
-      return *this;
-    }
-#endif
-
     inline
     BlockVector::~BlockVector ()
     {}
index ea6137f65d968d2fdb981af08a1b5623c92f330c..1b987c3417474b138ac08126b0888f264a125e00 100644 (file)
@@ -185,21 +185,6 @@ namespace PETScWrappers
        */
       Vector ();
 
-#ifdef DEAL_II_WITH_CXX11
-      // explicitly declare default variant, such that below move constructor
-      // does not dissallow it
-      Vector (const Vector &) = default;
-
-      /**
-       * Move constructor. Creates a new vector by stealing the internal data
-       * of the vector @p v.
-       *
-       * @note This operator is only available if deal.II is configured with
-       * C++11 support.
-       */
-      Vector (Vector &&v);
-#endif
-
       /**
        * Constructor. Set dimension to @p n and initialize all elements with
        * zero.
@@ -283,17 +268,6 @@ namespace PETScWrappers
        */
       Vector &operator= (const Vector &v);
 
-#ifdef DEAL_II_WITH_CXX11
-      /**
-       * Move the given vector. This operator replaces the present vector with
-       * @p v by efficiently swapping the internal data structures.
-       *
-       * @note This operator is only available if deal.II is configured with
-       * C++11 support.
-       */
-      Vector &operator= (Vector &&v);
-#endif
-
       /**
        * Copy the given sequential (non-distributed) vector into the present
        * parallel vector. It is assumed that they have the same size, and this
@@ -552,17 +526,6 @@ namespace PETScWrappers
 
 
 
-#ifdef DEAL_II_WITH_CXX11
-    inline
-    Vector &Vector::operator= (Vector &&v)
-    {
-      swap(v);
-      return *this;
-    }
-#endif
-
-
-
     template <typename number>
     inline
     Vector &
index c6d0749f3109fc93d14b838e5b6631da565dccd8..87fde1ad6e71f3c4a8c3eac39ceccd7482541cb4 100644 (file)
@@ -41,23 +41,6 @@ namespace PETScWrappers
 
 
 
-#ifdef DEAL_II_WITH_CXX11
-    Vector::Vector (Vector &&v)
-    {
-      // this is an invalid empty vector, so we can just as well create a
-      // sequential one to avoid all the overhead incurred by parallelism
-      const int n = 0;
-      const int ierr
-        = VecCreateSeq (PETSC_COMM_SELF, n, &vector);
-      AssertThrow (ierr == 0, ExcPETScError(ierr));
-      ghosted = false;
-
-      swap(v);
-    }
-#endif
-
-
-
     Vector::Vector (const MPI_Comm &communicator,
                     const size_type n,
                     const size_type local_size)

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.