diff options
author | 2010-02-25 21:01:52 -0500 | |
---|---|---|
committer | 2010-02-25 21:01:52 -0500 | |
commit | 769641bc58745fecc1fa4e537466a1fff48f4a8a (patch) | |
tree | b48ea97e085d48cfd04b6f77bf14a70c697d58d5 /Eigen/src/Core/MapBase.h | |
parent | 5491531a8119223322110d18056a5a94bbbe413e (diff) |
* Implement the ByOuterInner accessors
* use them (big simplification in Assign.h)
* axe (Inner|Outer)StrideAtCompileTime that were just introduced
* ei_int_if_dynamic now asserts that the size is the expected one: adapt to that in Block.h
* add rowStride() / colStride() in DenseBase
* implement innerStride() / outerStride() everywhere needed
Diffstat (limited to 'Eigen/src/Core/MapBase.h')
-rw-r--r-- | Eigen/src/Core/MapBase.h | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/Eigen/src/Core/MapBase.h b/Eigen/src/Core/MapBase.h index 6bac2ed4c..d735cfc47 100644 --- a/Eigen/src/Core/MapBase.h +++ b/Eigen/src/Core/MapBase.h @@ -38,57 +38,22 @@ template<typename Derived, typename Base> class MapBase public: enum { - IsRowMajor = (int(ei_traits<Derived>::Flags) & RowMajorBit) ? 1 : 0, RowsAtCompileTime = ei_traits<Derived>::RowsAtCompileTime, ColsAtCompileTime = ei_traits<Derived>::ColsAtCompileTime, - SizeAtCompileTime = Base::SizeAtCompileTime, - InnerStrideAtCompileTime = ei_traits<Derived>::InnerStrideAtCompileTime + SizeAtCompileTime = Base::SizeAtCompileTime }; typedef typename ei_traits<Derived>::Scalar Scalar; typedef typename Base::PacketScalar PacketScalar; using Base::derived; + using Base::innerStride; + using Base::outerStride; + using Base::rowStride; + using Base::colStride; inline int rows() const { return m_rows.value(); } inline int cols() const { return m_cols.value(); } - /** \returns the pointer increment between two consecutive elements. - * - * \note For vectors, the storage order is ignored. For matrices (non-vectors), we're looking - * at the increment between two consecutive elements within a slice in the inner direction. - * - * \sa outerStride(), data(), rowStride(), colStride() - */ - inline int innerStride() const { return derived().innerStride(); } - - /** \returns the pointer increment between two consecutive inner slices (for example, between two consecutive columns - * in a column-major matrix). - * - * \note For vectors, the storage order is ignored, there is only one inner slice, and so this method returns 1. - * For matrices (non-vectors), the notion of inner slice depends on the storage order. - * - * \sa innerStride(), data(), rowStride(), colStride() - */ - inline int outerStride() const { return derived().outerStride(); } - - /** \returns the pointer increment between two consecutive rows. - * - * \sa data(), innerStride(), outerStride(), colStride() - */ - inline int rowStride() const - { - return (RowsAtCompileTime==1 || IsRowMajor) ? outerStride() : innerStride(); - } - - /** \returns the pointer increment between two consecutive columns. - * - * \sa data(), innerStride(), outerStride(), rowStride() - */ - inline int colStride() const - { - return (RowsAtCompileTime==1 || IsRowMajor) ? innerStride() : outerStride(); - } - /** Returns a pointer to the first coefficient of the matrix or vector. * * \note When addressing this data, make sure to honor the strides returned by innerStride() and outerStride(). |