mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
SparseMatrix: add missing ctor for ReturnByValue
This commit is contained in:
parent
ea310249f3
commit
7518201de8
@ -637,6 +637,16 @@ class SparseMatrix
|
|||||||
*this = other.derived();
|
*this = other.derived();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Copy constructor with in-place evaluation */
|
||||||
|
template<typename OtherDerived>
|
||||||
|
SparseMatrix(const ReturnByValue<OtherDerived>& other)
|
||||||
|
: Base(), m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0)
|
||||||
|
{
|
||||||
|
check_template_parameters();
|
||||||
|
initAssignment(other);
|
||||||
|
other.evalTo(*this);
|
||||||
|
}
|
||||||
|
|
||||||
/** Swaps the content of two sparse matrices of the same type.
|
/** Swaps the content of two sparse matrices of the same type.
|
||||||
* This is a fast operation that simply swaps the underlying pointers and parameters. */
|
* This is a fast operation that simply swaps the underlying pointers and parameters. */
|
||||||
inline void swap(SparseMatrix& other)
|
inline void swap(SparseMatrix& other)
|
||||||
@ -678,7 +688,10 @@ class SparseMatrix
|
|||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
inline SparseMatrix& operator=(const ReturnByValue<OtherDerived>& other)
|
inline SparseMatrix& operator=(const ReturnByValue<OtherDerived>& other)
|
||||||
{ return Base::operator=(other.derived()); }
|
{
|
||||||
|
initAssignment(other);
|
||||||
|
return Base::operator=(other.derived());
|
||||||
|
}
|
||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
inline SparseMatrix& operator=(const EigenBase<OtherDerived>& other)
|
inline SparseMatrix& operator=(const EigenBase<OtherDerived>& other)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user