25 #ifndef EIGEN_SELECT_H
26 #define EIGEN_SELECT_H
46 template<
typename ConditionMatrixType,
typename ThenMatrixType,
typename ElseMatrixType>
47 struct traits<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> >
51 typedef Dense StorageKind;
53 typedef typename ConditionMatrixType::Nested ConditionMatrixNested;
54 typedef typename ThenMatrixType::Nested ThenMatrixNested;
55 typedef typename ElseMatrixType::Nested ElseMatrixNested;
57 RowsAtCompileTime = ConditionMatrixType::RowsAtCompileTime,
58 ColsAtCompileTime = ConditionMatrixType::ColsAtCompileTime,
59 MaxRowsAtCompileTime = ConditionMatrixType::MaxRowsAtCompileTime,
60 MaxColsAtCompileTime = ConditionMatrixType::MaxColsAtCompileTime,
61 Flags = (
unsigned int)ThenMatrixType::Flags & ElseMatrixType::Flags &
HereditaryBits,
62 CoeffReadCost =
traits<
typename remove_all<ConditionMatrixNested>::type>::CoeffReadCost
64 traits<
typename remove_all<ElseMatrixNested>::type>::CoeffReadCost)
69 template<
typename ConditionMatrixType,
typename ThenMatrixType,
typename ElseMatrixType>
70 class Select : internal::no_assignment_operator,
71 public internal::dense_xpr_base< Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> >::type
75 typedef typename internal::dense_xpr_base<Select>::type
Base;
90 const Scalar
coeff(Index i, Index j)
const
98 const Scalar
coeff(Index i)
const
136 template<
typename Derived>
137 template<
typename ThenDerived,
typename ElseDerived>
150 template<
typename Derived>
151 template<
typename ThenDerived>
154 typename ThenDerived::Scalar elseScalar)
const
157 derived(), thenMatrix.derived(), ThenDerived::Constant(rows(),cols(),elseScalar));
165 template<
typename Derived>
166 template<
typename ElseDerived>
172 derived(), ElseDerived::Constant(rows(),cols(),thenScalar), elseMatrix.derived());
177 #endif // EIGEN_SELECT_H