make the accessors to internal sparse storage part of the public API and remove their "_" prefix.

This commit is contained in:
Gael Guennebaud
2011-12-04 12:19:26 +01:00
parent 1cdbae62db
commit 32917515df
13 changed files with 153 additions and 130 deletions

View File

@@ -121,6 +121,7 @@ template<typename _Scalar, int _Options, typename _Index>
}
class InnerIterator;
class ReverseInnerIterator;
void setZero()
{
@@ -348,4 +349,20 @@ class DynamicSparseMatrix<Scalar,_Options,_Index>::InnerIterator : public Sparse
const Index m_outer;
};
template<typename Scalar, int _Options, typename _Index>
class DynamicSparseMatrix<Scalar,_Options,_Index>::ReverseInnerIterator : public SparseVector<Scalar,_Options,_Index>::ReverseInnerIterator
{
typedef typename SparseVector<Scalar,_Options,_Index>::ReverseInnerIterator Base;
public:
ReverseInnerIterator(const DynamicSparseMatrix& mat, Index outer)
: Base(mat.m_data[outer]), m_outer(outer)
{}
inline Index row() const { return IsRowMajor ? m_outer : Base::index(); }
inline Index col() const { return IsRowMajor ? Base::index() : m_outer; }
protected:
const Index m_outer;
};
#endif // EIGEN_DYNAMIC_SPARSEMATRIX_H