mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
rename CopyHelper into OperatorEquals, get rid of the auxiliary _copy_helper() method,
and make sure copies are always done in column-dominant order
This commit is contained in:
@@ -31,9 +31,6 @@ template<typename Scalar, typename Derived> class MatrixBase
|
||||
static const int RowsAtCompileTime = Derived::RowsAtCompileTime,
|
||||
ColsAtCompileTime = Derived::ColsAtCompileTime;
|
||||
|
||||
template<typename OtherDerived>
|
||||
void _copy_helper(const MatrixBase<Scalar, OtherDerived>& other);
|
||||
|
||||
public:
|
||||
static const int SizeAtCompileTime
|
||||
= RowsAtCompileTime == Dynamic || ColsAtCompileTime == Dynamic
|
||||
@@ -51,20 +48,13 @@ template<typename Scalar, typename Derived> class MatrixBase
|
||||
{ return static_cast<const Derived *>(this)->_ref(); }
|
||||
|
||||
template<typename OtherDerived>
|
||||
Derived& operator=(const MatrixBase<Scalar, OtherDerived>& other)
|
||||
{
|
||||
assert(rows() == other.rows() && cols() == other.cols());
|
||||
_copy_helper(other);
|
||||
return *static_cast<Derived*>(this);
|
||||
}
|
||||
Derived& operator=(const MatrixBase<Scalar, OtherDerived>& other);
|
||||
|
||||
//special case of the above template operator=, in order to prevent the compiler
|
||||
//from generating a default operator= (issue hit with g++ 4.1)
|
||||
Derived& operator=(const MatrixBase& other)
|
||||
{
|
||||
assert(rows() == other.rows() && cols() == other.cols());
|
||||
_copy_helper(other);
|
||||
return *static_cast<Derived*>(this);
|
||||
return this->operator=<Derived>(other);
|
||||
}
|
||||
|
||||
template<typename NewScalar> Cast<NewScalar, Derived> cast() const;
|
||||
|
||||
Reference in New Issue
Block a user