mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
introduce copyCoeff and copyPacket methods in MatrixBase, used by
Assign, in preparation for new Swap impl reusing Assign code. remove last remnant of old Inverse class in Transform.
This commit is contained in:
@@ -280,5 +280,40 @@ inline void MatrixBase<Derived>::writePacket
|
||||
derived().template writePacket<StoreMode>(index,x);
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
template<typename OtherDerived>
|
||||
inline void MatrixBase<Derived>::copyCoeff(int row, int col, const MatrixBase<OtherDerived>& other)
|
||||
{
|
||||
ei_internal_assert(row >= 0 && row < rows()
|
||||
&& col >= 0 && col < cols());
|
||||
derived().coeffRef(row, col) = other.derived().coeff(row, col);
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
template<typename OtherDerived>
|
||||
inline void MatrixBase<Derived>::copyCoeff(int index, const MatrixBase<OtherDerived>& other)
|
||||
{
|
||||
ei_internal_assert(index >= 0 && index < size());
|
||||
derived().coeffRef(index) = other.derived().coeff(index);
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
template<typename OtherDerived, int LoadStoreMode>
|
||||
inline void MatrixBase<Derived>::copyPacket(int row, int col, const MatrixBase<OtherDerived>& other)
|
||||
{
|
||||
ei_internal_assert(row >= 0 && row < rows()
|
||||
&& col >= 0 && col < cols());
|
||||
derived().template writePacket<LoadStoreMode>(row, col,
|
||||
other.derived().template packet<LoadStoreMode>(row, col));
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
template<typename OtherDerived, int LoadStoreMode>
|
||||
inline void MatrixBase<Derived>::copyPacket(int index, const MatrixBase<OtherDerived>& other)
|
||||
{
|
||||
ei_internal_assert(index >= 0 && index < size());
|
||||
derived().template writePacket<LoadStoreMode>(index,
|
||||
other.derived().template packet<LoadStoreMode>(index));
|
||||
}
|
||||
|
||||
#endif // EIGEN_COEFFS_H
|
||||
|
||||
Reference in New Issue
Block a user