25 #ifndef EIGEN_FLAGGED_H
26 #define EIGEN_FLAGGED_H
47 template<
typename ExpressionType,
unsigned int Added,
unsigned int Removed>
48 struct traits<Flagged<ExpressionType, Added, Removed> > :
traits<ExpressionType>
50 enum { Flags = (ExpressionType::Flags | Added) & ~Removed };
54 template<
typename ExpressionType,
unsigned int Added,
unsigned int Removed>
class Flagged
55 :
public MatrixBase<Flagged<ExpressionType, Added, Removed> >
59 typedef MatrixBase<Flagged> Base;
62 typedef typename internal::conditional<internal::must_nest_by_value<ExpressionType>::ret,
63 ExpressionType, const ExpressionType&>::type ExpressionTypeNested;
64 typedef typename ExpressionType::InnerIterator InnerIterator;
66 inline Flagged(const ExpressionType& matrix) : m_matrix(matrix) {}
68 inline Index rows()
const {
return m_matrix.rows(); }
69 inline Index cols()
const {
return m_matrix.cols(); }
70 inline Index outerStride()
const {
return m_matrix.outerStride(); }
71 inline Index innerStride()
const {
return m_matrix.innerStride(); }
73 inline CoeffReturnType coeff(Index
row, Index
col)
const
75 return m_matrix.coeff(row, col);
78 inline CoeffReturnType coeff(Index index)
const
80 return m_matrix.coeff(index);
83 inline const Scalar& coeffRef(Index row, Index col)
const
85 return m_matrix.const_cast_derived().coeffRef(row, col);
88 inline const Scalar& coeffRef(Index index)
const
90 return m_matrix.const_cast_derived().coeffRef(index);
93 inline Scalar& coeffRef(Index row, Index col)
95 return m_matrix.const_cast_derived().coeffRef(row, col);
98 inline Scalar& coeffRef(Index index)
100 return m_matrix.const_cast_derived().coeffRef(index);
103 template<
int LoadMode>
104 inline const PacketScalar packet(Index row, Index col)
const
106 return m_matrix.template packet<LoadMode>(
row,
col);
109 template<
int LoadMode>
110 inline void writePacket(Index row, Index col,
const PacketScalar& x)
112 m_matrix.const_cast_derived().template writePacket<LoadMode>(
row,
col, x);
115 template<
int LoadMode>
116 inline const PacketScalar packet(Index index)
const
118 return m_matrix.template packet<LoadMode>(index);
121 template<
int LoadMode>
122 inline void writePacket(Index index,
const PacketScalar& x)
124 m_matrix.const_cast_derived().template writePacket<LoadMode>(index, x);
127 const ExpressionType& _expression()
const {
return m_matrix; }
129 template<
typename OtherDerived>
130 typename ExpressionType::PlainObject solveTriangular(
const MatrixBase<OtherDerived>& other)
const;
132 template<
typename OtherDerived>
133 void solveTriangularInPlace(
const MatrixBase<OtherDerived>& other)
const;
136 ExpressionTypeNested m_matrix;
145 template<
typename Derived>
146 template<
unsigned int Added,
unsigned int Removed>
147 inline const Flagged<Derived, Added, Removed>
155 #endif // EIGEN_FLAGGED_H