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,
57 InnerStrideAtCompileTime = MatrixTypeOuterStride ==
Dynamic ?
Dynamic : MatrixTypeOuterStride+1,
58 OuterStrideAtCompileTime = 0
63 template<
typename MatrixType,
int _DiagIndex>
class Diagonal 68 enum { DiagIndex = _DiagIndex };
73 explicit inline
Diagonal(MatrixType& matrix,
Index a_index = DiagIndex) : m_matrix(matrix), m_index(a_index) {}
80 return m_index.value()<0 ? numext::mini<Index>(m_matrix.cols(),m_matrix.rows()+m_index.value())
81 : numext::mini<Index>(m_matrix.rows(),m_matrix.cols()-m_index.value());
90 return m_matrix.outerStride() + 1;
106 inline ScalarWithConstIfNotLvalue*
data() {
return &(m_matrix.coeffRef(rowOffset(), colOffset())); }
108 inline const Scalar*
data()
const {
return &(m_matrix.coeffRef(rowOffset(), colOffset())); }
114 return m_matrix.coeffRef(row+rowOffset(), row+colOffset());
120 return m_matrix.coeffRef(row+rowOffset(), row+colOffset());
126 return m_matrix.coeff(row+rowOffset(), row+colOffset());
133 return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset());
139 return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset());
145 return m_matrix.coeff(idx+rowOffset(), idx+colOffset());
158 return m_index.value();
174 template<
int LoadMode>
typename MatrixType::PacketReturnType packet(
Index)
const;
175 template<
int LoadMode>
typename MatrixType::PacketReturnType packet(
Index,
Index)
const;
186 template<
typename Derived>
194 template<
typename Derived>
212 template<
typename Derived>
220 template<
typename Derived>
238 template<
typename Derived>
247 template<
typename Derived>
257 #endif // EIGEN_DIAGONAL_H EIGEN_DEVICE_FUNC Index innerStride() const
#define EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC Index cols() const
EIGEN_DEVICE_FUNC const internal::remove_all< typename MatrixType::Nested >::type & nestedExpression() const
const unsigned int DirectAccessBit
const unsigned int LvalueBit
MatrixType::StorageKind StorageKind
#define EIGEN_PLAIN_ENUM_MAX(a, b)
EIGEN_DEVICE_FUNC ScalarWithConstIfNotLvalue * data()
internal::conditional< internal::is_lvalue< MatrixType >::value, Scalar, const Scalar >::type ScalarWithConstIfNotLvalue
EIGEN_DEVICE_FUNC const Scalar * data() const
const unsigned int RowMajorBit
#define EIGEN_SIZE_MIN_PREFER_FIXED(a, b)
EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index row, Index) const
#define EIGEN_STATIC_ASSERT_LVALUE(Derived)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index absDiagIndex() const
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index row, Index)
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T value()
EIGEN_DEVICE_FUNC Index index() const
EIGEN_DEVICE_FUNC Index outerStride() const
remove_reference< MatrixTypeNested >::type _MatrixTypeNested
ref_selector< MatrixType >::type MatrixTypeNested
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
internal::dense_xpr_base< Diagonal >::type Base
EIGEN_DEVICE_FUNC RowXpr row(Index i)
This is the const version of row(). */.
EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index idx) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rowOffset() const
#define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived)
EIGEN_DEVICE_FUNC Index rows() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index colOffset() const
#define EIGEN_PLAIN_ENUM_MIN(a, b)
const internal::variable_if_dynamicindex< Index, DiagIndex > m_index
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
EIGEN_DEVICE_FUNC const Scalar & coeffRef(Index row, Index) const
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal()
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index idx)
internal::ref_selector< MatrixType >::non_const_type m_matrix
Base class for all dense matrices, vectors, and expressions.
EIGEN_DEVICE_FUNC const Scalar & coeffRef(Index idx) const