fix aliasing detection

This commit is contained in:
Gael Guennebaud 2010-01-05 12:46:07 +01:00
parent 37851cfe11
commit 90d2ae7fec
2 changed files with 12 additions and 2 deletions

View File

@ -58,6 +58,7 @@ template<typename BinaryOp, typename MatrixType> class SelfCwiseBinaryOp
inline int rows() const { return m_matrix.rows(); }
inline int cols() const { return m_matrix.cols(); }
inline int stride() const { return m_matrix.stride(); }
inline const Scalar* data() const { return m_matrix.data(); }
// note that this function is needed by assign to correctly align loads/stores
// TODO make Assign use .data()

View File

@ -299,6 +299,15 @@ inline void MatrixBase<Derived>::adjointInPlace()
// The following is to detect aliasing problems in most common cases.
template<typename BinOp,typename NestedXpr>
struct ei_blas_traits<SelfCwiseBinaryOp<BinOp,NestedXpr> >
: ei_blas_traits<NestedXpr>
{
typedef SelfCwiseBinaryOp<BinOp,NestedXpr> XprType;
static inline const XprType extract(const XprType& x) { return x; }
};
template<typename T, int Access=ei_blas_traits<T>::ActualAccess>
struct ei_extract_data_selector {
static typename T::Scalar* run(const T& m)