Sparse move

This commit is contained in:
Charles Schlosser
2024-03-27 17:44:50 +00:00
committed by Antonio Sánchez
parent c8d368bdaf
commit 7b5d32b7c9
4 changed files with 84 additions and 6 deletions

View File

@@ -304,6 +304,24 @@ class SparseVector : public SparseCompressedBase<SparseVector<Scalar_, Options_,
return *this;
}
inline SparseVector(SparseVector&& other) : SparseVector() { this->swap(other); }
template <typename OtherDerived>
inline SparseVector(SparseCompressedBase<OtherDerived>&& other) : SparseVector() {
*this = other.derived().markAsRValue();
}
inline SparseVector& operator=(SparseVector&& other) {
this->swap(other);
return *this;
}
template <typename OtherDerived>
inline SparseVector& operator=(SparseCompressedBase<OtherDerived>&& other) {
*this = other.derived().markAsRValue();
return *this;
}
#ifndef EIGEN_PARSED_BY_DOXYGEN
template <typename Lhs, typename Rhs>
inline SparseVector& operator=(const SparseSparseProduct<Lhs, Rhs>& product) {