Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::Diagonal< MatrixType, _DiagIndex > Class Template Reference

Expression of a diagonal/subdiagonal/superdiagonal in a matrix. More...

#include <src/eigen/Eigen/src/Core/Diagonal.h>

+ Inheritance diagram for Eigen::Diagonal< MatrixType, _DiagIndex >:
+ Collaboration diagram for Eigen::Diagonal< MatrixType, _DiagIndex >:

Public Types

enum  { DiagIndex = _DiagIndex }
 
typedef internal::dense_xpr_base< Diagonal >::type Base
 
typedef internal::conditional< internal::is_lvalue< MatrixType >::value, Scalar, constScalar >::type ScalarWithConstIfNotLvalue
 

Public Member Functions

EIGEN_DEVICE_FUNC Diagonal (MatrixType &matrix, Index a_index=DiagIndex)
 
EIGEN_DEVICE_FUNC Index rows () const
 
EIGEN_DEVICE_FUNC Index cols () const
 
EIGEN_DEVICE_FUNC Index innerStride () const
 
EIGEN_DEVICE_FUNC Index outerStride () const
 
EIGEN_DEVICE_FUNC ScalarWithConstIfNotLvaluedata ()
 
EIGEN_DEVICE_FUNC const Scalar * data () const
 
EIGEN_DEVICE_FUNC Scalar & coeffRef (Index row, Index)
 
EIGEN_DEVICE_FUNC const Scalar & coeffRef (Index row, Index) const
 
EIGEN_DEVICE_FUNC CoeffReturnType coeff (Index row, Index) const
 
EIGEN_DEVICE_FUNC Scalar & coeffRef (Index idx)
 
EIGEN_DEVICE_FUNC const Scalar & coeffRef (Index idx) const
 
EIGEN_DEVICE_FUNC CoeffReturnType coeff (Index idx) const
 
EIGEN_DEVICE_FUNC const internal::remove_all< typenameMatrixType::Nested >::type & nestedExpression () const
 
EIGEN_DEVICE_FUNC Index index () const
 

Protected Attributes

internal::ref_selector< MatrixType >::non_const_type m_matrix
 
const internal::variable_if_dynamicindex< Index, DiagIndexm_index
 

Private Member Functions

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index absDiagIndex () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rowOffset () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index colOffset () const
 
template<int LoadMode>
MatrixType::PacketReturnType packet (Index) const
 
template<int LoadMode>
MatrixType::PacketReturnType packet (Index, Index) const
 

Detailed Description

template<typename MatrixType, int _DiagIndex>
class Eigen::Diagonal< MatrixType, _DiagIndex >

Expression of a diagonal/subdiagonal/superdiagonal in a matrix.

Parameters
MatrixTypethe type of the object in which we are taking a sub/main/super diagonal
DiagIndexthe index of the sub/super diagonal. The default is 0 and it means the main diagonal. A positive value means a superdiagonal, a negative value means a subdiagonal. You can also use DynamicIndex so the index can be set at runtime.

The matrix is not required to be square.

This class represents an expression of the main diagonal, or any sub/super diagonal of a square matrix. It is the return type of MatrixBase::diagonal() and MatrixBase::diagonal(Index) and most of the time this is the only way it is used.

See also
MatrixBase::diagonal(), MatrixBase::diagonal(Index)

Member Typedef Documentation

◆ Base

template<typename MatrixType , int _DiagIndex>
typedef internal::dense_xpr_base<Diagonal>::type Eigen::Diagonal< MatrixType, _DiagIndex >::Base

◆ ScalarWithConstIfNotLvalue

template<typename MatrixType , int _DiagIndex>
typedef internal::conditional<internal::is_lvalue<MatrixType>::value,Scalar,constScalar>::type Eigen::Diagonal< MatrixType, _DiagIndex >::ScalarWithConstIfNotLvalue

Member Enumeration Documentation

◆ anonymous enum

template<typename MatrixType , int _DiagIndex>
anonymous enum
Enumerator
DiagIndex 
68{ DiagIndex = _DiagIndex };
@ DiagIndex
Definition Diagonal.h:68

Constructor & Destructor Documentation

◆ Diagonal()

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC Eigen::Diagonal< MatrixType, _DiagIndex >::Diagonal ( MatrixType &  matrix,
Index  a_index = DiagIndex 
)
inlineexplicit
73 : m_matrix(matrix), m_index(a_index)
74 {
75 eigen_assert( a_index <= m_matrix.cols() && -a_index <= m_matrix.rows() );
76 }
#define eigen_assert(x)
Definition Macros.h:579
const internal::variable_if_dynamicindex< Index, DiagIndex > m_index
Definition Diagonal.h:166
internal::ref_selector< MatrixType >::non_const_type m_matrix
Definition Diagonal.h:165

References eigen_assert.

Member Function Documentation

◆ absDiagIndex()

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::Diagonal< MatrixType, _DiagIndex >::absDiagIndex ( ) const
inlineprivate
171{ return m_index.value()>0 ? m_index.value() : -m_index.value(); }
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T value()
Definition XprHelper.h:132

References Eigen::internal::variable_if_dynamicindex< T, Value >::value().

+ Here is the call graph for this function:

