Public Types | Public Member Functions | Protected Attributes

Diagonal< MatrixType, DiagIndex > Class Template Reference

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

#include <Diagonal.h>

List of all members.

Public Types

typedef
internal::dense_xpr_base
< Diagonal >::type 
Base

Public Member Functions

 Diagonal (MatrixType &matrix, Index index=DiagIndex)
Index rows () const
Index cols () const
Index innerStride () const
Index outerStride () const
Scalar & coeffRef (Index row, Index)
const Scalar & coeffRef (Index row, Index) const
CoeffReturnType coeff (Index row, Index) const
Scalar & coeffRef (Index index)
const Scalar & coeffRef (Index index) const
CoeffReturnType coeff (Index index) const

Protected Attributes

const MatrixType::Nested m_matrix
const
internal::variable_if_dynamic
< Index, DiagIndex > 
m_index

Detailed Description

template<typename MatrixType, int DiagIndex>
class Diagonal< MatrixType, DiagIndex >

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

Parameters:
MatrixType the type of the object in which we are taking a sub/main/super diagonal
DiagIndex the 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)

Member Typedef Documentation

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

Constructor & Destructor Documentation

template<typename MatrixType , int DiagIndex>
Diagonal< MatrixType, DiagIndex >::Diagonal ( MatrixType &  matrix,
Index  index = DiagIndex 
) [inline]

Member Function Documentation

template<typename MatrixType , int DiagIndex>
CoeffReturnType Diagonal< MatrixType, DiagIndex >::coeff ( Index  row,
Index   
) const [inline]
template<typename MatrixType , int DiagIndex>
CoeffReturnType Diagonal< MatrixType, DiagIndex >::coeff ( Index  index  )  const [inline]
template<typename MatrixType , int DiagIndex>
const Scalar& Diagonal< MatrixType, DiagIndex >::coeffRef ( Index  index  )  const [inline]
template<typename MatrixType , int DiagIndex>
Scalar& Diagonal< MatrixType, DiagIndex >::coeffRef ( Index  index  )  [inline]
template<typename MatrixType , int DiagIndex>
const Scalar& Diagonal< MatrixType, DiagIndex >::coeffRef ( Index  row,
Index   
) const [inline]
template<typename MatrixType , int DiagIndex>
Scalar& Diagonal< MatrixType, DiagIndex >::coeffRef ( Index  row,
Index   
) [inline]
template<typename MatrixType , int DiagIndex>
Index Diagonal< MatrixType, DiagIndex >::cols ( void   )  const [inline]
template<typename MatrixType , int DiagIndex>
Index Diagonal< MatrixType, DiagIndex >::innerStride (  )  const [inline]
template<typename MatrixType , int DiagIndex>
Index Diagonal< MatrixType, DiagIndex >::outerStride (  )  const [inline]
template<typename MatrixType , int DiagIndex>
Index Diagonal< MatrixType, DiagIndex >::rows ( void   )  const [inline]

Member Data Documentation

template<typename MatrixType , int DiagIndex>
const internal::variable_if_dynamic<Index, DiagIndex> Diagonal< MatrixType, DiagIndex >::m_index [protected]
template<typename MatrixType , int DiagIndex>
const MatrixType::Nested Diagonal< MatrixType, DiagIndex >::m_matrix [protected]

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