* Copy-Constructor. Set all the properties of the parallel vector to
* those of the given argument and copy the elements.
*/
- BlockVector (const BlockVector &V);
+ 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 constructor is only available if deal.II is configured with
+ * C++11 support.
+ */
+ BlockVector (BlockVector &&v)
+ {
+ swap(v);
+ v.reinit (0);
+ }
+#endif
/**
* Creates a block vector consisting of <tt>num_blocks</tt> components,
* Copy operator: fill all components of the vector that are locally
* stored with the given scalar value.
*/
- BlockVector &
- operator = (const value_type s);
+ BlockVector &operator= (const value_type s);
/**
* Copy operator for arguments of the same type.
*/
- BlockVector &
- operator = (const BlockVector &V);
+ 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. @p v is
+ * left empty.
+ *
+ * @note This operator is only available if deal.II is configured with
+ * C++11 support.
+ */
+ BlockVector &operator= (BlockVector &&v)
+ {
+ swap(v);
+ // be nice and reset v to zero
+ v.reinit (0);
+
+ return *this;
+ }
+#endif
/**
* Copy operator for arguments of the localized Trilinos vector type.
*/
BlockVector &
- operator = (const ::dealii::TrilinosWrappers::BlockVector &V);
+ operator= (const ::dealii::TrilinosWrappers::BlockVector &v);
/**
* Another copy function. This one takes a deal.II block vector and
* accept only one possible number type in the deal.II vector.
*/
template <typename Number>
- BlockVector &
- operator = (const ::dealii::BlockVector<Number> &V);
+ BlockVector &operator= (const ::dealii::BlockVector<Number> &v);
/**
* Reinitialize the BlockVector to contain as many blocks as there are
template <typename Number>
BlockVector &
- BlockVector::operator = (const ::dealii::BlockVector<Number> &v)
+ BlockVector::operator= (const ::dealii::BlockVector<Number> &v)
{
if (n_blocks() != v.n_blocks())
{
/**
* Copy constructor using the given vector.
*/
- Vector (const Vector &V);
+ Vector (const Vector &v);
+
+#ifdef DEAL_II_WITH_CXX11
+ /**
+ * Move constructor. Creates a new vector by stealing the internal data
+ * of the vector @p v.
+ *
+ * @note This constructor is only available if deal.II is configured with
+ * C++11 support.
+ */
+ Vector (Vector &&v)
+ {
+ swap(v);
+ // be nice and reset v to zero
+ v.clear();
+ }
+#endif
/**
* Destructor.
* function to make the example given in the discussion about making the
* constructor explicit work.
*/
- Vector &operator = (const TrilinosScalar s);
+ Vector &operator= (const TrilinosScalar s);
/**
* Copy the given vector. Resize the present vector if necessary. In
* this case, also the Epetra_Map that designs the parallel partitioning
* is taken from the input vector.
*/
- Vector &
- operator = (const Vector &V);
+ 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. @p v is
+ * left empty.
+ *
+ * @note This operator is only available if deal.II is configured with
+ * C++11 support.
+ */
+ Vector &operator= (Vector &&v)
+ {
+ swap(v);
+ // be nice and reset v to zero
+ v.clear();
+
+ return *this;
+ }
+#endif
/**
* Copy operator from a given localized vector (present on all
* object) already is of the same size as the right hand side vector.
* Otherwise, an exception will be thrown.
*/
- Vector &
- operator = (const ::dealii::TrilinosWrappers::Vector &V);
+ Vector &operator= (const ::dealii::TrilinosWrappers::Vector &v);
/**
* Another copy function. This one takes a deal.II vector and copies it
* the reinit(const Epetra_Map &input_map) function.
*/
template <typename Number>
- Vector &
- operator = (const ::dealii::Vector<Number> &v);
+ Vector &operator= (const ::dealii::Vector<Number> &v);
/**
* This reinit function is meant to be used for parallel calculations
inline
Vector &
- Vector::operator = (const TrilinosScalar s)
+ Vector::operator= (const TrilinosScalar s)
{
- VectorBase::operator = (s);
+ VectorBase::operator= (s);
return *this;
}
template <typename Number>
Vector &
- Vector::operator = (const ::dealii::Vector<Number> &v)
+ Vector::operator= (const ::dealii::Vector<Number> &v)
{
if (size() != v.size())
{
}
-#endif
+#endif /* DOXYGEN */
} /* end of namespace MPI */
* to make the example given in the discussion about making the
* constructor explicit work.
*/
- Vector &operator = (const TrilinosScalar s);
+ Vector &operator= (const TrilinosScalar s);
/**
* Sets the left hand argument to the (parallel) Trilinos Vector.
* Equivalent to the @p reinit function.
*/
- Vector &
- operator = (const MPI::Vector &V);
+ Vector &operator= (const MPI::Vector &v);
/**
* Sets the left hand argument to the deal.II vector.
*/
template <typename Number>
- Vector &
- operator = (const ::dealii::Vector<Number> &V);
+ Vector &operator= (const ::dealii::Vector<Number> &v);
/**
* Copy operator. Copies both the dimension and the content in the right
* hand argument.
*/
- Vector &
- operator = (const Vector &V);
+ Vector &operator= (const Vector &v);
/**
* This function does nothing but is there for compatibility with the @p
inline
Vector &
- Vector::operator = (const TrilinosScalar s)
+ Vector::operator= (const TrilinosScalar s)
{
- VectorBase::operator = (s);
+ VectorBase::operator= (s);
return *this;
}
template <typename Number>
Vector &
- Vector::operator = (const ::dealii::Vector<Number> &v)
+ Vector::operator= (const ::dealii::Vector<Number> &v)
{
if (size() != v.size())
{