11 #ifndef EIGEN_DIAGONAL_H 12 #define EIGEN_DIAGONAL_H 36 template<
typename MatrixType,
int DiagIndex>
47 ColsAtCompileTime = 1,
48 MaxRowsAtCompileTime =
int(MatrixType::MaxSizeAtCompileTime) ==
Dynamic ?
Dynamic 50 MatrixType::MaxColsAtCompileTime)
53 MaxColsAtCompileTime = 1,
56 CoeffReadCost = _MatrixTypeNested::CoeffReadCost,
58 InnerStrideAtCompileTime = MatrixTypeOuterStride ==
Dynamic ?
Dynamic : MatrixTypeOuterStride+1,
59 OuterStrideAtCompileTime = 0
64 template<
typename MatrixType,
int _DiagIndex>
class Diagonal 69 enum { DiagIndex = _DiagIndex };
73 inline
Diagonal(MatrixType& matrix, Index a_index = DiagIndex) : m_matrix(matrix), m_index(a_index) {}
77 inline Index rows()
const 78 {
return m_index.value()<0 ? (std::min<Index>)(m_matrix.cols(),m_matrix.rows()+m_index.value()) : (std::min<Index>)(m_matrix.rows(),m_matrix.cols()-m_index.value()); }
80 inline Index
cols()
const {
return 1; }
84 return m_matrix.outerStride() + 1;
98 inline ScalarWithConstIfNotLvalue*
data() {
return &(m_matrix.const_cast_derived().coeffRef(rowOffset(), colOffset())); }
99 inline const Scalar*
data()
const {
return &(m_matrix.const_cast_derived().coeffRef(rowOffset(), colOffset())); }
104 return m_matrix.const_cast_derived().coeffRef(row+rowOffset(), row+colOffset());
109 return m_matrix.const_cast_derived().coeffRef(row+rowOffset(), row+colOffset());
112 inline CoeffReturnType
coeff(Index
row, Index)
const 114 return m_matrix.coeff(row+rowOffset(), row+colOffset());
120 return m_matrix.const_cast_derived().coeffRef(idx+rowOffset(), idx+colOffset());
125 return m_matrix.const_cast_derived().coeffRef(idx+rowOffset(), idx+colOffset());
128 inline CoeffReturnType
coeff(Index idx)
const 130 return m_matrix.coeff(idx+rowOffset(), idx+colOffset());
141 return m_index.value();
154 template<
int LoadMode>
typename MatrixType::PacketReturnType packet(Index)
const;
155 template<
int LoadMode>
typename MatrixType::PacketReturnType packet(Index,Index)
const;
166 template<
typename Derived>
174 template<
typename Derived>
192 template<
typename Derived>
200 template<
typename Derived>
218 template<
typename Derived>
227 template<
typename Derived>
237 #endif // EIGEN_DIAGONAL_H MatrixType::Nested m_matrix
#define EIGEN_STRONG_INLINE
CoeffReturnType coeff(Index idx) const
EIGEN_STRONG_INLINE Index absDiagIndex() const
Index innerStride() const
internal::traits< Derived >::Index Index
The type of indices.
Expression of the transpose of a matrix.
const unsigned int DirectAccessBit
DiagonalReturnType diagonal()
const unsigned int LvalueBit
MatrixType::StorageKind StorageKind
Scalar & coeffRef(Index idx)
#define EIGEN_PLAIN_ENUM_MIN(a, b)
internal::conditional< internal::is_lvalue< MatrixType >::value, Scalar, const Scalar >::type ScalarWithConstIfNotLvalue
#define EIGEN_SIZE_MIN_PREFER_FIXED(a, b)
const unsigned int RowMajorBit
CoeffReturnType coeff(Index row, Index) const
#define EIGEN_STATIC_ASSERT_LVALUE(Derived)
#define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived)
const Scalar * data() const
const unsigned int HereditaryBits
remove_reference< MatrixTypeNested >::type _MatrixTypeNested
internal::dense_xpr_base< Diagonal >::type Base
Scalar & coeffRef(Index row, Index)
Index outerStride() const
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
const Scalar & coeffRef(Index idx) const
const internal::variable_if_dynamicindex< Index, DiagIndex > m_index
EIGEN_STRONG_INLINE Index colOffset() const
ScalarWithConstIfNotLvalue * data()
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
const Scalar & coeffRef(Index row, Index) const
const internal::remove_all< typename MatrixType::Nested >::type & nestedExpression() const
Base class for all dense matrices, vectors, and expressions.
const unsigned int LinearAccessBit
#define EIGEN_PLAIN_ENUM_MAX(a, b)
EIGEN_STRONG_INLINE Index rowOffset() const
nested< MatrixType >::type MatrixTypeNested