Eigen::Replicate< MatrixType, RowFactor, ColFactor > Class Template Reference

Expression of the multiple replication of a matrix or vector. More...

Inherits internal::dense_xpr_base::type.

Public Types

typedef internal::dense_xpr_base< Replicate >::type Base
 
typedef internal::remove_all_t< MatrixTypeNestedExpression
 

Public Member Functions

EIGEN_CONSTEXPR Index cols () const
 
const MatrixTypeNested_nestedExpression () const
 
template<typename OriginalMatrixType >
 Replicate (const OriginalMatrixType &matrix)
 
template<typename OriginalMatrixType >
 Replicate (const OriginalMatrixType &matrix, Index rowFactor, Index colFactor)
 
EIGEN_CONSTEXPR Index rows () const
 

Protected Attributes

const internal::variable_if_dynamic< Index, ColFactor > m_colFactor
 
MatrixTypeNested m_matrix
 
const internal::variable_if_dynamic< Index, RowFactor > m_rowFactor
 

Private Types

typedef internal::traits< Replicate >::MatrixTypeNested MatrixTypeNested
 
typedef internal::traits< Replicate >::MatrixTypeNested_ MatrixTypeNested_
 

Detailed Description

template<typename MatrixType, int RowFactor, int ColFactor>
class Eigen::Replicate< MatrixType, RowFactor, ColFactor >

Expression of the multiple replication of a matrix or vector.

Template Parameters
MatrixTypethe type of the object we are replicating
RowFactornumber of repetitions at compile time along the vertical direction, can be Dynamic.
ColFactornumber of repetitions at compile time along the horizontal direction, can be Dynamic.

This class represents an expression of the multiple replication of a matrix or vector. It is the return type of DenseBase::replicate() and most of the time this is the only way it is used.

See also
DenseBase::replicate()

Definition at line 63 of file Replicate.h.

Member Typedef Documentation

◆ Base

template<typename MatrixType , int RowFactor, int ColFactor>
typedef internal::dense_xpr_base<Replicate>::type Eigen::Replicate< MatrixType, RowFactor, ColFactor >::Base

Definition at line 70 of file Replicate.h.

◆ MatrixTypeNested

template<typename MatrixType , int RowFactor, int ColFactor>
typedef internal::traits<Replicate>::MatrixTypeNested Eigen::Replicate< MatrixType, RowFactor, ColFactor >::MatrixTypeNested
private

Definition at line 66 of file Replicate.h.

◆ MatrixTypeNested_

template<typename MatrixType , int RowFactor, int ColFactor>
typedef internal::traits<Replicate>::MatrixTypeNested_ Eigen::Replicate< MatrixType, RowFactor, ColFactor >::MatrixTypeNested_
private

Definition at line 67 of file Replicate.h.

◆ NestedExpression

template<typename MatrixType , int RowFactor, int ColFactor>
typedef internal::remove_all_t<MatrixType> Eigen::Replicate< MatrixType, RowFactor, ColFactor >::NestedExpression

Definition at line 72 of file Replicate.h.

Constructor & Destructor Documentation

◆ Replicate() [1/2]

template<typename MatrixType , int RowFactor, int ColFactor>
template<typename OriginalMatrixType >
Eigen::Replicate< MatrixType, RowFactor, ColFactor >::Replicate ( const OriginalMatrixType &  matrix)
inlineexplicit

Definition at line 76 of file Replicate.h.

77  : m_matrix(matrix), m_rowFactor(RowFactor), m_colFactor(ColFactor)
78  {
79  EIGEN_STATIC_ASSERT((internal::is_same<std::remove_const_t<MatrixType>,OriginalMatrixType>::value),
80  THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
81  eigen_assert(RowFactor!=Dynamic && ColFactor!=Dynamic);
82  }
#define eigen_assert(x)
Definition: Macros.h:902
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
const internal::variable_if_dynamic< Index, ColFactor > m_colFactor
Definition: Replicate.h:107
const internal::variable_if_dynamic< Index, RowFactor > m_rowFactor
Definition: Replicate.h:106
MatrixTypeNested m_matrix
Definition: Replicate.h:105
const int Dynamic
Definition: Constants.h:24

◆ Replicate() [2/2]

template<typename MatrixType , int RowFactor, int ColFactor>
template<typename OriginalMatrixType >
Eigen::Replicate< MatrixType, RowFactor, ColFactor >::Replicate ( const OriginalMatrixType &  matrix,
Index  rowFactor,
Index  colFactor 
)
inline

Definition at line 86 of file Replicate.h.

87  : m_matrix(matrix), m_rowFactor(rowFactor), m_colFactor(colFactor)
88  {
89  EIGEN_STATIC_ASSERT((internal::is_same<std::remove_const_t<MatrixType>,OriginalMatrixType>::value),
90  THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
91  }

Member Function Documentation

◆ cols()

template<typename MatrixType , int RowFactor, int ColFactor>
EIGEN_CONSTEXPR Index Eigen::Replicate< MatrixType, RowFactor, ColFactor >::cols ( void  ) const
inline

Definition at line 96 of file Replicate.h.

96 { return m_matrix.cols() * m_colFactor.value(); }

◆ nestedExpression()

template<typename MatrixType , int RowFactor, int ColFactor>
const MatrixTypeNested_& Eigen::Replicate< MatrixType, RowFactor, ColFactor >::nestedExpression ( ) const
inline

Definition at line 99 of file Replicate.h.

100  {
101  return m_matrix;
102  }

◆ rows()

template<typename MatrixType , int RowFactor, int ColFactor>
EIGEN_CONSTEXPR Index Eigen::Replicate< MatrixType, RowFactor, ColFactor >::rows ( void  ) const
inline

Definition at line 94 of file Replicate.h.

94 { return m_matrix.rows() * m_rowFactor.value(); }

Member Data Documentation

◆ m_colFactor

template<typename MatrixType , int RowFactor, int ColFactor>
const internal::variable_if_dynamic<Index, ColFactor> Eigen::Replicate< MatrixType, RowFactor, ColFactor >::m_colFactor
protected

Definition at line 107 of file Replicate.h.

◆ m_matrix

template<typename MatrixType , int RowFactor, int ColFactor>
MatrixTypeNested Eigen::Replicate< MatrixType, RowFactor, ColFactor >::m_matrix
protected

Definition at line 105 of file Replicate.h.

◆ m_rowFactor

template<typename MatrixType , int RowFactor, int ColFactor>
const internal::variable_if_dynamic<Index, RowFactor> Eigen::Replicate< MatrixType, RowFactor, ColFactor >::m_rowFactor
protected

Definition at line 106 of file Replicate.h.


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