diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-05-08 14:19:04 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-05-08 14:19:04 -0400 |
commit | 65bd1652b1d8eaf1f40ed6719ece41eceabfbc08 (patch) | |
tree | 029e18807545c7c18edb433f0742112dd7d131aa /Eigen/src/Core/Diagonal.h | |
parent | bfdc1c49730c79e6058ba1506628341559670c25 (diff) |
let Diagonal have the DirectAccessBit, using an inner stride
Diffstat (limited to 'Eigen/src/Core/Diagonal.h')
-rw-r--r-- | Eigen/src/Core/Diagonal.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h index 287ff3f8e..ce7cfc3b0 100644 --- a/Eigen/src/Core/Diagonal.h +++ b/Eigen/src/Core/Diagonal.h @@ -58,8 +58,11 @@ struct ei_traits<Diagonal<MatrixType,Index> > : Index == Dynamic ? EIGEN_ENUM_MIN(MatrixType::MaxRowsAtCompileTime, MatrixType::MaxColsAtCompileTime) : (EIGEN_ENUM_MIN(MatrixType::MaxRowsAtCompileTime, MatrixType::MaxColsAtCompileTime) - AbsIndex), MaxColsAtCompileTime = 1, - Flags = (unsigned int)_MatrixTypeNested::Flags & (HereditaryBits | LinearAccessBit) & ~RowMajorBit, - CoeffReadCost = _MatrixTypeNested::CoeffReadCost + Flags = (unsigned int)_MatrixTypeNested::Flags & (HereditaryBits | LinearAccessBit | DirectAccessBit) & ~RowMajorBit, + CoeffReadCost = _MatrixTypeNested::CoeffReadCost, + MatrixTypeOuterStride = ei_outer_stride_at_compile_time<MatrixType>::ret, + InnerStrideAtCompileTime = MatrixTypeOuterStride == Dynamic ? Dynamic : MatrixTypeOuterStride+1, + OuterStrideAtCompileTime = 0 }; }; @@ -85,6 +88,16 @@ template<typename MatrixType, int Index> class Diagonal inline int cols() const { return 1; } + inline int innerStride() const + { + return m_matrix.outerStride() + 1; + } + + inline int outerStride() const + { + return 0; + } + inline Scalar& coeffRef(int row, int) { return m_matrix.const_cast_derived().coeffRef(row+rowOffset(), row+colOffset()); |