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());
92 return m_matrix.outerStride() + 1;
105 inline ScalarWithConstIfNotLvalue*
data() {
return &(m_matrix.coeffRef(rowOffset(), colOffset())); }
107 inline const Scalar*
data()
const {
return &(m_matrix.coeffRef(rowOffset(), colOffset())); }
113 return m_matrix.coeffRef(row+rowOffset(), row+colOffset());
119 return m_matrix.coeffRef(row+rowOffset(), row+colOffset());
125 return m_matrix.coeff(row+rowOffset(), row+colOffset());
132 return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset());
138 return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset());
144 return m_matrix.coeff(idx+rowOffset(), idx+colOffset());
157 return m_index.value();
173 template<
int LoadMode>
typename MatrixType::PacketReturnType packet(
Index)
const;
174 template<
int LoadMode>
typename MatrixType::PacketReturnType packet(
Index,
Index)
const;
185 template<
typename Derived>
193 template<
typename Derived>
211 template<
typename Derived>
219 template<
typename Derived>
237 template<
typename Derived>
247 template<
typename Derived>
258 #endif // EIGEN_DIAGONAL_H EIGEN_DEVICE_FUNC Index rows() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index colOffset() const EIGEN_NOEXCEPT
#define EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC const internal::remove_all< typename MatrixType::Nested >::type & nestedExpression() const
Expression of the transpose of a matrix.
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
const unsigned int RowMajorBit
#define EIGEN_SIZE_MIN_PREFER_FIXED(a, b)
#define EIGEN_STATIC_ASSERT_LVALUE(Derived)
EIGEN_DEVICE_FUNC Index index() const
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index row, Index)
remove_reference< MatrixTypeNested >::type _MatrixTypeNested
ref_selector< MatrixType >::type MatrixTypeNested
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index idx) const
internal::dense_xpr_base< Diagonal >::type Base
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rowOffset() const EIGEN_NOEXCEPT
#define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived)
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerStride() const EIGEN_NOEXCEPT
EIGEN_DEVICE_FUNC const Scalar & coeffRef(Index row, Index) const
EIGEN_DEVICE_FUNC const Scalar * data() const
EIGEN_DEVICE_FUNC Diagonal(MatrixType &matrix, Index a_index=DiagIndex)
#define EIGEN_DEVICE_FUNC
#define EIGEN_PLAIN_ENUM_MIN(a, b)
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal()
const internal::variable_if_dynamicindex< Index, DiagIndex > m_index
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index idx)
Generic expression where a coefficient-wise unary operator is applied to an expression.
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 EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT
EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index row, Index) const
EIGEN_DEVICE_FUNC const Scalar & coeffRef(Index idx) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index absDiagIndex() const EIGEN_NOEXCEPT