MOAB  4.9.3pre
Eigen::Diagonal< MatrixType, _DiagIndex > Class Template Reference

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

#include <Diagonal.h>

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

List of all members.

Public Types

enum  { DiagIndex = _DiagIndex }
typedef
internal::dense_xpr_base
< Diagonal >::type 
Base
typedef internal::conditional
< internal::is_lvalue
< MatrixType >::value, Scalar,
const Scalar >::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
ScalarWithConstIfNotLvalue
data ()
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< typename
MatrixType::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, DiagIndex
m_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 Dynamic 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)

Definition at line 63 of file Diagonal.h.


Member Typedef Documentation

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

Definition at line 69 of file Diagonal.h.

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

Definition at line 103 of file Diagonal.h.


Member Enumeration Documentation

template<typename MatrixType, int _DiagIndex>
anonymous enum
Enumerator:
DiagIndex 

Definition at line 68 of file Diagonal.h.

{ DiagIndex = _DiagIndex };

Constructor & Destructor Documentation

template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC Eigen::Diagonal< MatrixType, _DiagIndex >::Diagonal ( MatrixType &  matrix,
Index  a_index = DiagIndex 
) [inline, explicit]

Definition at line 73 of file Diagonal.h.

: m_matrix(matrix), m_index(a_index) {}

Member Function Documentation

template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::Diagonal< MatrixType, _DiagIndex >::absDiagIndex ( ) const [inline, private]

Definition at line 168 of file Diagonal.h.

{ return m_index.value()>0 ? m_index.value() : -m_index.value(); }
template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC CoeffReturnType Eigen::Diagonal< MatrixType, _DiagIndex >::coeff ( Index  row,
Index   
) const [inline]

Definition at line 124 of file Diagonal.h.

    {
      return m_matrix.coeff(row+rowOffset(), row+colOffset());
    }
template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC CoeffReturnType Eigen::Diagonal< MatrixType, _DiagIndex >::coeff ( Index  idx) const [inline]

Definition at line 143 of file Diagonal.h.

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

Definition at line 111 of file Diagonal.h.

template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC const Scalar& Eigen::Diagonal< MatrixType, _DiagIndex >::coeffRef ( Index  row,
Index   
) const [inline]

Definition at line 118 of file Diagonal.h.

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

Definition at line 130 of file Diagonal.h.

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

Definition at line 137 of file Diagonal.h.

    {
      return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset());
    }
template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::Diagonal< MatrixType, _DiagIndex >::colOffset ( ) const [inline, private]

Definition at line 172 of file Diagonal.h.

{ return m_index.value()>0 ? m_index.value() : 0; }
template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC Index Eigen::Diagonal< MatrixType, _DiagIndex >::cols ( void  ) const [inline]

Definition at line 85 of file Diagonal.h.

{ return 1; }
template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC ScalarWithConstIfNotLvalue* Eigen::Diagonal< MatrixType, _DiagIndex >::data ( ) [inline]

Definition at line 106 of file Diagonal.h.

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

Definition at line 108 of file Diagonal.h.

{ return &(m_matrix.coeffRef(rowOffset(), colOffset())); }
template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC Index Eigen::Diagonal< MatrixType, _DiagIndex >::index ( ) const [inline]

Definition at line 156 of file Diagonal.h.

    {
      return m_index.value();
    }
template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC Index Eigen::Diagonal< MatrixType, _DiagIndex >::innerStride ( ) const [inline]

Definition at line 88 of file Diagonal.h.

    {
      return m_matrix.outerStride() + 1;
    }
template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC const internal::remove_all<typename MatrixType::Nested>::type& Eigen::Diagonal< MatrixType, _DiagIndex >::nestedExpression ( ) const [inline]

Definition at line 150 of file Diagonal.h.

    {
      return m_matrix;
    }
template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC Index Eigen::Diagonal< MatrixType, _DiagIndex >::outerStride ( ) const [inline]

Definition at line 94 of file Diagonal.h.

    {
      return 0;
    }
template<typename MatrixType, int _DiagIndex>
template<int LoadMode>
MatrixType::PacketReturnType Eigen::Diagonal< MatrixType, _DiagIndex >::packet ( Index  ) const [private]
template<typename MatrixType, int _DiagIndex>
template<int LoadMode>
MatrixType::PacketReturnType Eigen::Diagonal< MatrixType, _DiagIndex >::packet ( Index  ,
Index   
) const [private]
template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::Diagonal< MatrixType, _DiagIndex >::rowOffset ( ) const [inline, private]

Definition at line 170 of file Diagonal.h.

{ return m_index.value()>0 ? 0 : -m_index.value(); }
template<typename MatrixType, int _DiagIndex>
EIGEN_DEVICE_FUNC Index Eigen::Diagonal< MatrixType, _DiagIndex >::rows ( void  ) const [inline]

Definition at line 78 of file Diagonal.h.

    {
      return m_index.value()<0 ? numext::mini<Index>(m_matrix.cols(),m_matrix.rows()+m_index.value())
                               : numext::mini<Index>(m_matrix.rows(),m_matrix.cols()-m_index.value());
    }

Member Data Documentation

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

Definition at line 163 of file Diagonal.h.

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

Definition at line 162 of file Diagonal.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines