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)
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;
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;
185 template<
typename Derived>
193 template<
typename Derived>
211 template<
typename Derived>
219 template<
typename Derived>
237 template<
typename Derived>
247 template<
typename Derived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RowXpr row(Index i)
This is the const version of row(). */.
Definition: BlockMethods.h:1118
#define EIGEN_PLAIN_ENUM_MAX(a, b)
Definition: Macros.h:1289
#define EIGEN_PLAIN_ENUM_MIN(a, b)
Definition: Macros.h:1288
#define EIGEN_NOEXCEPT
Definition: Macros.h:1418
#define EIGEN_CONSTEXPR
Definition: Macros.h:787
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:1283
#define eigen_assert(x)
Definition: Macros.h:1037
#define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived)
Definition: Macros.h:1231
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
#define EIGEN_SIZE_MIN_PREFER_FIXED(a, b)
Definition: Macros.h:1302
#define EIGEN_STATIC_ASSERT_LVALUE(Derived)
Definition: StaticAssert.h:202
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
Definition: Diagonal.h:65
const internal::variable_if_dynamicindex< Index, DiagIndex > m_index
Definition: Diagonal.h:162
EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index row, Index) const
Definition: Diagonal.h:123
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index idx)
Definition: Diagonal.h:129
EIGEN_DEVICE_FUNC Diagonal(MatrixType &matrix, Index a_index=DiagIndex)
Definition: Diagonal.h:73
EIGEN_DEVICE_FUNC Index index() const
Definition: Diagonal.h:155
EIGEN_DEVICE_FUNC Index rows() const
Definition: Diagonal.h:81
EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index idx) const
Definition: Diagonal.h:142
EIGEN_DEVICE_FUNC ScalarWithConstIfNotLvalue * data()
Definition: Diagonal.h:105
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index colOffset() const EIGEN_NOEXCEPT
Definition: Diagonal.h:171
MatrixType::PacketReturnType packet(Index) const
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: Diagonal.h:88
internal::conditional< internal::is_lvalue< MatrixType >::value, Scalar, const Scalar >::type ScalarWithConstIfNotLvalue
Definition: Diagonal.h:102
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index absDiagIndex() const EIGEN_NOEXCEPT
Definition: Diagonal.h:167
EIGEN_DEVICE_FUNC const internal::remove_all< typename MatrixType::Nested >::type & nestedExpression() const
Definition: Diagonal.h:149
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerStride() const EIGEN_NOEXCEPT
Definition: Diagonal.h:91
EIGEN_DEVICE_FUNC const Scalar * data() const
Definition: Diagonal.h:107
internal::ref_selector< MatrixType >::non_const_type m_matrix
Definition: Diagonal.h:161
EIGEN_DEVICE_FUNC const Scalar & coeffRef(Index row, Index) const
Definition: Diagonal.h:117
internal::dense_xpr_base< Diagonal >::type Base
Definition: Diagonal.h:69
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index row, Index)
Definition: Diagonal.h:110
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT
Definition: Diagonal.h:96
EIGEN_DEVICE_FUNC const Scalar & coeffRef(Index idx) const
Definition: Diagonal.h:136
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rowOffset() const EIGEN_NOEXCEPT
Definition: Diagonal.h:169
MatrixType::PacketReturnType packet(Index, Index) const
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:50
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal()
Definition: Diagonal.h:187
Expression of the transpose of a matrix.
Definition: Transpose.h:54
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value()
Definition: XprHelper.h:160
const unsigned int DirectAccessBit
Definition: Constants.h:155
const unsigned int LvalueBit
Definition: Constants.h:144
const unsigned int RowMajorBit
Definition: Constants.h:66
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
const int DynamicIndex
Definition: Constants.h:27
const int Dynamic
Definition: Constants.h:22
type
The type the bitset is encoded with.
Definition: bitset.hpp:44
Flags
Special flags for archives.
Definition: cereal.hpp:185
Definition: document.h:416
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1282
Type
Type of JSON value.
Definition: rapidjson.h:644
Definition: XprHelper.h:484
Definition: XprHelper.h:660
Definition: DenseCoeffsBase.h:671
Definition: XprHelper.h:417
T type
Definition: Meta.h:126
T type
Definition: Meta.h:114
remove_reference< MatrixTypeNested >::type _MatrixTypeNested
Definition: Diagonal.h:41
MatrixType::StorageKind StorageKind
Definition: Diagonal.h:42
ref_selector< MatrixType >::type MatrixTypeNested
Definition: Diagonal.h:40
Definition: ForwardDeclarations.h:17
#define const
Definition: zconf.h:233