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 };
75 eigen_assert( a_index <= m_matrix.cols() && -a_index <= m_matrix.rows() );
83 return m_index.value()<0 ? numext::mini<Index>(m_matrix.cols(),m_matrix.rows()+m_index.value())
84 : numext::mini<Index>(m_matrix.rows(),m_matrix.cols()-m_index.value());
93 return m_matrix.outerStride() + 1;
109 inline ScalarWithConstIfNotLvalue*
data() {
return &(m_matrix.coeffRef(rowOffset(), colOffset())); }
111 inline const Scalar*
data()
const {
return &(m_matrix.coeffRef(rowOffset(), colOffset())); }
117 return m_matrix.coeffRef(row+rowOffset(), row+colOffset());
123 return m_matrix.coeffRef(row+rowOffset(), row+colOffset());
129 return m_matrix.coeff(row+rowOffset(), row+colOffset());
136 return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset());
142 return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset());
148 return m_matrix.coeff(idx+rowOffset(), idx+colOffset());
161 return m_index.value();
177 template<
int LoadMode>
typename MatrixType::PacketReturnType packet(
Index)
const;
178 template<
int LoadMode>
typename MatrixType::PacketReturnType packet(
Index,
Index)
const;
189 template<
typename Derived>
197 template<
typename Derived>
215 template<
typename Derived>
223 template<
typename Derived>
241 template<
typename Derived>
250 template<
typename Derived>
260 #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)
Namespace containing all symbols from the Eigen library.
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 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)
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
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