the Index types change.

As discussed on the list (too long to explain here).
This commit is contained in:
Benoit Jacob
2010-05-30 16:00:58 -04:00
parent faa3ff3be6
commit aaaade4b3d
158 changed files with 3137 additions and 2878 deletions

View File

@@ -38,9 +38,11 @@
template<typename Derived> class DenseBase<Derived>::InnerIterator
{
typedef typename Derived::Scalar Scalar;
typedef typename Derived::Index Index;
enum { IsRowMajor = (Derived::Flags&RowMajorBit)==RowMajorBit };
public:
EIGEN_STRONG_INLINE InnerIterator(const Derived& expr, int outer)
EIGEN_STRONG_INLINE InnerIterator(const Derived& expr, Index outer)
: m_expression(expr), m_inner(0), m_outer(outer), m_end(expr.rows())
{}
@@ -52,17 +54,17 @@ template<typename Derived> class DenseBase<Derived>::InnerIterator
EIGEN_STRONG_INLINE InnerIterator& operator++() { m_inner++; return *this; }
EIGEN_STRONG_INLINE int index() const { return m_inner; }
inline int row() const { return IsRowMajor ? m_outer : index(); }
inline int col() const { return IsRowMajor ? index() : m_outer; }
EIGEN_STRONG_INLINE Index index() const { return m_inner; }
inline Index row() const { return IsRowMajor ? m_outer : index(); }
inline Index col() const { return IsRowMajor ? index() : m_outer; }
EIGEN_STRONG_INLINE operator bool() const { return m_inner < m_end && m_inner>=0; }
protected:
const Derived& m_expression;
int m_inner;
const int m_outer;
const int m_end;
Index m_inner;
const Index m_outer;
const Index m_end;
};
#endif // EIGEN_COREITERATORS_H