10 #ifndef EIGEN_FLAGGED_H
11 #define EIGEN_FLAGGED_H
32 template<
typename ExpressionType,
unsigned int Added,
unsigned int Removed>
33 struct traits<Flagged<ExpressionType, Added, Removed> > : traits<ExpressionType>
35 enum { Flags = (ExpressionType::Flags | Added) & ~Removed };
39 template<
typename ExpressionType,
unsigned int Added,
unsigned int Removed>
class Flagged
40 :
public MatrixBase<Flagged<ExpressionType, Added, Removed> >
44 typedef MatrixBase<Flagged> Base;
46 EIGEN_DENSE_PUBLIC_INTERFACE(Flagged)
47 typedef typename internal::conditional<internal::must_nest_by_value<ExpressionType>::ret,
48 ExpressionType, const ExpressionType&>::type ExpressionTypeNested;
49 typedef typename ExpressionType::InnerIterator InnerIterator;
51 inline Flagged(const ExpressionType& matrix) : m_matrix(matrix) {}
53 inline Index rows()
const {
return m_matrix.rows(); }
54 inline Index cols()
const {
return m_matrix.cols(); }
55 inline Index outerStride()
const {
return m_matrix.outerStride(); }
56 inline Index innerStride()
const {
return m_matrix.innerStride(); }
58 inline CoeffReturnType coeff(Index row, Index col)
const
60 return m_matrix.coeff(row, col);
63 inline CoeffReturnType coeff(Index index)
const
65 return m_matrix.coeff(index);
68 inline const Scalar& coeffRef(Index row, Index col)
const
70 return m_matrix.const_cast_derived().coeffRef(row, col);
73 inline const Scalar& coeffRef(Index index)
const
75 return m_matrix.const_cast_derived().coeffRef(index);
78 inline Scalar& coeffRef(Index row, Index col)
80 return m_matrix.const_cast_derived().coeffRef(row, col);
83 inline Scalar& coeffRef(Index index)
85 return m_matrix.const_cast_derived().coeffRef(index);
88 template<
int LoadMode>
89 inline const PacketScalar packet(Index row, Index col)
const
91 return m_matrix.template packet<LoadMode>(row, col);
94 template<
int LoadMode>
95 inline void writePacket(Index row, Index col,
const PacketScalar& x)
97 m_matrix.const_cast_derived().template writePacket<LoadMode>(row, col, x);
100 template<
int LoadMode>
101 inline const PacketScalar packet(Index index)
const
103 return m_matrix.template packet<LoadMode>(index);
106 template<
int LoadMode>
107 inline void writePacket(Index index,
const PacketScalar& x)
109 m_matrix.const_cast_derived().template writePacket<LoadMode>(index, x);
112 const ExpressionType& _expression()
const {
return m_matrix; }
114 template<
typename OtherDerived>
115 typename ExpressionType::PlainObject solveTriangular(
const MatrixBase<OtherDerived>& other)
const;
117 template<
typename OtherDerived>
118 void solveTriangularInPlace(
const MatrixBase<OtherDerived>& other)
const;
121 ExpressionTypeNested m_matrix;
130 template<
typename Derived>
131 template<
unsigned int Added,
unsigned int Removed>
132 inline const Flagged<Derived, Added, Removed>
140 #endif // EIGEN_FLAGGED_H
const Flagged< Derived, Added, Removed > flagged() const
Definition: Flagged.h:133