Eigen::IndexedView< XprType, RowIndices, ColIndices > Class Template Reference

Expression of a non-sequential sub-matrix defined by arbitrary sequences of row and column indices. More...

+ Inheritance diagram for Eigen::IndexedView< XprType, RowIndices, ColIndices >:

Public Types

typedef IndexedViewImpl< XprType, RowIndices, ColIndices, typename internal::traits< XprType >::StorageKind >::Base Base
 
typedef internal::ref_selector< XprType >::non_const_type MatrixTypeNested
 
typedef internal::remove_all_t< XprType > NestedExpression
 

Public Member Functions

const ColIndices & colIndices () const
 
Index cols () const
 
template<typename T0 , typename T1 >
 IndexedView (XprType &xpr, const T0 &rowIndices, const T1 &colIndices)
 
std::remove_reference_t< XprType > & nestedExpression ()
 
const internal::remove_all_t< XprType > & nestedExpression () const
 
const RowIndices & rowIndices () const
 
Index rows () const
 

Protected Attributes

ColIndices m_colIndices
 
RowIndices m_rowIndices
 
MatrixTypeNested m_xpr
 

Detailed Description

template<typename XprType, typename RowIndices, typename ColIndices>
class Eigen::IndexedView< XprType, RowIndices, ColIndices >

Expression of a non-sequential sub-matrix defined by arbitrary sequences of row and column indices.

Template Parameters
XprTypethe type of the expression in which we are taking the intersections of sub-rows and sub-columns
RowIndicesthe type of the object defining the sequence of row indices
ColIndicesthe type of the object defining the sequence of column indices

This class represents an expression of a sub-matrix (or sub-vector) defined as the intersection of sub-sets of rows and columns, that are themself defined by generic sequences of row indices \( \{r_0,r_1,..r_{m-1}\} \) and column indices \( \{c_0,c_1,..c_{n-1} \}\). Let \( A \) be the nested matrix, then the resulting matrix \( B \) has m rows and n columns, and its entries are given by: \( B(i,j) = A(r_i,c_j) \).

The RowIndices and ColIndices types must be compatible with the following API:

<integral type> operator[](Index) const;
Index size() const;
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:82

Typical supported types thus include:

In typical usages of Eigen, this class should never be used directly. It is the return type of DenseBase::operator()(const RowIndices&, const ColIndices&).

See also
class Block

Definition at line 110 of file IndexedView.h.

Member Typedef Documentation

◆ Base

template<typename XprType , typename RowIndices , typename ColIndices >
typedef IndexedViewImpl<XprType, RowIndices, ColIndices, typename internal::traits<XprType>::StorageKind>::Base Eigen::IndexedView< XprType, RowIndices, ColIndices >::Base

Definition at line 113 of file IndexedView.h.

◆ MatrixTypeNested

template<typename XprType , typename RowIndices , typename ColIndices >
typedef internal::ref_selector<XprType>::non_const_type Eigen::IndexedView< XprType, RowIndices, ColIndices >::MatrixTypeNested

Definition at line 117 of file IndexedView.h.

◆ NestedExpression

template<typename XprType , typename RowIndices , typename ColIndices >
typedef internal::remove_all_t<XprType> Eigen::IndexedView< XprType, RowIndices, ColIndices >::NestedExpression

Definition at line 118 of file IndexedView.h.

Constructor & Destructor Documentation

◆ IndexedView()

template<typename XprType , typename RowIndices , typename ColIndices >
template<typename T0 , typename T1 >
Eigen::IndexedView< XprType, RowIndices, ColIndices >::IndexedView ( XprType &  xpr,
const T0 &  rowIndices,
const T1 &  colIndices 
)
inline

Definition at line 121 of file IndexedView.h.

123  {}
RowIndices m_rowIndices
Definition: IndexedView.h:147
ColIndices m_colIndices
Definition: IndexedView.h:148
MatrixTypeNested m_xpr
Definition: IndexedView.h:146
const ColIndices & colIndices() const
Definition: IndexedView.h:143
const RowIndices & rowIndices() const
Definition: IndexedView.h:140

Member Function Documentation

◆ colIndices()

template<typename XprType , typename RowIndices , typename ColIndices >
const ColIndices& Eigen::IndexedView< XprType, RowIndices, ColIndices >::colIndices ( ) const
inline
Returns
a const reference to the object storing/generating the column indices

Definition at line 143 of file IndexedView.h.

143 { return m_colIndices; }

◆ cols()

template<typename XprType , typename RowIndices , typename ColIndices >
Index Eigen::IndexedView< XprType, RowIndices, ColIndices >::cols ( void  ) const
inline
Returns
number of columns

Definition at line 129 of file IndexedView.h.

EIGEN_CONSTEXPR auto index_list_size(const T &x)
Definition: Meta.h:241

◆ nestedExpression() [1/2]

template<typename XprType , typename RowIndices , typename ColIndices >
std::remove_reference_t<XprType>& Eigen::IndexedView< XprType, RowIndices, ColIndices >::nestedExpression ( )
inline
Returns
the nested expression

Definition at line 137 of file IndexedView.h.

137 { return m_xpr; }

◆ nestedExpression() [2/2]

template<typename XprType , typename RowIndices , typename ColIndices >
const internal::remove_all_t<XprType>& Eigen::IndexedView< XprType, RowIndices, ColIndices >::nestedExpression ( ) const
inline
Returns
the nested expression

Definition at line 133 of file IndexedView.h.

133 { return m_xpr; }

◆ rowIndices()

template<typename XprType , typename RowIndices , typename ColIndices >
const RowIndices& Eigen::IndexedView< XprType, RowIndices, ColIndices >::rowIndices ( ) const
inline
Returns
a const reference to the object storing/generating the row indices

Definition at line 140 of file IndexedView.h.

140 { return m_rowIndices; }

◆ rows()

template<typename XprType , typename RowIndices , typename ColIndices >
Index Eigen::IndexedView< XprType, RowIndices, ColIndices >::rows ( void  ) const
inline
Returns
number of rows

Definition at line 126 of file IndexedView.h.

Member Data Documentation

◆ m_colIndices

template<typename XprType , typename RowIndices , typename ColIndices >
ColIndices Eigen::IndexedView< XprType, RowIndices, ColIndices >::m_colIndices
protected

Definition at line 148 of file IndexedView.h.

◆ m_rowIndices

template<typename XprType , typename RowIndices , typename ColIndices >
RowIndices Eigen::IndexedView< XprType, RowIndices, ColIndices >::m_rowIndices
protected

Definition at line 147 of file IndexedView.h.

◆ m_xpr

template<typename XprType , typename RowIndices , typename ColIndices >
MatrixTypeNested Eigen::IndexedView< XprType, RowIndices, ColIndices >::m_xpr
protected

Definition at line 146 of file IndexedView.h.


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