a matrix (or array) does not always have the LinearAccessBit!

=> fixes in outerStride and matrix flags
This commit is contained in:
Gael Guennebaud
2010-03-02 15:31:39 +01:00
parent 0ed5edd24d
commit 2f3d685e0c
4 changed files with 15 additions and 9 deletions

View File

@@ -139,6 +139,13 @@ class DenseStorageBase : public _Base<Derived>
EIGEN_STRONG_INLINE Scalar *data()
{ return m_storage.data(); }
inline int innerStride() const { return 1; }
inline int outerStride() const
{
static const int MaxInnerSize = Base::IsRowMajor ? MaxColsAtCompileTime : MaxRowsAtCompileTime;
return (!IsVectorAtCompileTime) && MaxInnerSize!=Dynamic ? MaxInnerSize : this->innerSize();
}
/** Resizes \c *this to a \a rows x \a cols matrix.
*
* This method is intended for dynamic-size matrices, although it is legal to call it on any
@@ -601,7 +608,7 @@ struct ei_conservative_resize_like_impl<Derived,OtherDerived,true>
const int new_rows = Derived::RowsAtCompileTime==1 ? 1 : other.rows();
const int new_cols = Derived::RowsAtCompileTime==1 ? other.cols() : 1;
_this.derived().m_storage.conservativeResize(other.size(),new_rows,new_cols);
if (num_new_elements > 0)
_this.tail(num_new_elements) = other.tail(num_new_elements);
}