31template<
typename ConditionMatrixType,
typename ThenMatrixType,
typename ElseMatrixType>
38 typedef typename ConditionMatrixType::Nested ConditionMatrixNested;
39 typedef typename ThenMatrixType::Nested ThenMatrixNested;
40 typedef typename ElseMatrixType::Nested ElseMatrixNested;
42 RowsAtCompileTime = ConditionMatrixType::RowsAtCompileTime,
43 ColsAtCompileTime = ConditionMatrixType::ColsAtCompileTime,
44 MaxRowsAtCompileTime = ConditionMatrixType::MaxRowsAtCompileTime,
45 MaxColsAtCompileTime = ConditionMatrixType::MaxColsAtCompileTime,
46 Flags = (
unsigned int)ThenMatrixType::Flags & ElseMatrixType::Flags &
RowMajorBit
51template<
typename ConditionMatrixType,
typename ThenMatrixType,
typename ElseMatrixType>
58 EIGEN_DENSE_PUBLIC_INTERFACE(
Select)
66 eigen_assert(m_condition.rows() == m_then.rows() && m_condition.rows() == m_else.rows());
67 eigen_assert(m_condition.cols() == m_then.cols() && m_condition.cols() == m_else.cols());
74 const Scalar coeff(Index i, Index
j)
const
76 if (m_condition.coeff(i,
j))
77 return m_then.coeff(i,
j);
79 return m_else.coeff(i,
j);
83 const Scalar coeff(Index i)
const
85 if (m_condition.coeff(i))
86 return m_then.coeff(i);
88 return m_else.coeff(i);
107 typename ConditionMatrixType::Nested m_condition;
108 typename ThenMatrixType::Nested m_then;
109 typename ElseMatrixType::Nested m_else;
121template<
typename Derived>
122template<
typename ThenDerived,
typename ElseDerived>
135template<
typename Derived>
136template<
typename ThenDerived>
139 const typename ThenDerived::Scalar&
elseScalar)
const
142 derived(), thenMatrix.derived(), ThenDerived::Constant(rows(),cols(),
elseScalar));
150template<
typename Derived>
151template<
typename ElseDerived>
157 derived(), ElseDerived::Constant(rows(),cols(),
thenScalar), elseMatrix.derived());
Base class for all dense matrices, vectors, and arrays.
Definition DenseBase.h:49
Expression of a coefficient wise version of the C++ ternary operator ?:
Definition Select.h:54
Pseudo expression representing a solving operation.
Definition Solve.h:63
Definition XprHelper.h:50
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:61
The type used to identify a dense storage.
Definition Constants.h:490
Definition XprHelper.h:428
Definition ForwardDeclarations.h:17