10 #ifndef EIGEN_SELECT_H
11 #define EIGEN_SELECT_H
33 template<
typename ConditionMatrixType,
typename ThenMatrixType,
typename ElseMatrixType>
34 struct traits<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> >
35 : traits<ThenMatrixType>
37 typedef typename traits<ThenMatrixType>::Scalar Scalar;
38 typedef Dense StorageKind;
39 typedef typename traits<ThenMatrixType>::XprKind XprKind;
40 typedef typename ConditionMatrixType::Nested ConditionMatrixNested;
41 typedef typename ThenMatrixType::Nested ThenMatrixNested;
42 typedef typename ElseMatrixType::Nested ElseMatrixNested;
44 RowsAtCompileTime = ConditionMatrixType::RowsAtCompileTime,
45 ColsAtCompileTime = ConditionMatrixType::ColsAtCompileTime,
46 MaxRowsAtCompileTime = ConditionMatrixType::MaxRowsAtCompileTime,
47 MaxColsAtCompileTime = ConditionMatrixType::MaxColsAtCompileTime,
48 Flags = (
unsigned int)ThenMatrixType::Flags & ElseMatrixType::Flags &
RowMajorBit
53 template<
typename ConditionMatrixType,
typename ThenMatrixType,
typename ElseMatrixType>
54 class Select :
public internal::dense_xpr_base< Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> >::type,
55 internal::no_assignment_operator
59 typedef typename internal::dense_xpr_base<Select>::type
Base;
63 Select(
const ConditionMatrixType& a_conditionMatrix,
64 const ThenMatrixType& a_thenMatrix,
65 const ElseMatrixType& a_elseMatrix)
124 template <
typename Derived>
125 template <
typename ThenDerived,
typename ElseDerived>
127 internal::scalar_boolean_select_op<typename DenseBase<ThenDerived>::Scalar,
130 ThenDerived, ElseDerived, Derived>
133 using Op = internal::scalar_boolean_select_op<
144 template <
typename Derived>
145 template <
typename ThenDerived>
147 internal::scalar_boolean_select_op<typename DenseBase<ThenDerived>::Scalar,
154 using ElseConstantType =
156 using Op = internal::scalar_boolean_select_op<
168 template <
typename Derived>
169 template <
typename ElseDerived>
171 internal::scalar_boolean_select_op<typename DenseBase<ElseDerived>::Scalar,
179 using ThenConstantType =
181 using Op = internal::scalar_boolean_select_op<
#define EIGEN_DEVICE_FUNC
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
Generic expression where a coefficient-wise ternary operator is applied to two expressions.
Base class for all dense matrices, vectors, and arrays.
internal::traits< Derived >::Scalar Scalar
CwiseTernaryOp< internal::scalar_boolean_select_op< typename DenseBase< ThenDerived >::Scalar, typename DenseBase< ElseDerived >::Scalar, Scalar >, ThenDerived, ElseDerived, Derived > select(const DenseBase< ThenDerived > &thenMatrix, const DenseBase< ElseDerived > &elseMatrix) const
Expression of a coefficient wise version of the C++ ternary operator ?:
ElseMatrixType::Nested m_else
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
const ElseMatrixType & elseMatrix() const
const ThenMatrixType & thenMatrix() const
const ConditionMatrixType & conditionMatrix() const
internal::dense_xpr_base< Select >::type Base
ConditionMatrixType::Nested m_condition
ThenMatrixType::Nested m_then
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Select(const ConditionMatrixType &a_conditionMatrix, const ThenMatrixType &a_thenMatrix, const ElseMatrixType &a_elseMatrix)
const Scalar coeff(Index i, Index j) const
const Scalar coeff(Index i) const
const unsigned int RowMajorBit
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.