◆ coeff() [1/2]

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC CoeffReturnType Eigen::Diagonal< MatrixType, _DiagIndex >::coeff ( Index  idx) const
inline
147 {
148 return m_matrix.coeff(idx+rowOffset(), idx+colOffset());
149 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index colOffset() const
Definition Diagonal.h:175
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rowOffset() const
Definition Diagonal.h:173

◆ coeff() [2/2]

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC CoeffReturnType Eigen::Diagonal< MatrixType, _DiagIndex >::coeff ( Index  row,
Index   
) const
inline
128 {
129 return m_matrix.coeff(row+rowOffset(), row+colOffset());
130 }
EIGEN_DEVICE_FUNC RowXpr row(Index i)
This is the const version of row(). *‍/.
Definition BlockMethods.h:859

References row().

+ Here is the call graph for this function:

◆ coeffRef() [1/4]

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC Scalar & Eigen::Diagonal< MatrixType, _DiagIndex >::coeffRef ( Index  idx)
inline
134 {
136 return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset());
137 }
#define EIGEN_STATIC_ASSERT_LVALUE(Derived)
Definition StaticAssert.h:199

References EIGEN_STATIC_ASSERT_LVALUE.

◆ coeffRef() [2/4]

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC const Scalar & Eigen::Diagonal< MatrixType, _DiagIndex >::coeffRef ( Index  idx) const
inline
141 {
142 return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset());
143 }

◆ coeffRef() [3/4]

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC Scalar & Eigen::Diagonal< MatrixType, _DiagIndex >::coeffRef ( Index  row,
Index   
)
inline
115 {
117 return m_matrix.coeffRef(row+rowOffset(), row+colOffset());
118 }

References EIGEN_STATIC_ASSERT_LVALUE, and row().

+ Here is the call graph for this function:

◆ coeffRef() [4/4]

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC const Scalar & Eigen::Diagonal< MatrixType, _DiagIndex >::coeffRef ( Index  row,
Index   
) const
inline
122 {
123 return m_matrix.coeffRef(row+rowOffset(), row+colOffset());
124 }

References row().

+ Here is the call graph for this function:

◆ colOffset()

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::Diagonal< MatrixType, _DiagIndex >::colOffset ( ) const
inlineprivate
175{ return m_index.value()>0 ? m_index.value() : 0; }

References Eigen::internal::variable_if_dynamicindex< T, Value >::value().

+ Here is the call graph for this function:

◆ cols()

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC Index Eigen::Diagonal< MatrixType, _DiagIndex >::cols ( ) const
inline
88{ return 1; }

Referenced by Eigen::internal::trmv_selector< Mode, RowMajor >::run().

+ Here is the caller graph for this function:

◆ data() [1/2]

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC ScalarWithConstIfNotLvalue * Eigen::Diagonal< MatrixType, _DiagIndex >::data ( )
inline
109{ return &(m_matrix.coeffRef(rowOffset(), colOffset())); }

Referenced by Eigen::internal::trmv_selector< Mode, RowMajor >::run().

+ Here is the caller graph for this function:

◆ data() [2/2]

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC const Scalar * Eigen::Diagonal< MatrixType, _DiagIndex >::data ( ) const
inline
111{ return &(m_matrix.coeffRef(rowOffset(), colOffset())); }

◆ index()

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC Index Eigen::Diagonal< MatrixType, _DiagIndex >::index ( ) const
inline
160 {
161 return m_index.value();
162 }

◆ innerStride()

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC Index Eigen::Diagonal< MatrixType, _DiagIndex >::innerStride ( ) const
inline
92 {
93 return m_matrix.outerStride() + 1;
94 }

◆ nestedExpression()

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC const internal::remove_all< typenameMatrixType::Nested >::type & Eigen::Diagonal< MatrixType, _DiagIndex >::nestedExpression ( ) const
inline
154 {
155 return m_matrix;
156 }

◆ outerStride()

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC Index Eigen::Diagonal< MatrixType, _DiagIndex >::outerStride ( ) const
inline
98 {
99 return 0;
100 }

Referenced by Eigen::internal::trmv_selector< Mode, RowMajor >::run().

+ Here is the caller graph for this function:

◆ packet() [1/2]

template<typename MatrixType , int _DiagIndex>
template<int LoadMode>
MatrixType::PacketReturnType Eigen::Diagonal< MatrixType, _DiagIndex >::packet ( Index  ) const
private

◆ packet() [2/2]

template<typename MatrixType , int _DiagIndex>
template<int LoadMode>
MatrixType::PacketReturnType Eigen::Diagonal< MatrixType, _DiagIndex >::packet ( Index  ,
Index   
) const
private

◆ rowOffset()

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::Diagonal< MatrixType, _DiagIndex >::rowOffset ( ) const
inlineprivate
173{ return m_index.value()>0 ? 0 : -m_index.value(); }

References Eigen::internal::variable_if_dynamicindex< T, Value >::value().

+ Here is the call graph for this function:

◆ rows()

template<typename MatrixType , int _DiagIndex>
EIGEN_DEVICE_FUNC Index Eigen::Diagonal< MatrixType, _DiagIndex >::rows ( ) const
inline
82 {
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());
85 }
EIGEN_DEVICE_FUNC Index rows() const
Definition Diagonal.h:81
EIGEN_DEVICE_FUNC Index cols() const
Definition Diagonal.h:88
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition MathFunctions.h:815
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:33

Referenced by Eigen::internal::trmv_selector< Mode, RowMajor >::run().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_index

template<typename MatrixType , int _DiagIndex>
const internal::variable_if_dynamicindex<Index, DiagIndex> Eigen::Diagonal< MatrixType, _DiagIndex >::m_index
protected

◆ m_matrix

template<typename MatrixType , int _DiagIndex>
internal::ref_selector<MatrixType>::non_const_type Eigen::Diagonal< MatrixType, _DiagIndex >::m_matrix
protected

The documentation for this class was generated from the following file: